Tuesday, February 1, 2011

Installing R package and R-Commander GUI in OpenSUSE 11.3 Linux desktop for statistical computing and graphics


"R is a language and environment for statistical computing and graphics."
http://www.r-project.org/about.html


1. Add the openSUSE 11.3 repo to Yast
http://download.opensuse.org/repositories/devel:/languages:/R:/patched/openSUSE_11.3/

For other versions:
http://cran.r-project.org/bin/linux/suse/README.html

2. Search for 'R-patched' and 'R-develop' in Yast and install

Now you can type 'R' in terminal to run the program

3. Install R commander (GUI)
http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html

a) Run R as root
b) Type "install.packages("Rcmdr", dependencies=TRUE)" without quotes
c) Choose a mirror
d) Installation and compilation would take several minutes based on your system config

Check for warnings in compilation. If you did not select 'R-develop', there would be lot of dependency errors.

3. To run R-commander GUI:
a) Type R in terminal
b) Issue this command: "library(Rcmdr)" without quotes. The GUI should pop-up now.



OTHER LINKS:
Another GUI
http://www.sciviews.org/SciViews-R/index.html


R and Python
http://rpy.sourceforge.net/rpy2_download.html
http://www.omegahat.org/RSPython/



Thursday, January 27, 2011

How to change or modify the openSuse 11.3 KDE4 "My Computer" sysinfo window background color to match your desktop theme color

Sometimes you change your Desktop background image and change the theme to your favorite eye candy style. But "My Computer" stays the same old green color.

The images for the KDE4 sysinfo "My Computer" are stored at
/usr/share/kde4/apps/sysinfo/about/images


-rw-r--r-- 1 root root 2.5K 2008-06-19 11:01 sysinfo.png
-rw-r--r-- 1 root root 4.0K 2008-06-19 11:01 network.png
-rw-r--r-- 1 root root 4.1K 2008-06-19 11:01 mem.png
-rw-r--r-- 1 root root 3.1K 2008-06-19 11:01 launch.png
-rw-r--r-- 1 root root 5.8K 2008-06-19 11:01 inner-bcg.png
-rw-r--r-- 1 root root 2.9K 2008-06-19 11:01 hdds.png
-rw-r--r-- 1 root root  773 2008-06-19 11:01 hdd.png
-rw-r--r-- 1 root root 1.1K 2008-06-19 11:01 dirs.png
-rw-r--r-- 1 root root 2.7K 2008-06-19 11:01 cpu.png
-rw-r--r-- 1 root root 3.7K 2008-11-11 08:11 display.png
-rw-r--r-- 1 root root 591K 2010-07-05 19:05 background.png






1. Make a backup copy of the images, 'background.png' and 'inner-bcg.png'
2. Open them with Gimp > Colorize > Change to your favorite color
3. Replace the original
4. Now open My Computer from Desktop and you should see the new colors.


Right click on "My Computer" and 'open with' > kwrite... You must see a lot of information now on the XML page
/usr/share/kde4/apps/sysinfo/about/my-computer.html

This html page has more details to explore

Friday, January 14, 2011

Helpful commands for Linux cluster job management

qstat

qstat -a

qstat -an

qstat -f : to see full details of a job
gstat -a

finger
qdel

To kill all of your jobs: (queued and running)
for x in `qstat -a | grep 'username' | awk -F. {'print $1'}`;do qdel $x; done


To run a python program script command in a cluster node:


        ####################################################

        # /usr/bin/python   # XY run on linux cluster.
        # Run as $python XY-v1.0.py prg_script(.py)
        # Advantage of the scripts is that this can be used to run XY # in any node processor
        # of the cluster (or any linux cluster with PBS). But 1 job runs only on a single cpu

        import sys, posix, fileinput, string, re

        # XY path installed in your system
        path = "/XY/bin"
        stem = sys.argv[1]
        cwd = posix.getcwd()
        N = 0
        jobname = """%s""" % (stem)
        command = """echo "#PBS -l nodes=1

        #PBS -m ae
        #PBS -M your_e-mail
        #PBS -l walltime=3:00:00
        #PBS -l mem=512mb
        #PBS -S /bin/bash

        cd %s
        %s/bin/xy %s.py" > %s.j
        chmod +x %s.j
        qsub %s.j


        """ % (cwd, path, stem, jobname, jobname, jobname)
        posix.system(command)
         ####################################################