Saturday, December 19, 2009

Timed Shutdown: Gshutdown

I recently found a nice GUI option for shutdown command - gshutdown.

Though I still prefer the elegant command line option, the GUI feature does make it more usable.

It is available through package manager in ubuntu 9.10.

sudo apt-get install gshutdown

You can add it to your panel(from Applications > Accessories) and run it as root.
The below image are my settings from its icon properties:



Its auto detect features did not work for me so I manually defined commands
for shutdown and reboot.

My custom command for shutdown is as below:

Wednesday, December 9, 2009

GNOME: Resume from suspend without password

When you resume your laptop from suspend/hibernate, Gnome usually asks for your password. This feature can be annoying in a single user laptop computer.

To change this setting open gconf-editor.
If you don't have it, install using your package manager (sudo apt-get install gconf-editor).

apps > gnome-power-manager > lock

Unselect all selected options. My setting looks as in the figure.

Monday, November 23, 2009

GRACE: Best 2D Plotting Software?

Do not get fooled by the bad looks of Grace; When it comes to functionality, it doesn't get better than this.

I am still a fan of gnuplot, but in 2D plotting grace beats gnuplot hands down.

It will do anything you want in a 2D plot - integration, differentiation, correlation, linear and non-linear curve-fitting....you name it.

You can also use scripting to automate the plotting. In my opinion, the ideal plotting software, specially for linux users.

Fedora, Ubuntu, Debian and most distros have it in their repository.
Just search for grace in your package manager.

Saturday, November 21, 2009

Multi-finger Touchpad in Linux

Most notebook touchpads will support multitouch (Mac like) features in linux.
Touchpads do not need hardware enhancements, but just need software drivers to activate the feature on your laptop.

NOTE: Some Sony laptops may not work with gsynaptics. Sony sometimes use their own native hardwares which are not supported in linux.

In linux "gsynaptics" package does the trick.
You can even enable n-finger functionalities if you are interested enough (just google multi finger touchpad for linux).

The two-finger scroll features are default features with gsynaptics.

You can install it by apt-get :

sudo apt-get install gsynaptics

Goto System > Preferences > Mouse Preferences (or) Touchpad
to enable all the features you need.

In systems older than ubuntu 9.10 you might have to add a line to your /etc/X11/xorg.conf.
(It is a good idea to backup before you make the change)
Add the following line to xorg.conf under the section: Section "InputDevice"

Option "SHMConfig" "on"

Then you need to restart your X11 by:
# sudo /etc/init.d/gdm restart

The pinch and zoom-out features (seen in i-phone) are patented by Apple and so cannot be implemented in linux.

In older linux systems (If you get errors):

1) Create a system file and add few lines to it:

sudo gedit /etc/hal/fdi/policy/shmconfig.fdi

2) Add the following lines to the file:

click here


3) Reboot the computer.

Now your SHMConfig should be enabled.
You will be able to edit your mouse settings from the "touchpad" menu.

Saturday, November 14, 2009

Google Chrome for Linux

Chrome browser in my Ubuntu 9.10 laptop is much faster and lighter than Firefox.
I am a big Firefox fan, but lately it has become so heavy that I had to try some other lighter browser. Chrome works without any crashes for me so far.

Chrome may not be as safe as Firefox, but for everyday-browsing it is perfect.
I still use Firefox to check my bank accounts.

For installation on Ubuntu follow:

http://www.google.com/chrome

Wednesday, November 4, 2009

Sopcast on Ubuntu

Install sopcast on ubuntu from http://linuxtoy.org/archives/gtk_sopcast.html(.deb package)

If required you might also have to install libstdc++5

It works perfectly well on my Ubuntu 9.10 laptop.

You can use VLC media player to play the video by changing the settings.

Saturday, October 3, 2009

Evince: Open encrypted pdf documents

Evince is an all-in-one document reader to read pdf, ps, eps, dvi documents.

Advantages:

1) Loads faster than most pdf readers

2) Reads encrypted pdf documents (allows you to print protected documents)

3) Reads most of my normally used documents (specially when using Latex)

Do try it. It comes automatically with most linux (gnome) distributions.

Friday, October 2, 2009

Ubuntu: Faster bootup and performance

Unlike a server one does not need a lot of services to be running in the background on a laptop. The best way to speed up the boot time and performance on a ubuntu laptop will be to use the Boot-Up Manager.

You can install it by:

sudo apt-get install bum

In my laptop I disabled the following services which I do not use and I gained at least 8 seconds of boot up time. System wake up from sleep is also faster.

Service disabled:

stop-bootlogd
rsync
pppd-dns
cron
hotkey-setup
dns-clean
jetty
cups
apmd
atd
klogd
saned
bootlogd
sysklogd
bluetooth

Sunday, August 30, 2009

Beautify your GNOME desktop

There seems to be couple of ways you can make your gnome desktop look fancy and pleasing to the eyes without actually using compiz effects. I do not personally prefer those desktop effects since they suck in a lot of battery on my laptop. They might be well suited for desktops.

1) Install MAC like window manager.

