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 (
user2    pts/1        2011-02-13 14:41 (
user1    pts/7        2011-02-11 10:44 (
user1    pts/8        2011-02-11 10:44 (

#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

 A progress bar on your terminal

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."

1. Add the openSUSE 11.3 repo to Yast

For other versions:

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)

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.

Another GUI

R and Python