Sunday, February 20, 2011

Copy text file table in PDF or clipboard to different Excel sheet columns by parsing

1. Copy the table/data from text (or PDF). The data is now in the clipboard
2. Paste to an Excel worksheet
3. Then go to Data-> Text to columns. Now  Text import wizard will pop-up with the data displayed in it
4. Use the delimiting options(comma, fixed width etc) and specify the locations for each column to get the data into separate columns


Tuesday, February 15, 2011

Logging out a remote SSH session through BASH command line prompt (or another SSH login session)

#To list all login sessions

$ who
user1    pts/0        2011-02-11 10:44 (abc.xyz.com)
user2    pts/1        2011-02-13 14:41 (def.xyz.com)
user1    pts/7        2011-02-11 10:44 (abc.xyz.com)
user1    pts/8        2011-02-11 10:44 (abc.xyz.com)

#To kill a login session pts/7 of user1
#root can kill anyone, user1 can kill user1 sessions

$ pkill -9 -t pts/7

Tuesday, February 1, 2011

Real time monitoring of log files: Read from a file and print to the terminal stdout in Linux


1. If you need to write std out of a program log to a file

> program_command > logfile.log

2. and at the same time want to monitor it

> program_command | tee -f logfile.log

3. If you need to read from a log file  created by a running process onto your harddisk  in real time and stdout to terminal

> tail -f logfile.log

If you need to extract specific lines from the logfile
> tee -f logfile.log | grep 'your_specific_word'

4. Monitoring multiple job outputs in same window

Use multitail
http://www.vanheusden.com/multitail/features.html


OTHER LINKS
 A progress bar on your terminal
http://search.cpan.org/~fluffy/Term-ProgressBar-2.09/lib/Term/ProgressBar.pm






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/