Thursday, April 23, 2009

Quickly toggle tab swap preference for TabMix Plus

Simply press F9 while FF in focus to toggle between tabs being swapped under Last Selected preference or Select Right preference.

Monday, December 08, 2008

Adding a tag in subversion through subclipse

In order to create a tag (or branch) select “Branch/Tag...” from the Team menu. In the “Copy Branch/Tag” dialog, in the “Copy to URL” field, make sure that the correct folder, branches, or tags were the snapshot wants to be put is displayed in the path by either browsing or typing it, for example: “https:///users/afgane/OptionView/tags/0.2”. “Browse” button can be used here to navigate to the branch or tag folder where the branch or tag would like to be created. If you would like to create a special folder which designates a version, then you can simply append a new folder to the end of the To URL (i.e. tags/0.2, in above example). This will then be created for you. Select the revision which you would like to copy (i.e. “Head revision in the repository”, “Specific revision in the repository”, or “Working copy”.
Create a message in the branch/tag comment area. If you would like to continue to work in your current working copy then leave the “Switch working copy to new branch/tag” checkbox clear. If you would like to switch so that you can make additional modifications to the branch/tag without changing the current working copy then select this checkbox.
Click OK in order to create the branch or tag.

Friday, December 05, 2008

Adding a computer to subversion repository (through subclipse)

All of this is done through Eclipse using Subclipse Project.


Assume there is a subversion repository already in place with documents in it. The repository was established with a certain version of documents from computer ONE. At the same time, computer TWO has a copy of those documents and it is not connected to the repository. Documents on computer TWO are edited before connecting the computer to the repository. Now, I would like to create a connection from computer TWO to the repository but I cannot simply issue a 'checkout' command because documents on computer TWO are the more recent version of the ones that are in the repository. While one would think this is a simple task (for a beginner w.r.t. subverion at least), it is not!
In order to achieve desired functionality, the following can be done (all of these are done on computer TWO):
1. From Windows Explored, move entire contents of the project directory to some temporary directory
2. From Eclipse (i.e., subclipse), checkout the desired project (go to SVN Repository Exploring perspective, browse to the desired project, right-click on trunk, tag (or similar) directory that wants to be checked out within the browser, and select Checkout)
3. Follow the checkout wizard and chose to 'Check out as a project in the workspace' and give it the name that matches the desired project name. After clicking Finish, it will tell you that the specified project exists and contents will be deleted. Click OK.
4. After checking out the documents has completed, go back to the Windows Explorer and copy contents of the temporary directory into the project directory
5. Refresh the project tree view in Eclipse. Right-click project name in Eclipse and select Team->'Synchronize with Repository'. This will open Team Synchronizing perspective (or ask you to do so) and show you differences from the new document versions with the ones in the repository.
6. Commit the new version into the repository by selecting documents, right-clicking and choosing Commit command.

From now on, both of the computers should be able to update/commit changes as needed.


If anyone reads this and knows a better way of doing it, please leave a comment explaining how because, in my current opinion, whoever designed document repositories to have the interface different from that of a simple drag&drop is an idiot.

Wednesday, September 10, 2008

Installing kinship library for R

Download the library from: http://cran.r-project.org/src/contrib/kinship_1.1.0-21.tar.gz
Save it anywhere.
From the directory where the library was saved, issue command: R CMD INSTALL kinship_1.1.0-21.tar.gz
Upon completion, you can type R to start the application and then issue command: library(kinship)

Note, for a system wide installation where one does not have access to installation paths for R, additional steps are needed:
Create a directory where extra libraries will be saved (e.g., extraLibs in $HOME)
Then, set the R_LIBS var in ~/.bashrc and you should be set.

Friday, August 29, 2008

Installing R

1. Download R from http://www.r-project.org/.
2. Untar the downloaded archive using command: $ tar -xvzf [R-version.tar.gz]
This will create a new directory named ./[R-version] in the current directory.
3. Enter newly created directory: cd [R-version]
4. Issue command: ./configure --prefix=/path/to/install (e.g., /home/afgane/R/[R-version])
In order to link BLAS and CLApack libraries, the following set of commands can be used (the export statements specify desired compiler, also make sure library paths are edited to match current resource):
export CC=icc
export CXX=icpc
./configure --prefix=/store/R/R-2.7.2 --enable-threads=posix --with-blas="-L/opt/intel/cmkl/10.0.011/lib/em64t -lmkl -lguide -lpthread" --with-lapack="-L/opt/intel/cmkl/10.0.011/lib/em64t -lmkl_lapack"

