Wednesday, October 30, 2013

Linux terminal colors (Console, ls and vi)

The lines below when put in my .bashrc file greatly improved the readability - I essentially turn the color scheme off.

# Below is from http://mylinuxbook.com/ubuntu-command-line-prompt-colour/
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[0;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

alias ls='ls --color=none'

Further these lines in .vimrc file were of great help.

syntax on
colorscheme desert

Tuesday, October 22, 2013

ImageMagick's display

On Linux terminal the command /display/ simply displays a figure w/o any resizing. This can get cumbersome when dealing with large images. However, a simple resize option simplifies life:

display -resize 1080x\> figure.png

where the width is being resized to 1080 pixels while the height is automatically assigned. This link suggests using this approach only for downsizing images. 

Saturday, October 19, 2013

Friday, October 18, 2013

Input arguments for /scanf/ type commands

For executables that require user-input, data can be fed in the following manner:

echo 5|pdb2gmx -f box.his.pdb -o box150

where 5 is the input argument that would otherwise have to be given after pdb2gmx takes its time running through its code that comes before a scanf type statement. This approach saves time and automates the process provided you know which argument to feed in. You can extend this any number of arguments like so...here 5 is argument 1 and 50 is argument 2.

echo 5 50|pdb2gmx -f box.his.pdb -o box150

Wednesday, October 9, 2013

Link between common distributions

People dealing with large data sets often find themselves using one of the many standard distribution functions to explain their data. Some of the more commonly used distributions are binomial, Gaussian and Poisson. Interestingly the latter two can be derived from the binomial distribution in that the Poisson distribution is a limit of the binomial distribution and the Gaussian is a limit of the Poisson. The derivations below (conveniently lifted from the web) elaborate.
Source:
http://www.roe.ac.uk/japwww/teaching/astrostats/astrostats2012_part2.pdf
http://www.physik.uzh.ch/~psaha/pda/

Wednesday, October 2, 2013

Installing Citrix on a 64bit Linux box (Ubuntu)

I had previously managed to install Citrix on a 32bit Linux box with little pain but I had a very different experience when dealing with 64bit Linux. Anyway I solved the issues and got it running. Below are the steps involved. You need Citrix if you see a screen similar to the ones below.

- Download 64bit Citrix. Supplied either by your institution or a relevant one at http://www.citrix.com/downloads/citrix-receiver/linux/receiver-for-linux-121.html
- Run dpkg -i ...deb. It will fail. Let it fail.
- Edit /var/lib/dpkg/info/icaclient.postinst so that this line shows up
 if [ "$arch" = "x86_64" -a "$op_system" = "Linux" ]
- Run dpkg --configure icaclient [no more arguments needed]
- sudo ln -s /etc/ssl/certs/Thawte_Premium_Server_CA.pem /location/of/ICAClient/keystore/cacerts/

That's it!

Make sure dependencies are all of same arch (x86).
nsplugin wrapper is an example for that. This depends on libc6.i386 and other libs.
Install libc6. This will iron out other problems. I thank Zach and Mike for their patience while working this out.

Tuesday, October 1, 2013

VMD 'measure hbonds' syntax

The figure below makes it easy to remember the syntax of VMD's measure hbonds command.