Installation: sudo apt-get install awn-manager awn-applets-c-core awn-applets-c-extras



You do require to activate composite manager on your desktop for this to work.
Open gconf-editor --> apps --> metacity --> general --> compositing manager (select this option).

2) Another nice addition would be gnome screenlets.

Installation: sudo apt-get install screenlets



The editor is straight forward to use and the screenlets add a nice feel to your desktop

Friday, August 7, 2009

ZIM: Desktop Wiki / Personal Wiki



Zim is a local personal Wiki for your desktop.

I find it very useful to quickly noting down all those tricky/petty details which I keep forgetting, but use often. Every time I forget something trivial...hold on, it is on my wiki!!

Specially program templates. When writing a new code I always know that I had written something similar sometime back, but cannot figure out in which folder I have that old code.
Now-a-days I don't have that problem. Zim comes to my rescue every time!

I would say it is a must try for any computational guy.

SONGBIRD: Audio Manager



I recently tried a fantastic Music player/Manager SONGBIRD from Mozilla. A great free product!

I usually use VLC media player, but if you are looking for more than a music player, a music manager - something to take care of all your local music files, I would surely recommend songbird.

Friday, June 19, 2009

StatCounter: See your blog visitors



If you wish to check visitors to your blog - which page is most visited, which search engine gives you maximum number of hits etc, then you might want to use StatCounter.

It was very useful for me to know which of my blogs was most read, so that I could write more useful blogs for readers.

StatCounter is free was easy to use. They give you a small html script to be pasted in your website.

The best feature I liked was the map of the world showing from where most people visit your blog.

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.

Tuesday, April 7, 2009

Sylpheed: Nice Email Client for Linux

I use email clients mainly to read mails on my local server mailbox (fedora 8). I had used evolution for a long time. Contrary to the normal conception, I found evolution to be very buggy. I had to deal with segmentation faults so often that I got fed up and finally made up my mind to discard it. Apart from being buggy, Evolution is very bulky and has too many features which I do not require.

I tried Balsa next. It was light with very minimal features, but unfortunately it was also buggy. Every time I had to kill an already running balsa before I could open it to read my mails!

Seeking solution I googled and found good things about a light and featureful client SYLPHEED. I installed it through yum, setup my local mail box, and my first impressions were "thats nice". I have been using it for the past few weeks and to say the least it is the best email client I have used so far. I has all the required features, nice interface, menus, fonts, colors, etc. Best of all, it is faster than Balsa or Evolution.

If you are not happy with your email client and want to try something different I would recommend Sylpheed.

Wednesday, April 1, 2009

Simple Statistics

A small bash script (with awk) to find out simple statistics on data. The data should be in a single column in a file. The file can contain any number of columns.

simple_stat - download
simple_stat - view


example usage: ./simple_stat [filename] [column number] [column separator]

The script outputs:

Column number,
Sum,
Average,
Standard Deviation,
Number of lines in the file,
Maximum value,
Minimum Value.

the output, for example, could be something like:

column= 1 Sum= -5.914206 Avg= -0.029571 SD= 0.760153 Num_of_lines= 200 max= 1.427456 min= -1.305308

Very often we end up with block files having data in each column. This script will be very useful to get some simple statistics on those data.

Sunday, March 29, 2009

BASH & PYTHON: escape sequence for printing output in the same line

The escape sequence for printing in the same line is '\r' in BASH and \033[A in python.
Include that in any code in BASH shell X11 environment to print in the same line instead of jumping to the next line.

For example, the bash code

for ((i=1;i<10;i++))
do
echo -e "i = " $i
done


prints output as:
i = 1
i = 2
i = 3
i = 4
i = 5
i = 6
i = 7
i = 8
i = 9


But the same code with the escape sequence '\r'

for ((i=1;i<10;i++))
do
echo -en "i = \r" $i
# (or) printf "i= %d \r" $i
sleep 1s
done


prints the output in a single line as:

i = 1

and finally the line goes off.

This can be very useful when following the progress of a code.
I haven't tried it in C, but it might work in C and C++ as well.


In python the following works:

#!/usr/bin/python

import time

for i in range(0,10):
print "i= %d \033[A" %i
time.sleep(1)

Monday, March 16, 2009

Kernel .config file for IBM T60 laptop (Ubuntu)

To check if compiling a new lighter kernel can save battery runtime and be faster on my IBM T60 laptop, I created a kernel .config file and compiled a new kernel.

I currently run Ubuntu 8.1 on my laptop. Ubuntu default kernel is loaded with a lot of kernel modules which I did not need for my laptop.

Here is a gist of my crude understanding of the outcome:

1) GNOME was too heavy to notice any considerable battery runtime improvement.

2) The applications definitely load faster on GNOME. Possibly by a few microseconds as I could feel a tangible difference.

3) XFCE works brilliantly well with the new kernel. I could almost get 20 mins extra with an overall runtime of approx 2 hr 45 mins.

4) The applications load very fast in XFCE.

5) I did get faster boot, shutdown, and recovery from sleep.

