New Job New Scope New blog
Hi Guys!!
I have switched jobs! still doing bioinformatics but for a service company providing next gen sequencing. Hence I think I shall move to a new blog address its here at http://kevin-gattaca.blogspot.com/ if its still relevant to you
Macify my Ubuntu
installed gnome-do and avant-window-navigator
trying to figure compositing.. hmm good that metacity does compositing!
Ubuntu 9.10 WM quirks
The quirks of my spanking new Ubuntu install is driving me nuts..
I found solutions online that do not seem to work!
1) I have to alt-tab twice to change windows (the first just shows the popup)
tried
http://ubuntuforums.org/archive/index.php/t-490238.html
http://ubuntuforums.org/archive/index.php/t-570357.html
but it seems that using compositing or adding visual effects solves the problem!
2) Alt_R doesn’t work! its a special mod key but xmodmap doesn’t help!
Any solutions is appreciated!
Moving to Ubuntu 9.04
Finally made the move!
My old version was no longer supported (read respository servers are gone!)
I needed a bit of house cleaing (read I have files which i have no use for and don’t know if i shld del)
so the move was needed.
I wanted to use LTS (long term support)
but by a twist of fate i ended up with 9.04 amd64 no less (to make use of the 16gb ram that i got)
I must say the upgrade IS an upgrade. the graphics are slicker and more imptly they are faster!
the migration went well. So far I didn’t have to recustomize most of my settings. Just copying the profiles sorted everything.
but have the usual hiccups of having to reinstalling
- sun java 6
- flock-browser (why can’t i just copy it over?? had to get the deb from http://www.getdeb.net/)
- gnome-vim (why doesn’t this ship with ubuntu as default?)
- 64bit flash player (hmm haven’t gotten down to this yet)
But I must say the advantages are
- better support for HP network printers (yeah! no more manual setups with IP addresses)
- Google-chrome works!
- did I mention again that its faster and slicker?
after looking at gOS I might even fiddle to get a Mac look just to be the envy of my less techy frens
so far I haven’t met a prob like nsaunders.. with upgraded packages but will keep a note for his method
Using your shell
Had to use bash to run a few one off jobs or edit my bash_profile for enviroment settings..
these are useful links!
http://www.linux.com/feature/155903 — Patterns and string processing in shell scripts
http://www.linux.com/feature/147568 — Save time at the command line with shell aliases and functions
prerelease version of the Adobe® Flash® Player 10 software for Solaris and 64-bit Linux platforms.
http://labs.adobe.com/downloads/flashplayer10.html
Get it while its hot!
will post experiences on an Ubuntu box later
python script to inventorise your ab1 files with md5sums
The problem that needed solving this time was having a list of filenames of my ab1 files, location( directory path) and a md5sum so i know if duplicate filenames are the same file or just a result of misnaming.
managed to come up with this after copying from two different scripts
one that was used to make an inventory of a directory of ogg songs and the other a python equivalent of md5sum check in linux.
Have fun!
#!/usr/bin/python
#===============================================================================
#
# FILE: inventory-abi.py
#
# USAGE: ./inventory-abi.py
#
# DESCRIPTION: Lists all the files of extension .ab1 with the directory and its md5sum
# adapated from code from http://pthree.org/2007/08/09/recursion-in-python/ and
# used md5sum code from http://code.activestate.com/recipes/266486/
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: will execute md5 on directory as well
# current method to get CWD is not OS independent
# NOTES: ---
# AUTHOR: Kevin ,
# VERSION: 1.0
# CREATED: 11/07/2008 07:03:16 PM SGT
# REVISION: ---
#===============================================================================
import dircache, os, md5
counter = 0
def sumfile(fobj):
'''Returns an md5 hash for an object with read() method.'''
m = md5.new()
while True:
d = fobj.read(8096)
if not d:
break
m.update(d)
return m.hexdigest()
def md5sum(fname):
'''Returns an md5 hash for file fname, or stdin if fname is "-".'''
if fname == '-':
ret = sumfile(sys.stdin)
else:
try:
f = file(fname, 'rb')
except:
return 'Failed to open file'
ret = sumfile(f)
f.close()
return ret
def PrintFiles(indent):
global counter
thisDir = os.getcwd()
for file in dircache.listdir(thisDir):
if (file.endswith('ab1') or os.path.isdir(file)) and not file.startswith('.'):
if file.endswith('ab1'):
counter += 1
currdir = os.popen("pwd") #for output of cwd currently works for linux pending upgrade to OS independent
md5 = md5sum(file) #calls the md5sum function, md5 lib ships with Python
ab1File.write('%s%s\t%s\t%s\n' %(indent, file, currdir.readline()[:-1], md5))
if os.path.isdir(file):
os.chdir(file)
PrintFiles(indent + ' ')
os.chdir('../')
try:
ab1File = open('ab1files.txt', 'w')
except IOError, e:
print "Unable to open 'ab1files.txt' for writing: ", e
else:
PrintFiles('')
ab1File.write('\nCurrent number of ab1 files: %d\n\n' %(counter))
ab1File.close()
What has Bettas got to do with Programming?
A programmer’s view of the Universe, part 1: The fish
Google DevFest D3vF3st now!
Lolz writing now from the Google DevFest at Singapore… hmm sadly its not packed to the brim right now.. maybe cos its just after a long weekend. oh well, am pretty excited though.. will post relevant updates if any..
check out
http://code.google.com/events/apacdevfest/
my online notes as the event progresses
http://docs.google.com/Doc?id=dhj8xhdw_47djn633f6
Update: There’s going to be a SE Asia OpenSocial Application Contest
Check out details at http://code.google.com/events/apacdevfest/contest/
The Event website
http://www.e27.sg/2008/10/13/googles-1st-hackathon-in-southeast-asia-whos-coming/