This entry explains how to,

  1. Checkout the latest revision
  2. Configure root with desired options enabled or disabled
  3. Install necessary libraries to support selected options
  4. Compile
  5. Setup Ubuntu environment properly  to work root properly at any directory
List of all the pro and development revision versions can be found at root/tags . I have recently installed version 5.28.00d and decided to update my previous entry –  Install CERN ROOT On Ubuntu 9.10.
Checkout the source code (required subversion support)

Use a symbolic link to the above source code, this way if you want to try out another revision you only have to change the symbolic link.

ln -s root.5-28-00d root

Now you are ready to configure root using many options it supports.

Goto the root main directory (cd  /_path_/root)

First install required set of packages that root need,

sudo apt-get install g++ g++-4.4 libstdc++6-4.4-dev g++-multilib g++-4.4-multilib gcc-4.4-doc 
libstdc++6-4.4-dbg libx11-dev libxpm-dev libxft-dev libxext-dev

This will enable to compile the basic version of root with following options enabled

  1. asimage
  2. astiff
  3. builtin_afterimage
  4. builtin_pcre
  5. cintex
  6. exceptions
  7. gdml
  8. genvector
  9. memstat
  10. minuit2
  11. reflex
  12. roofit
  13. shadowpw
  14. shared
  15. table
  16. tmva
  17. x11
  18. xft
  19. xrootd

So If you satisfied with these set of options run,

./configure linux --enable-minuit2 --enable-roofit --enable-table --enable-gdml --enable-pgsql

If you want to enable more features like mathmore and fast fourier transform install following packages as well,
Install these optional packages,

sudo apt-get install gfortran ncurses-dev libpcre3-dev xlibmesa-glu-dev libglew1.5-dev libftgl-dev
libmysqlclient-dev libfftw3-dev cfitsio-dev graphviz-dev libavahi-compat-libdnssd-dev libldap-dev 
python-dev libxml2-dev libssl-dev libgsl0-dev gfortran-multilib gfortran-doc gfortran-4.4-multilib 
gfortran-4.4-doc libgfortran3-dbg glew-utils ocaml-findlib libtool-doc gsl-bin build-essential 
libjpeg62-dev libtiff4-dev  libgnutls-dev libgmp3-dev libxmu-dev libpng12-dev libkrb5-dev
freeglut3-devlibxmu-dev libgif-dev libgif-dev libiodbc2 libiodbc2-dev

Now root will support following options

  1. asimage
  2. astiff
  3. builtin_afterimage
  4. builtin_freetype
  5. builtin_glew
  6. builtin_pcre
  7. builtin_zlib
  8. cintex
  9. editline
  10. exceptions
  11. fftw3
  12. fitsio
  13. gviz
  14. gdml
  15. genvector
  16. krb5
  17. ldap
  18. mathmore
  19. memstat
  20. minuit2
  21. mysql
  22. odbc
  23. opengl
  24. python
  25. reflex
  26. roofit
  27. shadowpw
  28. shared
  29. ssl
  30. table
  31. tmva
  32. x11
  33. xft
  34. xml
  35. xrootd
Now configure root to enable above options,

./configure linux --enable-minuit2 --enable-roofit --enable-table --enable-gdml --enable-pgsql 
--enable-mysql --enable-builtin-zlib --enable-builtin-pcre --enable-builtin-freetype

Now compile source,



make -j no.of-cores-you-have

Finally set the environment variables in your favorite  shell,

# ROOT path configuration
export ROOTSYS=$HOME/softwares/root
export PATH=$ROOTSYS/bin:$PATH

Open a new terminal and type,
:~$ root
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version  5.28/00d        7 May 2011   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *            *
  *                                         *

ROOT 5.28/00d (tags/v5-28-00d@39145, May 09 2011, 00:20:11 on linux)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] happy rooting!!!!!!

