Tuesday, April 19, 2016

Friday, September 19, 2014

Freshly baked slackware

I typically run into three problems with a fresh install of slackware (all of two times!!)
1. Anyone (other than root) out there?
useradd <myname>
passwd <myname>
Typically, I leave my home is installed on a separate unperturbed partition, so to link it up, I simply re-add my old username.

2. Volume volume people!
Run alsamixer and turn on your speakers :)

3. Wireless networking
Without preamble...
This is not my work...only a link to the actual article and its printed form

Friday, November 15, 2013

Handy bash and vim tips that I've used from time to time

1. Copying files while retaining their directory structure
find ~dir1/ -name "*.mat" | xargs -I{} cp {} ~/<destination>
The directory structure below ~dir1/ where the *.mat files are found are copied to <destination> retaining the structure
2. Scp-ing only a set of files from multiple directories (using find and then scp-ing those files out retaining directory structure
find -name "*.mat" -print0 | tar --null --no-recursion -czf archive.tar.gz --files-from -

1. To comment or uncomment a block of code
ctrl+v --> select your block of code --> :norm I# (inserts a # in front of each line) or :norm ^x (removes the first character from each line in the selected block)

Thursday, October 31, 2013

Installing java on your linux machine without removing the native version it comes with

I like to have all my software installations in a single place so I know exactly what state my machine is in by glancing at a single directory, say ~/Software
My ancient CentOs setup doesn't have jdk 1.7 in its repo, so instead of fooling around with alternatives <shudder>, I downloaded the jdk version I wanted and put it into said ~/Software directory.

Here's a simple way to go about changing the default version of java that your system picks up without having to uninstall the native java that it comes with.

1. Switch to su
2. Create a file,say java.sh in /etc/profile.d/ containing :


3. Save out the file, and logout and log back in to your machine.
4. To test out your java version, run
java -version
5. To see which executable will be picked up, run
which java

Wednesday, September 25, 2013

Installing 32 bit java on my 64 bit CentOs6 machine

This is a right old pain to do, so unless you really need to, I would say find a way to stick to the native 64 bit jre/jdk install.
As of this writing, the latest jdk version available is 1.7.0_40

A quick listing of the steps I followed are below. The commands are italicised.

1. yum erase jdk (to remove the existing 64 bit java devel environment)

2. Download the x86 version of jdk (the rpm), say jdk-7u40-linux-i586.rpm

3. yum provides  libgcc_s.so.1
    yum install libgcc-4.4.7-3.el6.i686 
(which is what came up as the reqd package from the command above)

4. yum install jdk-7u40-linux-i586.rpm

5. Check your installation with the usual 
    java -version

In case you want both the 64 and 32 bit versions of java installed, you'll have to muck about with alternatives, which I happily chose to avoid!

Wednesday, July 3, 2013

Handy git tricks

Using Git is a blessing, truly it is. Today is just one of those days when I feel like chopping a limb off because git can't understand what I want it to do.
"Restore a file I deleted from my ide, then revert it to its state when I added that line in, then checkout a single file blah blah jabber jabber"

Each time I discover a neat trick to do what I want in git, I shall henceforth make a note of it here :)

  1. Restore a file that you deleted by accident in the repo or Undo all the changes in a file but haven't committed yet.
  git checkout HEAD^ <path to file>

This should bring the file back to the state it is in in the remote repo.

  2.  List all the files included in a commit

git log master

find the commit reference from here eg: 7bdf3a80243c7029508357c45bf4b918ce2bab86
git show --name-only 7bdf3a80243c7029508357c45bf4b918ce2bab86

Saturday, September 1, 2012

Cancer killing virus...Are you kidding me?!

I couldn't believe my eyes when I stumbled across this nugget online. Why on Earth hasn't this been plastered over the front page of every newspaper, the top of every science feed list or on billboards along the highway!
Before I get ahead of myself and incite an outrage, let me briefly tell you what I understood of the article.
At Uppsala University Hospital in Sweden, Prof Magnus Essand and his team have created a virus that eats cancerous cells. When a healthy cell is infected by a virus, it dies to prevent the spread of the virus to other cells. Cancerous cells change this behaviour and prevent their sacrifice (this is what make cancerous cells evil). But if a virus can be created to take advantage of this very feature of a cancerous cell, it would enter the cell, multiply uncontrollably and cause the cell to 'lyse' or explode, thereby spreading the cancer-munching virus (babies?) to other cancerous cells. This isn't a new idea apparently!
Oddly enough, in the 1890s, an Italian clinician found that prostitutes with cervical cancer showed alleviated symptoms when vaccinated against rabies. He then proceeded to roam the countryside injecting women with dog saliva. (Sigh!). In the 1900s, a 14 old year old boy with lymphatic cancer, found his swollen liver and spleen return to normal size after catch chicken pox. (and you never thought that you would find a bright side to chicken pox!).
The virus that Prof. Essand and his team have is said to attack neuroendocrine tumours (the same kind that assailed Steve Jobs). The virus, however, is in cold storage, refrigerated until it can go into human trials.
To be reasonable, the virus' success in rats doesn't necessarily translate into human viability, but that's what human trials are meant for! Money, is a blocker (surprise surprise). They need 1 million pounds to go through phase 1 and 2 of the trials and 2 million pounds to develop a better variety (I'm not really sure what this is even supposed to mean. Doesn't the virus either do its job or not? what does it get better at with an additional million pounds worth of research?) In any case, the virus remains unnamed and the team has agreed to name it after the person who donates a million pounds. I quote verbatim from the article
To donate money to Professor Magnus Essand's research on viral treatments for neuroendocrine cancer, send contributions to Uppsala University, The Oncolytic Virus Fund, Box 256, SE-751 05 Uppsala, Sweden, or visit www.uu.se/en/support/oncolytic. Contributions will be acknowledged in scientific publications and in association with the clinical trial. A donation of £1 million will ensure the virus is named in your honour

I also found another rather interesting tidbit. The details of the virus have already been published. This no longer allows them to file a patent (who would have thunk!). Without a patent, a pharma company that would have ordinarily take over the expense of the 3rd phase of human trials in order to profit from subsequent manufacturing and distribution when the drug goes commercial, won't think of investing the money. Devoid of an avenue to accrue profits, pharma companies would shrink away into the darkness. Unless....unless the team makes a modification to the virus, and redoes the entire process, this time taking care to file a patent before a publication. Politics in science...is a nasty business.
Here's hoping that the virus does succeed in human trials, that the team does get the money it seeks to continue their research and that patients with NETs (Neuroendocrine tumours) have a lantern bobbing brightly on the horizon.
If this were to succeed, I would be very excited to see how the results could be modified to deal with other kinds of cancers....could we truly be on the cusp of a breakthrough?
Cheering on the Uppsala team, here's wishing them all the very best of luck!

Links: http://www.telegraph.co.uk/science/9508895/A-virus-that-kills-cancer-the-cure-thats-waiting-in-the-coldc.html