5. Type tow following commands to make and install:
$ make
$ make check
$ make install

Setting up SSH keys for authentication without passwords

1. Log into machine ONE
2. Issue command: ssh-keygen –t rsa
3. Change into ~/.ssh directory
4. Copy contents of file id_rsa.pub from machine ONE to file ~/.ssh/authorized_keys on machine TWO. Note, if this file already exists, simply add a new line to the bottom of it. Furthermore, make sure that the key being copied is all on one line.
5. Change permissions of ~/.ssh/authorized_keys on machine TWO to 700
6. Now, you are able to log in from machine TWO to machine ONE without a password

Monday, June 16, 2008

Getting BioPerf to execute

Upon executing script to start BioPerf, the following error came up:
$ ./use-bioperf.sh
You can do the following:
[R] Run BioPerf
[I] Install BioPerf on your architecture
(if your architecture is not PowerPc, x86)
[C] Clean outputs in $HOME/BioPerf/Outputs
[D] Display all versions of the installed codes
R
Please specify your architecture
[A] Alpha
[P] PowerPC
[X] x86
[H] Custom. (If you have already ran the install-codes.sh successfully
to completion, you can choose this option to run the binaries installed
on your system)
X
$HOME/BioPerf/Scripts/Run-scripts/run-bioperf.sh: line 21: syntax error near unexpected token `('
$HOME/BioPerf/Scripts/Run-scripts/run-bioperf.sh: line 21: ` echo There is no directory named $HOSTNAME-Binaries (created by install-codes.sh) in $BIOPERF/Binaries '


In order to get passed this, file $HOME/BioPerf/Scripts/Run-scripts/run-bioperf.sh should be edited on line 21 to replace parentheses with curly brackets (or similar or escaped). The same should be done on line 26 because parentheses are used there as well and are not escaped.

Thursday, June 12, 2008

Add color to bash

In order to get syntax highlighting in bash when 'ls' command is executed, add the following line to (bottom of) ~/.bashrc file:
. /etc/profile.d/colorls.sh

Note: Make sure pointed file exists. Below is an example of one:

$ more colorls.sh
# color-ls initialization

alias ll='ls -l' 2>/dev/null
alias l.='ls -d .*' 2>/dev/null

COLORS=/etc/DIR_COLORS
[ -e "/etc/DIR_COLORS.$TERM" ] && COLORS="/etc/DIR_COLORS.$TERM"
[ -e "$HOME/.dircolors" ] && COLORS="$HOME/.dircolors"
[ -e "$HOME/.dircolors.$TERM" ] && COLORS="$HOME/.dircolors.$TERM"
[ -e "$HOME/.dir_colors" ] && COLORS="$HOME/.dir_colors"
[ -e "$HOME/.dir_colors.$TERM" ] && COLORS="$HOME/.dir_colors.$TERM"
[ -e "$COLORS" ] || return

eval `dircolors --sh "$COLORS"`
[ -z "$LS_COLORS" ] && return

if ! egrep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null ; then
alias ll='ls -l --color=tty' 2>/dev/null
alias l.='ls -d .* --color=tty' 2>/dev/null
alias ls='ls --color=tty' 2>/dev/null
fi

Tuesday, June 10, 2008

Setting Eclipse Keyboard Shortcut: Ctrl+Tab

Go to:
Window / Preferences / General / Keys

Scroll all the way down to the bottom. About 12th from the BOTTOM you will see category "Next Editor".
Double Click that line. The modify screen for that action will open up.
Set focus to the Key Sequence section, and hit CTRL-TAB, then click the ADD button. You should now see TWO commands for "Next Editor". You can now select the original one, and click Delete. (from here)

Wednesday, February 20, 2008

Get rid of horizontal line in Word 2007

"This line is actually... Wait for it...! A border! Don't ask me how it got there, but all you need to do is highlight the section around the line (just left mouse, and pull a nice big block round the area, provided there are no tables nearby where you want to preserve a border). Then just go up to the border-line selection icon in the toolbar and choose the one that clears all borders."
From http://word-tips-world.blogspot.com/2007/06/get-rid-of-that-annoying-horizontal.html

Tuesday, February 05, 2008

BLAST performance analysis configuration

All the files needed for BLAST performance testing (e.g., perl scripts, databases, different versions of BLAST software, ...) are located under my account on everest under ~/BLASTanalysis.
In order to run a BLAST test, a properties file (e.g., propertyFile) needs to be edited/provided. Properties file specifies the following data: database, input file, program, I/O params are specified, number of fragments and threads, and execution host.
Once configured, run run.pl script. This script will split the input file into specified number of fragments, generate LRM scripts, and submit the job:
perl run.pl {properties file}

