Ubuntu


Home Blog Tech News Basic Commands Scripting $ Tips And Tricks Terms Explanation Help+Links



##

Recover Ubuntu after XP Setup/recover grub boot loader: There are two simple ways to recover Uubntu (Grub boot loader) after you setup windows xp in your computer.

✦Super Grub Disk
✦Manul Commands

Super Grub Disk:

Go to http://www.supergrubdisk.org
Super grub disk is avialable for windows(.exe) for cd rom (.iso) for usb device (.tar/.gz). Download your one.If you have downloaded the windows version then just install the soft(or sometimes just double click and follow some instraction) and reboot.In next boot you will see an extra boot menu named "super grub diks" or so.Follow the instruction and you are done.

If you have downloaded the .iso file burn it in a blank cd.Boot wiht it and follow the instraction. For more information visit http://www.supergrubdisk.org


Manually (with Command):
Take a cd/dvd containing equal or later version of Ubuntu than installed one in your Hard Disk.Boot with that Ubuntu live CD. Open terminal.
Type:

sudo fdisk -l
This will show details of Hard Disk.Look at the output of this command.Output will look like this:
/dev/sda /dev/sda
Look at the red color one.This will be different in your terminal. Now type:
sudo mount /dev/sda* /mnt
sudo grub-install --root-directory=/mnt /dev/sda
If nothing is wrong your grub will be installed in your Hard Disk.

[ Note that sometimes when i type the command above it shows that it cannot find/read correctly the "satge1" or "stage2" file (located in /boot folder).Then i restart the pc two to there times and the problem is gone.But sometimes that does not work.Sorry to tell that i dont know the sollution and in that case the only sollution i found is to reinstall the Ubuntu in Hard Disk with a Ubuntu cd/dvd. ]

Now type:
sudo reboot
to restart your Computer.In the next boot you will find your desired Grub boot loader.
Enjoy.

##

Change the message on your login page:

If you need to change the message of your virtual console login screen, edit the

/etc/issue
fle and write the message that you want to appear at your login screen.

 

##

Prevent users from changing their passwords:

Usually /usr/bin/passwd has the following SUID permission:
-r-s--x--x 1 root root 19348 Nov 7 2009 /usr/bin/passwd
Te numerical value of the fle permission translates to 4411. When a SUID fle is executed, the process that runs it is granted access to system resources based on the user who owns the fle and not the user who created the process. So, we need to remove the SUID for that command, so that normal users are denied the privileges of updating the fle:
chmod u-s /usr/bin/passwd
…or:
chmod 511 /usr/bin/passwd
##

increase the size of swap without reinstalling the OS/wihtout formating:

This can be done by either adding a new swap partition or creating a swap fle, instead. You can add a new swap fle to increase the swap size as this is possible even if you do not have free unpartitioned space in your hard disk for creating new partitions, but have free space on one of your partitions.To make a swap fle of 1 GB, multiply 1024 MB and 1024 to get a block size. Now, at a shell prompt, as the root user, type the following command with the count being equal to the desired block size:

dd if=/dev/zero of=/swapfle bs=1024 count=1048576
Now set up the swap fle:
mkswap /swapfle
Enable the swap fle after creating it by using the following command:
swapon /swapfle
Add the following entry in the the
/etc/fstab
fle to make the system activate this fle as swap while booting the system:
/swapfle swap swap defaults 0 0
This will enable your 1 GB swap space, every time your system boots. You can check the size of swap by using the free command or by
cat /proc/swap.
 

 

##
Want to run soft/script/command automatically run in the background at regular intervals: Scheduling a task/job is done using a utility called cron, which makes tasks automatically run in the background at regular intervals. To manage cron jobs, there is crontab, a fle that contains the schedule of cron entries to be run at specifed times. To set up a scheduler, you need to make entries in this. Executing crontab -e opens the fle in editable mode so that you can enter the details and save it. The crontab syntax has fve felds as mentioned below.
* * * * *
command Here, you can replace the frst asterisk to enter the day of week—0 to 6, where 0 is Sunday. You can enter the month (1-12) in place of the second asterisk. Replace the third asterisk with the day of month (1-31). The fourth one is for the hour (0-23), while the ffth one is to enter the minutes (0-59). For example, if you need to run a script daily at 5:30 p m, then the entry will as shown below:
30 17 * * * sh /home/myuser/ scripttorun.sh >/dev/null 2>&1
If the last part
“>/dev/null 2>&1”
is omitted, then by default, cron will send an e-mail to the user account after executing the cronjob.

 

##

More are coming soon:

I m trying to update the site

EVERYDAY........

 

© 2009 | Touhidul Islam.                                                                             © 2009 | Touhidul Islam.
You are staying here for: seconds!
 


....