I did not try to quantify any of the above. If any of you try it on your laptop do let me know about the performance. Thanks.

Monday, March 9, 2009

Scientific Python VMD module

Scientific Python has a very useful VMD visualization module. There was small bug in the code which had to be fixed.

You can create any VMD object very easily using this module.

Here (Download) is the updated module.
View the module

Wednesday, March 4, 2009

Simple brochure template in latex

It is hard to search online and find a simple latex template for making a brochure.

So here is one...brouchure.tex -download

brochure.tex - view




Tuesday, February 24, 2009

GROMACS with Intel compilers

Thanks to craigb I managed to compile GROMACS 4.0 using intel compilers.

In a simple test run GROMACS with intel compilers was atleast 33% faster than GNU compilers. IT CAN SAVE YOU 1/3rd OF YOUR TIME!!


Download and install intel compilers and math kernel libraries from Intel.
Note down your version numbers and change it where ever necessary.

Download gromacs and unzip/untar it.

Here is the step-by-step procedure I followed for installation:

1) Make changes at two place in the "configure" file

Alter
LIBS="-lmkl $LIBS"
to
LIBS="-lmkl_intel -lmkl_sequential -lmkl_core $LIBS"


2) Add the following to the ~/.bashrc file

export LD_LIBRARY_PATH="/opt/intel/mkl/10.0.4.023/lib/32"



3) To install GROMACS: (install dir is /usr/local/gromacs)

./configure CC="icc" CPPFLAGS="-I/opt/intel/mkl/10.0.4.023/include" LDFLAGS="-L/opt/intel/mkl/10.0.4.023/lib/32" --with-fft=mkl

make

make install


4) To enable mpi with mdrun: ("mdrun_mpi" will be installed)

make clean

./configure CC="icc" CPPFLAGS="-I/opt/intel/mkl/10.0.4.023/include" LDFLAGS="-L/opt/intel/mkl/10.0.4.023/lib/32" --with-fft=mkl --enable-mpi --program-suffix="_mpi"

make mdrun

make install-mdrun


5) To install GROMACS with double-precession and enable mpi: (install dir is /usr/local/gromacs_d)

make clean

./configure CC="icc" CPPFLAGS="-I/opt/intel/mkl/10.0.4.023/include" LDFLAGS="-L/opt/intel/mkl/10.0.4.023/lib/32" --with-fft=mkl --enable-mpi --program-suffix="_d" --prefix=/usr/local/gromacs_d

make

make install

Friday, February 20, 2009

Gnome-do: For keyboard lovers



Gnome-do
is a fantastic software which will be equally appreciated by command line-ers and GUI users. It can be addictive and will make life so much easier with a variety of plug-ins. With a simple and elegant look it can search a file from any corner in your drive or play your favorite music in matter of seconds at a few keyboard strokes (not at the click of you mouse - which will be slower!!!)

Try it Today!

Friday, February 13, 2009

Linux Mint: A beautiful distro

Linux Mint is a spin-off of Debian linux and is probably the best distro for a linux newbie. It has all the features of Ubuntu and more. As I read somewhere Linux Mint is 97% Ubuntu, but that 3% extra makes it better. It comes with a very elegant Gnome theme compared to the dull brownish Ubuntu theme.


Notably it comes with "giver", which is a great way to share files and folders within a network (specially between room-mates!) without using a memory stick. If you haven't tried "giver", I highly recommend it (even for fedora and debian users)


If you are trying to convince anyone to use linux instead of Windows or Mac, Linux Mint is your answer...It will make the transition much easier than you might expect.

Thursday, February 12, 2009

Configuring Tamu VPN in Linux

First step is to install vpnc.

Install “vpnc” through apt (ubuntu, debian) or yum (fedora, redhat) or manually.

example: yum install vpnc (fedora)

apt-get install vpnc (ubuntu, debian)


1) Command line option:

To run TAMU vpn through command line is very very simple. Just run vpnc:

$ vpnc

This will prompt you a series of questions:

Enter IPSec gateway address: vpn-master.tamu.edu

Enter IPSec ID for vpn-master.tamu.edu: tamu

Enter IPSec secret for tamu@vpn-master.tamu.edu : tamuvpn

Enter username for vpn-master.tamu.edu: (your neo-id)

Enter password for @vpn-master.tamu.edu: (your neo-password)

Thats it! You are done...


You can store this as a configuration file and load it as: $ vpnc tamu.conf

example configuration file tamu.conf:

IPSec gateway vpn-master.tamu.edu
IPSec ID tamu
IPSec secret tamuvpn
Xauth username
Xauth password


To disconnect vpn type command: vpnc-disconnect


2) GUI Option:

Requirement: You need NetworkManager running in your system.

STEPS:


Open your network configuration and choose VPN menu:

Click on Add menu and create new VPN connection:

Add the required details as shown in the figure and create the new VPN setting:

Fill in your neo ID and password at the required places. And click OK.

Now a new VPN connection should appear on your NetworkManager icon in your desktop

when you left-click on the icon. Click on it and enjoy TAMU-VPN.