Add multiple linux timing results (output in seconds)

If there are multiple files with timing results resulting from Linux 'time' command:
$ cat outputFile* | grep real
real 4m5.047s
real 2m51.264s
real 2m52.414s
real 2m52.293s

And these timings need to be converted into seconds and added into a single number (e.g., 761.018), use the following command:
cat outputFile* | grep real | cut -f 2 | sed 's/m/*60+/' | sed 's/s//g' | bc | awk '{ printf "%s", $0 "+" }' | sed '$s/.$/\n/' | bc

Convert output of linux 'time' command to show seconds only

After executing Linux 'time' command, the following output is obtained:
real 2m52.293s
user 1m39.670s
sys 0m4.370s

Use the following command to extract value for 'real' time only and convert the output to seconds only (i.e., convert 2m52.293s into 172.293):
cat outputFile* | grep real | cut -f 2 | sed 's/m/*60+/' | sed 's/s//g' | bc

Tuesday, January 15, 2008

Running JaCoP

From command prompt, while residing in the same directory as all the JaCoP java files, compile all java files using the following command:
C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCoP>java
c -classpath ".;C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCo
P\JaCoP.jar" *.java

Run any of the files using the following command, for example:
C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCoP>java
-classpath ".;C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCoP
\JaCoP.jar" Queens

After compiling it from command line, it can be run directly from Eclipse too.

Thursday, September 27, 2007

Adding host info to ganglia and gmond

