Saturday, April 20, 2013

Editing a flash file in linux

Editing a flash file can be done simply by two commands :

1.  Convert the flash(.swf) file to xml file using :

                         swfmill swf2xml flash.swf flash.xml


2.  Now, edit the xml file, save changes and convert the xml file back to flash(.swf) file using :

                     swfmill xml2swf flash.xml flash.swf

Friday, February 1, 2013

Sending form details to admin via e-mail on clicking Submit button

We need a mail server for this purpose. For example : for sending mails to gmail, we have smtp server. There are various other softwares that are available on internet. If you have all the requirements then you can easily perform this task with the following code :

HTML code for this :

<html>
<body>
    <form action="mail.php" method="post">
FIRST NAME : <input type="text" name="firstname"><br></br>
LAST NAME : <input type="text" name="lastname"><br></br>
Date Of Birth : <input type="text" name="dob"><br></br>
GENDER : <input type="radio" name="gender" value="male">Male
             <input type="radio" name="gender" value="female">Female<br></br>
EMAIL : <input type="text" name="email"><br></br>
CITY : <input type="text" name="city"><br></br>
               <center><input type="submit"></font></center>
</form>
</body>
</html>

PHP code i.e. "mail.php" file : 

<?php
$to="example@gmail.com";
$subject="Registration";
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$dob=$_POST['dob'];
$gender=$_POST['gender'];
$email=$_POST['email'];
$city=$_POST['city'];
$msg_body="First Name : $firstname\n";
$msg_body.="Last Name : $lastname\n";
$msg_body.="Date of Birth : $dob\n";
$msg_body.="Gender : $gender\n";
$msg_body.="E-Mail : $email\n";
$msg_body.="City : $city\n";
mail( $to, $subject,$msg_body);
header("Location: thankyou.html");
?>



Wednesday, December 14, 2011

Problem : No init found

If you boot into your system and face this problem -
                No init found.Try passing init=bootary.
This problem can be simply solved  using a live cd.Open terminal and type -                      sudo fdisk -l
This will list all the partitions.Look out for linux partition(it was /dev/sda9 in my case ) and then type -
                                  sudo fsck /dev/sda9
press 'y' to fix all errors .When scan is finished,reboot the system and you can boot into system again :)

Tuesday, May 24, 2011

To Play Games in DosBox

Playing games in DosBox is very easy. Just follow these instructions:
Install DosBox from Ubuntu Software Center or in Terminal by  typing :                 sudo apt-get install dosbox
To run games in DosBox:
Make a directory under your home folder where you want to place your games.for example:Make a directory named "dosgames" by using the command-  mkdir dosgames in terminal or by directly creating a folder in home folder.
To play games in DosBox,games must be present on your pc. Games can be easily downloaded from www.dosgames.com or any other site.Once you have downloaded a game,for example:bounce,extract its files and place it under the folder 'dosgames'.
Now open DosBox from Applications>Games>DosBox
or by writing in terminal-'dosbox'
The DosBox window will open now.To mount the directory 'dosgames ' write the following commands-
z:\> mount c /home/homefolder/dosgames
z:\> c:
c:\> cd bounce
c:\BOUNCE>bounce
Your game will start now.
To switch into or out of "fullscreen" of dosbox,press 'alt+enter'.

Wednesday, April 13, 2011

Recovery of GRUB after re-installing Windows

To get back your Grub, you need to boot your system using  Ubuntu Live CD and after making your Cd work , follow these steps:
  • To check the version of Grub , in Terminal type-                                                          grub-install -v    
GRUB2 should display a version number of 1.96 or later.If you don't 
have Grub2 installed,you can install it from Synaptic.After that go to 
Places and mount your Ubuntu partition.Then Go into boot/grub 
directory and check for the existence of the file grub.cfg. 
       Now you need to switch to the terminal-
  • Verify if you mounted the right partition by typing-
                    mount | tail -1 
It will show an output like this- 
/dev/sda9 on /media/0d104aff-ec8c-44c8-b811-92b993823444 type 
ext4 (rw,nosuid,nodev,uhelper=udisks)
To make sure this is indeed the Ubuntu boot partition,run-
ls /media/0d104aff-ec8c-44c8-b811-92b993823444 
but replace '0d104aff-ec8c-44c8-b811-92b993823444' with your UUID.
Output of this command should be similar to this-
config-2.6.18-3-686        initrd.img-2.6.18-3-686.bak   System.map-2.6.18-3-686
grub                           lost+found                          vmlinuz-2.6.18-3-686
initrd.img-2.6.18-3-686    memtest86+.bin 
Now we just need to reinstall GRUB by specifying the correct 
directory and the correct drive name , type - 
 sudo grub-install --root-directory=/media/ 
0d104aff-ec8c-44c8-b811-92b993823444 /dev/sda 
If all went well, you should see something like this-
Installation finished. No error reported.
Now Reboot.Grub should be installed and both Ubuntu and Windows 
should have been automatically detected and listed in the menu.