November 13, 2009

Backing Up home Directory

A few days back, I suddenly started facing many problems, all at the same time. Many of my software started misbehaving, and eth0 (ethernet) failed to connect (two instances). Later, on booting, an error showed up saying that /home couldn't be found. Thankfully, I had another account. Using that account, I did the following.

1. Open the terminal, and type,

oracle@varsha-laptop:~$ su

Enter the root password, when prompted.

2. Go to your home directory, and list all the files and directories.

root@varsha-laptop:/usr/lib/oracle/xe# cd /home
root@varsha-laptop:/home# ls
lost+found samba varsha varsha1


3. See if directories of your home directory are accessible using cd.

root@varsha-laptop:/home# cd varsha
root@varsha-laptop:/home/varsha# ls

4. Estimate file size.

root@varsha-laptop:/home/varsha# du -sh /home/varsha
12G /home/varsha


5. Copy home directory to another disk having free space.

root@varsha-laptop:/home/varsha# cp -R /home/varsha /media/disk-1

You can now install Linux, and copy the important documents to the home directory.



Giving sudo Privileges To A User

The /etc/sudoers.tmp file must be edited, in order to give sudo access to any user.

1. Open a terminal and type,

varsha@varsha-laptop:~$ EDITOR=gedit sudo visudo

visudo is used for editing the sudoers file. See the manual for more details.

varsha@varsha-laptop:~$ man visudo

2. At the end of the file, append,

system_username ALL=(ALL) ALL

where system_username is the username of the user whom you want to give a sudo privilege.

Graphically, it can be done as given in this tutorial.



Reinstalling GRUB

GRUB is generally lost due to Windows install or if your MBR gets erased. Follow the simple steps given below to restore GRUB.

1. Boot your computer using a Linux live CD.

2. Open a terminal and type,

liveuser@liveuser-laptop:~$ sudo grub

This gives you the grub prompt.

3. To inform the GRUB about the location of the GRUB files, we should know it ourselves first. Generally, it is (hd0,1), which means hda (primary controller master) in the second partition.

If you know where they are, type ,

grub> root (hd0,1)

Else to find out, type,

grub> find /boot/grub/stage1

4. Then install it on hd0 (or any other hard drive in your case), which is the MBR of the first HDD.

grub>setup (hd0)

5. To quit, type

grub> quit

6. Reboot your machine.

liveuser@liveuser-laptop:~$ reboot

The GRUB menu appears on system reboot.



New RSS Feed For Twitter

I have taken up a project (in fact my first ever project) under Shreyank Gupta (of Red Hat) as my mentor for making an RSS feed for Twitter.

The following are the plans for the software.

1. It will be made using Ruby on Rails (RoR).

2. It will accept RSS feeds of Twitter in an xml file.

3. It will have a database for storing the tweets, and additional features can be added later.

4. Any tweet can be clicked to get a conversation if available.

5. I plan to complete the software in 2 months, starting from 28th December 2009. The first fifteen days will be utilized for learning RoR.

6. A testing model will be ready within the third week of February. After any required changes, the final working model will be ready by the last week.

I hope I will be able to complete the software as per the above-laid plans.