Sunday, May 31, 2009

PUPPY LINUX: For the slower machines

I have a Pentium IV (6 years old) machine on which I usually try new linux distros and versions. Over the years the newer and newer linux versions of Ubuntu and Fedora have been becoming bulkier, specially the GUI (Gnome and KDE), making my system slower and slower. Even the XFCE desktop doesn't help much. So I decided to try one of the "lighter linux versions" - PUPPY LINUX.



Their new 4.2 version is out and the whole distribution is < 150 MB in size. The LIVE CD can load into the RAM of almost all machines making applications load much much faster. There is a huge improvement in the system response time compared to UBUNTU and FEDORA versions. I have to say that the GUI is not very polished or sophisticated compared to Gnome or KDE, but is more than enough for any average computer user.

The most impressive feature was the huge list of applications they had packed within 150 MBs. Everything works out of the box. They have an application for every need - browser, audio codecs, video codecs, pdf viewer, etc. Even the flash plugin for the browser worked out of the box. I also tried the live CD on my laptop and the wireless driver worked flawlessly. There is also a package manager through which you can install many other common applications including Firefox, Mplayer, xpdf, Open Office, etc.

Overall, it is a brilliant light weight linux distribution which is worth consideration for your older machines. Many linux fans might also like DSL (Damn Small Linux), but its GUI was very crude compared to PUPPY LINUX. PUPPY is my personal choice.

A quote on PUPPY's website reads "I must say I think Puppy is more amazing than the initial impression you get" - which is probably true.

Friday, May 15, 2009

CRON: Schedule Automated Jobs

If you want to automate running any job, say running a BASH script, every day at 5:00 am - a solution in Linux/Unix is running a CRON job.

For example, you might want to back up your /home directory every day. In a linux system you can automate this very easily. It makes life so much easier - you do not have to remember to backup, even better - you don't even have to even move your finger. Let Linux take care of it for you!

To run a cron job:

1) Make sure you are running the crond daemon on your system.
eg: In a fedora system you might want to run
/etc/init.d/crond start

2) It is always better to run cron as user than as root. To setup a cron job as a user you need to create a text file specifying your job. There is a command to create this text file in linux - "crontab". Run crontab as a user.
crontab -e
This command should open a text file in your default text editor (usually "vi"). If you want to change your default text editor to, say emacs, type
export EDITOR=emacs
Then use crontab -e.
Now edit the file to add your cron job. Below is an example cron file I use:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
HOME=/home/username
LOGNAME=username

# run-job
0 5 * * * bash /home/username/rsync_backup/rsync_bash_script.sh > /home/username/rsync_backup/backup.log


Now save the file and restart your crond by using /etc/init.d/crond restart

The above job is to run the script rsync_bash_script.sh and store the output of the script to backup.log file. I have only one job here, but you can add any number of lines/jobs to the above file.

The 5 fields "0 5 * * *" before each line are required to tell cron when to execute the command.
In this example I execute the command at:

0 - at 0th minute of the hour
5 - at the 5th hour of the day(i.e 5:00 am)
* - every day of the week
* - every week of the month
* - every month of the year

3) Finally you want to make sure you are not black listed from using cron as a user in the current system. To make sure of that you need to check /etc/cron.allow and /etc/cron.deny files.

Make sure your username does not appear in the /etc/cron.deny file. If both files are empty you are fine.


You are now setup to run a routine bash script every day at 5:00 am.

FIREFOX: Close Download Manager After Download

One of the most annoying things I find in mozilla firefox browser is the "Download Manager". The window never closes after the download and waits for the user to close it manually. But this configuration can be changed! This is the way I managed to do it:

Open the browser and go to the page "about:config"

Filter for "download"

Double click the configuration browser.download.manager.closeWhenDone to change it from false to true.

Thats it!

Happy Browsing.