Friday, July 23, 2010

Bash - One line based For Loop

today I needed to start 40 jobs in a row and the easiest way I could think about was to use a one line bash script todo this for me


for i in `seq 40`; do ./node.sh; done


tada...

Tuesday, July 13, 2010

finding all external reference names in pubchem sdf files

currently I'm working on a simple way to find all external reference names in the pubchem sdf files. Which is rather trivial, but time consuming:



cat *.sdf | grep PUBCHEM_EXT_DATASOURCE_NAME -A 1 | grep -v PUBCHEM_EXT_DATASOURCE_NAME | grep -v '\-\-' | sort | uniq



once this finished it should give us a list of all possible data sources from pubchem as a unique list of names.


...
Ambinter
Burnham Center for Chemical Genomics
Calbiochem
CC_PMLSC
ChEBI
ChemSpider
DiscoveryGate
Emory University Molecular Libraries Screening Center
InFarmatik
KUMGM
LipidMAPS
MICAD
MLSMR
MMDB
MTDP
Nature Chemical Biology
NCGC
NIAID
NMMLSC
NMRShiftDB
ORST SMALL MOLECULE SCREENING CENTER
PCMD
ProbeDB
Prous Science Drugs of the Future
R&D Chemicals
Sigma-Aldrich
Specs
SRMLSC
Structural Genomics Consortium
The Scripps Research Institute Molecular Screening Center
Thomson Pharma
UM-BBD
UPCMLD
...

Monday, July 5, 2010

ubuntu - stucked in graphical mode without an editor

well for some reason I thought it was smart to install on a freshly installed ubuntu linux server the gdm package in a VMWare console.

20 Seconds later it turned out that I had

- no terminal application
- could not switch to a virtual terminal, vmware kept ignoring the commands
- had ssh disabled

short I was stuck. Till I remembered to write a simple script to just install xterm and execute it. But wait I need to enter parameters and passwords after the prompt.

Quick forward

#! /bin/bash
echo 'password' | sudo -S apt-get --yes install xterm > log.txt

as script in a simple text file, which was set to be executable gave me all I need to install my xterm and be happy again.