Friday, August 6, 2010

Little victory

I have a linux box running on openSUSE 11.1 in my office. Firefox on the machine was not configured to open pdf files in the browser and after years of downloading files just to view them I found a solution. All I needed to do was to put this plugin called nppdf.so in the folder ~/.mozilla/plugins/. Now I couldn't find a single working link that would let me download the plugin. Frustrated, I did a simple "find / -name nppdf.so" on my terminal and found it somewhere in the Realplayer folder. Copied it and voila! The sweetest part was that the whole process took ~2mins. Geee...

Sunday, March 21, 2010

VPN on Ubuntu 9.1

I wanted to write about how awesome Ubuntu9.1 was when it came to accepting my ancient Netgear wireless card from 2004 (w/o a single keystroke), installing Skype and Logitech Quickcam Pro 9000 (no installation required), but the VPN installation has caused enough heartburn to prevent me from appreciating the previous breezes. Here go my whinings:

1. I downloaded vpnclient-linux-4.8.01.0640-k9.tar.gz
2. Patched with this file vpnclient-linux-4.8.01-64bit.patch (from http://projects.tuxx-home.at/ciscovpn/patches/)
3. Ran 'bash vpn_install' (went w/o incident)
4. /etc/init.d/vpnclient_init start --> This died with the following error:
Starting /opt/cisco-vpnclient/bin/vpnclient: insmod: error inserting '/lib/modules/2.6.31-14-generic/CiscoVPN/cisco_ipsec.ko': -1 Invalid module format
Failed (insmod)
5. I also tried repatching using vpnclient-linux.2.6.31.diff since this guy seems to have had success with it.

And for the life of me I can't find a working solution online. I am temporarily giving up on it with the following doubts lingering:
1. The "64bit" in vpnclient-linux-4.8.01-64bit.patch makes me very suspicious. But this is the only Cisco vpn client my lab distributes for Linux users. Any and all useful inputs are welcome!

Edit (22nd March):

I fixed the problem by installing vpnc
>sudo apt-get install network-manager-vpnc
and pcf2vpnc
>wget http://svn.unix-ag.uni-kl.de/vpnc/trunk/pcf2vpnc
>./pcf2vpnc xxx.pcf > xxx.conf
>sudo vpnc xxx.conf
Viola! Life's good again. Thanks to this site and this one for clarifying the difference between a .pcf and a .conf file.

Thursday, March 11, 2010

Making figures using VMD


I have lately been playing around with VMD to make pictures. After having used their "screenshot" feature to make pictures all this time I decided to try out rendering images using Tachyon and boy! what a difference. A simple example is attached. I'll let you guess which of the two was made using the Tachyon ray tracer. More info here.

Tuesday, February 23, 2010

You know you are a Latex addict when...

You write -- for a dash(-) while taking notes on a piece of paper with a pen.

Friday, February 12, 2010

Plot layout in R

I recently needed to make a figure with two plots side-by-side. Plot 1 was to have a width 3 times that of plot 2. The layout feature in R seemed to be the answer. But, due to either lack of decent tutorials online or just plain bad luck in finding one, I found it rather difficult to understand how this layout function works. The usual help command help(layout) wasn't terribly helpful either. Here go the set of commands that really nailed it for me. Run them on your terminal to follow the rest of the blog.

nf <- layout(matrix(c(1,2),1,2),widths=c(1,1)); layout.show(nf)

Pretty straight forward isn't it? Now try,

nf <- layout(matrix(c(1,2),1,2),widths=c(3,1)); layout.show(nf)

Basically the matrix(c(1,2),1,2) is what contains the layout information. c(1,2) is simply the label of the plot in question. The 1,2 after that tells you the number if rows(1) and columns(2) in the layout. Now a little more complicated example,

nf <- layout(matrix(c(1,3,4,2,5,6,7,8),2,4),widths=c(1,1,1,5)); layout.show(nf)

Hope this helps.

Thursday, February 11, 2010

Colors in R

Hello World,
R is a pretty wicked statistical analysis tool with great resources for plotting data. I use it on a regular basis and I'll use this blog to document notable finds along the way. This will hopefully help me find answers to previously encountered problems by taking a peek at the blog rather than fishing through my sea of bookmarks. Here is a short comment on colors in R.

colors() gives a list of all the available colors in R. It looks like this:
[1] "white" "aliceblue" "antiquewhite"
[4] "antiquewhite1" "antiquewhite2" "antiquewhite3"
[7] "antiquewhite4" "aquamarine" "aquamarine1"
[10] "aquamarine2" "aquamarine3" "aquamarine4"
.
.
[646] "wheat" "wheat1" "wheat2"
[649] "wheat3" "wheat4" "whitesmoke"
[652] "yellow" "yellow1" "yellow2"
[655] "yellow3" "yellow4" "yellowgreen"

The way to select a particular color is:
plot(x,y,col=color()[646])
or
plot(x,y,col="wheat")

Ciao!