This error is related to the gtk settings related to Ubuntu theme currently applied. I was using the theme “Radiance” and I’ve seen entries about the same error in the “Ambiance” theme. To fix this I have followed following steps,

  1. open the following configuration fileas root,
    sudo emacs /usr/share/themes/Radiance/gtk-2.0/gtkrc

    Note that I have opened the file related to the “Radiance” theme. Make sure to open the correct file related to the applied theme of yours

  2. Change the following,
    GtkRange::trough-under-steppers = 0


    GtkRange::trough-under-steppers = 1
  3. This should fix the bug.
  4. References, The Hack List and Ubuntu bug report
Posted by: rakitha | March 26, 2011

emacs Kill Ring

When you copy/cut/kill text in Emacs, the text is saved in a circular ring. You can reach this ring to get access to text instances added while you performed copy/cut/kill operations. To access the kill ring and paste most recent entry in the ring use,


To access text prior to most recent one,

Ctrl-y Alt-y

Do Alt-y repeatedly till to go deep into the kill ring.

This is very important when you work remotely by logging in to a host. I usually logged into the host through a ssh connection and opened emacs editor to work on. Problem is if the ssh connection looses you will lost all your opened emacs editors + what ever you had on the remote host.

I found two solutions to this.

1. Use a virtual terminal, screen instead of regular terminal or xterm.

2. Use TRAMP to connect and open files on a local emacs editor.

Virtual Terminal, screen

Basically screen is available by default in any Linux distributions. I’m working on both Ubuntu and Red Hat Enterprise Edition distributions and they both had screen installed by default. If you want to install screen, you can find compiled or source code for the screen for most of Linux distributions. Simple use either,

yum install screen


apt-get install screen

When you are ready with screen installed in the host, you can configure the screen to make it little user-friendly. Therefore create the file


and then copy following entries to this file,

#To have a status bar at the bottom of the screen
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'#To enable screen terminal scrolling
# source
termcapinfo xterm|xterms|xs|rxvt ti@:te@
# Default screens
screen -t shell1	0
screen -t shell2	1
screen -t server	2	ssh user@host

The last 3 lines will create three default virtual terminals when you run the screen command. The very last line the terminal will make a ssh connection.

Now you have the virtual terminal setup and ready. Now what you have to get used to is, when you logged in to your remote host execute the screen in the terminal ,


This will create virtual terminals you have defined in the configuration file .screenrc. You will see all the terminal available in the status bar.
Now in the screen terminals, all the commands start with ctrl+a (C-a), then followed with the single or double key. I will go through several important command in screen and you can find really useful web entries for more information.
To switch between terminals,

C-a space-bar
C-a num

where the num is the numerical number of the virtual terminal. You can see this in the screen status bar.

To list all available terminals,

C-a w

To list all the commands,

C-a ?

To detach from the screen back to the terminal where it was called,

C-a d

To exit from virtual terminals belonging to the current screen session,
1. The standard command is,

C-a \ or C-a C-\

2. in Red hat distributions I had to use,

C-a :quit

Which is not given in the standard command help.

You can kill single virtual terminal by using the command,

C-a K

Then the most important part is you can detach your screen session and log out of the remote host. Then when you need to work again just log in to the remote host and type,

screen -ls

This will show list of screen sessions available. To go back to your working screen session use the command,

screen -r [session]

where the [session] is listed when you typed screen -ls

Enjoy the world of virtual terminal with screen

Edit Files on a Remote Host using emacs+TRAMP

Two of the most frustrating issue when working in a remote host through a ssh connection is if you lose the network connection, you will lose all your work and if you are working in a crappy network, then opening a GUI based emacs terminal would be a pain. If you configure the TRAMP in the emacs, both of these pressing networking issues would not matter anymore. emacs editor is a local object running in you local computer. The tramp will keep a local copy of the remote file and it will only access the remote copy when you are saving it. So no more worries. Here is how to configure this,

First copy following lines to the ~/.emacs file,