GridWay was not reporting OS name and OS version for mileva. After making sure gmond was running and MDS was actually being populated by available information (info on this is available in earlier post), you have to make sure all the information that is needed by GridWay is being provided by ganglia.
For example, I was noticing on the problem host that telnet localhost 8649 was giving the followgin output:
[METRIC NAME="sample-metric" VAL="Linux mileva-0-3.local 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 26 14:14:47 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
[METRIC NAME="sample-metric" VAL="Linux mileva-0-2.local 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 26 14:14:47 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux

While output on working host was giving the following output:
METRIC NAME="os_name" VAL="Linux" TYPE="string" UNITS="" TN="401" TMAX="1200" DMAX="0" SLOPE="zero" SOURCE="gmond"/]
[METRIC NAME="sample-metric" VAL="Linux everest-0-3.local 2.4.21-20.ELsmp #1 SMP Sat Sep 18 18:28:16 PDT 2004 x86_64 x86_64 x86_64 GNU/Linux
[METRIC NAME="os_name" VAL="Linux" TYPE="string" UNITS="" TN="943" TMAX="1200" DMAX="0" SLOPE="zero" SOURCE="gmond"/]
[METRIC NAME="sample-metric" VAL="Linux everest-0-13.local 2.4.21-20.ELsmp #1 SMP Sat Sep 18 18:28:16 PDT 2004 x86_64 x86_64 x86_64 GNU/Linux

This means ganglia is not providing needed information, so do the following to include needed info. (Following was done on Ganglia v3.0.4)
Edit /etc/gmond.conf (this is the default location) file and add the following text toward the bottom of the document (among all the other similar entries):
metric {
name = "os_name"
value_threshold = 10.0
}

It is likely that os_release will need to be added in the same fashion as was described for os_name.

Edited config file (/etc/gmond.conf) needs to be copied to all the nodes of the cluster before it will take effect.

Then restart gmond (/etc/init.d/gmond restart) on all the nodes and wait for GridWay info to be updated...

Saturday, September 15, 2007

Populating gwhost in GridWay

Source of information when executing gwhost command in GridWay comes from two major sources:
From $GLOBUS_LOCATION/libexec/globus-scheduler-provider-[sge OR fork] and $GLOBUS_LOCATION/etc/globus_wsrf_mds_usefulrp/gluerp.xml. The gluerp.xml script is the one that provides info about static resource info and it obtains infrom from a provider such as ganlgia (gmond process) or hawkeye. Information available from ganglia can be checked by executing: telnet localhost 8649
gluerp.xml needs to have a line such as the following enabled in order for gwhost to be properly populated:
.../...
java org.globus.mds.usefulrp.glue.GangliaElementProducer
.../...

The globus-scheduler-provider-[sge OR fork] script provides mostly dynamic information used for scheduling.

Thursday, August 02, 2007

CLASSPATH on Windows with paths including spaces

For example:
javac -classpath ".;C:\Documents and Settings\afgane\My Documents\Enis\Projects\JaCoP\JaCoP.jar" *.java

More info/examples available here.

Thursday, July 12, 2007

GRAM Authentication test failure

If getting this:
[afgane@everest00 afgane]$ globusrun -r everest.cis.uab.edu -a

GRAM Authentication test failure: connecting to the job manager failed. Possible reasons: job terminated, invalid job contact, network problems, ...

After making sure you have current grid proxy (through grid-proxy-init), check that the globus-gatekeeper is running by telneting to port 2119 by executing:
telnet [hostname] 2119

If you get an error such as the following, read on...
telnet localhost 2119
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused


2119 is globus-gatekeeper default port. If a different port is being used, you can check it by examining file usr/local/globus-4.0.2/etc/globus-gatekeeper.conf first.
Continue by examining /etc/xinetd.d/globus-gatekeeper. This is service startup file that looks something like this (make sure first line is giving the name of the service (i.e., globus-gatekeeper, in this case)):
service globus-gatekeeper
{
socket_type = stream
protocol = tcp
wait = no
user = root
env = LD_LIBRARY_PATH=/usr/local/globus-4.0.2/lib
server = /usr/local/globus-4.0.2/sbin/globus-gatekeeper
server_args = -conf /usr/local/globus-4.0.2/etc/globus-gatekeeper.conf
disable = no
}

In this file find the globus-gatekeeper config file (e.g., line: server_args = -conf /usr/local/globus-4.0.2/etc/globus-gatekeeper.conf) and then examine it next. This file looks something like this:
[root@everest00 xinetd.d]# cat /usr/local/globus-4.0.2/etc/globus-gatekeeper.conf
-x509_cert_dir /etc/grid-security/certificates
-x509_user_cert /etc/grid-security/hostcert.pem
-x509_user_key /etc/grid-security/hostkey.pem
-gridmap /etc/grid-security/grid-mapfile
-home /usr/local/globus-4.0.2/
-e libexec
-logfile var/globus-gatekeeper.log
-port 2119
-grid_services etc/grid-services
-inetd

Here you can find which port the gatekeeper is running on and then go back to telnet.

If any changes were made to the two files just mentioned, you must restart xinetd. This is done as root by executing:
/etc/rc.d/init.d/xinetd restart
If this still does not work, execute: netstat -lt
This will print a list of all service currentl running. You can also try starting globus-gatekeeper manually by starting the server. Path and parameters for the server can be found in /etc/xinetd.d/globus-gatekeeper again under server and server_args (e.g., $ /usr/local/globus-4.0.2/sbin/globus-gatekeeper -conf /usr/local/globus-4.0.2/etc/globus-gatekeeper.conf)

If you can succesfully telnet into to machine, gatekeeper is running and next steps would include checking host certificates and making sure permissions are set correctly and that they are still valid (in /etc/grid-security/):
-rw-r--r-- 1 root root 1.4K Mar 8 13:50 hostcert.pem
-r-------- 1 root root 887 Mar 8 13:49 hostkey.pem

gridmap file needs to hold distinguished names of individual users that map to local user names. (e.g.: "/C=US/ST=Alabama/L=Birmingham/O=University of Alabama at Birmingham/OU=UABgrid/CN=jpr/emailAddress=jpr@uab.edu" afgane).

Finally, /etc/grid-security/certificates directory must hold currently valid CA certificates for participating resources/organizations.


Additional (excellent) documentation can be gotten from Georgia Tech at http://www.hpcc.ttu.edu/Globus.html and http://www.sdsc.edu/~tkaiser/globus/build/. Information on globus-personal-gatekeeper is also included at the second link.

Wednesday, July 11, 2007

Globus simple tests

Test GRAM authentication only:
globusrun -r everest.cis.uab.edu -a
GRAM Authentication test successful

Submit simple (non-WS) job:
globusrun -o -r everest.cis.uab.edu/jobmanager '&(executable=/bin/date)'

Using Threads in Java

The way threads work in Java is that there has to be a class implementing either Runnable interface of extends Thread class. Either way, run method must be overridden wihh desired functionality. From the client class, a new thread must be created (as below) where the first argument passed is an an instance of the class you want executed as a separate thread. Once this is done, the thread can be started by invoking start method.

Thread thrd = new Thread(new ClassImplementingThreadFunc(param1,param2));
Thread thrd2 = new Thread(new ClassImplementingThreadFunc(newParam1,newParam2));
thrd.start();
thrd2.start();