(require 'tramp)
(setq tramp-default-method "scp")

Then in a terminal open the remote file using,

emacs /[abstract file directory]/file-name

The emacs through tramp will connect to the remote host and get a local copy to edit. When you save you may need to enter password repeatedly, which could be a hassle. But you could go around this issue if you use ssh-agent.

I use Ubuntu 10.10 which already had TRAMP installed. So all I had to do was add above set of line to the emacs configuration file. But if you need to install and configure TRAMP from the scratch, please follow the instructions in TRAMP User Manual.

Posted by: rakitha | March 3, 2011

How to Install A new Internal Hard Drive

I recently had to install new 2TB hard drive for my desktop which runs on Red Hat Enterprise Edition (version:2.6.18-238.1.1.el5PAE). I was able to successfully install the hard drive, create a single partition of type ext3. I used parted and mkfs.ext3

First install the hard drive physically. Boot the computer and open a terminal. Check to see the hard drive in the /dev directory. If you installed a sata drive do the following,

ls /dev/sd*

for ata drive,

ls /dev/hd*

The standard format is that sda/hda is you primary boot hard drive. So you installed drive should be the sdb/hdb. Note that if you already had more than one drive installed then your letter corresponding to the new drive could be different.

Here is the procedure for correctly setting up the hard drive to have ext3 file system
, My new hard drive is sdb

  1. Open a terminal and log in as super user (use su)
  2. Then type
    parted /dev/sdb

    and here is the parted terminal

    GNU Parted 1.8.1
    Using /dev/sdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.
  3. Now create the partition label for the new drive. Since this my drive is 2TB, I’m going to use the label gpt but you could use the label msdos. So type
    (parted) mklabel

    And follow the steps as given below

    Warning: The existing disk label on /dev/sdb will be destroyed and all data on
    this disk will be lost. Do you want to continue?
    Yes/No? yes
    New disk label type?  [msdos]? gpt

    Now to check the status use ‘p’ or ‘print’ command

    (parted) p                                                                
    Model: ATA Hitachi HDS72202 (scsi)
    Disk /dev/sdb: 2000GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Number  Start  End  Size  File system  Name  Flags

    If you see this, you are now ready to create a partition in the disk.

  4. To create a partition type following
    (parted) mkpart primary 0 -0

    And check the status again

    (parted) p                                                                
    Model: ATA Hitachi HDS72202 (scsi)
    Disk /dev/sdb: 2000GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Number  Start   End     Size    File system  Name     Flags
     1      17.4kB  2000GB  2000GB               primary

    Now you are done with the parted so exit

    (parted) quit
  5. Now you have created a partition in the disk and if you type, ls /dev/sdb* you will notice two entries for the sdb drive. sdb and sdb1.
  6. To create the file system ext3 on the partition sdb1, use mkfs.etx3 command.
    mkfs.ext3  -m 0 /dev/sdb1
    mke2fs 1.39 (29-May-2006)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    244203520 inodes, 488378637 blocks
    0 blocks (0.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=0
    14905 block groups
    32768 blocks per group, 32768 fragments per group
    16384 inodes per group
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
            102400000, 214990848
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done
    This filesystem will be automatically checked every 22 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.

    Now you are done with setting up the hard drive and only thing left to do is mounting it so the drive can be used.

  7. Now create a directory to mount the drive and change its owner to your user name
    mkdir mount_dir
    chown username mount_dir
  8. To mount this drive automatically at the boot time, one have to enter an entry to /etc/fstab file. So I have given below entries in my fstab file
    less /etc/fstab
    LABEL=/                 /                       ext3    defaults                     1 1
    LABEL=/home             /home                   ext3    defaults                     1 2
    LABEL=/local            /local                  ext3    defaults                     1 2
    LABEL=/boot             /boot                   ext3    defaults                     1 2
    tmpfs                   /dev/shm                tmpfs   defaults                     0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620               0 0
    sysfs                   /sys                    sysfs   defaults                     0 0
    proc                    /proc                   proc    defaults                     0 0
    LABEL=SWAP-sda5         swap                    swap    defaults                     0 0
    /dev/sdb1               /mnt/dd                 ext3    defaults                     1 1

    SO you can copy the last entry
    /dev/sdb1 /mnt/dd ext3 defaults 1 1
    and change to your drive name and mounting directory name

  9. Now all you have to do is mount the new drive
    Use mount to do that 

    mount /dev/sdb1 /mnt/dd

    and check using df to verify the disk is mounted.

    df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda3             9.5G  5.5G  3.6G  61% /
    /dev/sda6             438G  224G  192G  54% /home
    /dev/sda2             2.9G   69M  2.7G   3% /local
    /dev/sda1             251M   27M  212M  12% /boot
    tmpfs                 2.0G   12K  2.0G   1% /dev/shm
    /dev/sdb1             1.8T  196M  1.8T   1% /mnt/dd
  10. Now you are ready to use your new disk drive
Posted by: rakitha | February 28, 2011

Creating Repositories in GIT for the First Time

First create a public account in the git. Before you create any repositories in the git, ssh key must be generated and uploaded in to the git. Since the git has a nice entry about how this can be done I will simply point to that link. The main point is not to create any repositories before finishing,

  1. Generating a ssh key
  2. Add the key to the git account you just created.
  3. Once this is done, you are ready to create your first repository
  4. Once you done that try

    , you should see

    Hi [user]! You've successfully authenticated, but GitHub does not provide shell access.
             Connection to closed.

Creating a repository is very simple first create it in the github. Follow the instructions given in the How-to. Once you done that you could link a new directory and add stuff into that or link existing source code library. The instructions given in the above link are given for creating a new directory.

To create repository with your existing code, go to the directory where you have your stuffs and follow these steps,

  1. cd
  2. git init
  3. git add [file1]...[file n]
  4. git commit -m 'first commit'
  5. git remote add origin[git-username]/[git-repository-name].git
  6. git push origin master

To Commit Changes

  1. git commit file-name
  2. git push origin master
Posted by: rakitha | February 28, 2011

Installing GIT, The Fast Version Control System, in Ubuntu

GIT is a version control system that can easily be configured so you can keep track of your coding. If you wiling to keep a public repository git would give you the server and I think it has no restrictions as long as you keep them public.

Check out the latest version of the GIT from the repository. All the versions could be found in,
GIT Source.
I have checked outgit-1.7.4
Steps are given below

  1. Un-tar the files
    tar xvjf ~/Downloads/git-1.7.4.tar.bz2 
  2. Create a soft link to the source code directory
    ln -s  git-1.7.4 git 
  3. Go to the source code directory
     cd git
  4. Configure the GIT
     ./configure --prefix=/[absolute-path]/git/ 
  5. Compile the source
    sudo make install
  6. Now the git is ready to use
  7. Try
    ./git version

    to check it is working

  8. Now set the PATH variable to git:bin directory
    export PATH=$HOME/software/git:$PATH
  9. Now it is time to create the first GIT repository
Posted by: rakitha | May 20, 2010

Missing Volume Controller Icon in Ubuntu 10.04

  1. Right click on the Notification Panel
  2. Add “Indicator Applet” from the list

Download the latest static version


log in as super user

Extract it.

tar jxvf skype_static-

Do the follwoing symbolic links

ln -s skype_static- skype
ln -s skype /usr/share/skype
ln -s skype/skype /usr/bin/skype

You can dowload and extract skype statics to any preffered location, the important issue is to link it properly to set /usr/share/skype and /usr/share/skype.
If anything goes wrong try installing required list of packages in here

I found this remedy in the, posted by an user.

Steps are follows,

  1. Open the Synaptics Package Manager
  2. Search the keyword “libglib”
  3. Now look for “libglib2.0-0” in the list shown
  4. From “Package” menu select “Force Version”
  5. From the drop down menu select the version “2.22.2” instead of “2.22.3”
  6. Click “Apply” to changes to take effect
  7. This solved the warning message for now!

If the warning message still persist, try changing the version of other libglib packages to “2.22.2”. Once you downgrade this package, the update manage will try to restore it to “2.22.3 ” version, you can delay this update till they fix this warning and release newer version of 2.22.3

Older Posts »