Linux tip: forward email from M$ Exchange Server to GMail

My work email has migrated to M$ Exchange Server, with M$ Outlook Web Access. Eurgh. No more POP3 retrieval to my GMail account.

I restored sanity using an Ubuntu server as follows. Needless to say, this requires that (a) the exchange server allows IMAP access and (b) the SMTP server for your machine will relay mail outside of your domain.

Updated: to do it all via procmailrc, without .forward
Updated: to poll folders other than Inbox
Read the rest…

But just before I go…

…I have to mention Carl Zimmer’s post on the quest to find English words in human protein sequences.

This game has been around as long as sequence databases have existed. I have a vague memory of a letter from the early 1990s (possibly in Trends in Biochemical Sciences Nature) in which the authors reported the results of comparing SwissProt with the Oxford English Dictionary. As I recall, the longest word that they found was ENSILISTS – meaning people who practice the art of making silage.

Anyway – here’s a quick and easy way to tackle the problem using EMBOSS and some Linux command line trickery.
Read the rest…

Rapid command-line access to the PDB

This is hardly earth-shattering stuff, but just for reference.

There are multiple ways to grab PDB files from the RCSB PDB servers. If you know the accession code of a structure, the simplest way is wget (or similar) straight off the FTP or HTTP server:

FTP
wget ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb/pdbXXXX.ent.gz

HTTP
wget http://www.rcsb.org/pdb/files/XXXX.pdb.gz

where XXXX is the 4-character PDB accession code.

Note the recent change of URL for the PDB archive: ftp://ftp.wwpdb.org. Note also the confusing 2, not 3 “w” in the URL.

Linux tip: sort a tab-delimited file

The Linux command “sort” is both powerful and confusing. The manpage tells us that the “-t” switch can be used to set the field delimiter.

If you’ve tried various combinations of “-t” and “\t” to tell sort that your file is tab-delimited without success, try this (bash shell):

TAB=`echo -e "\t"`
sort -t"$TAB" myfile

with “-kN” as appropriate, where N is the column on which to sort.

Long-winded discussion with much incorrect syntax in this forum; or get straight to the point in this mail archive.

ATI 8.42.3

Just a quick and boring hardware post for those Linux users stuck with ATI video cards. Release 8.42.3 of the proprietary fglrx driver now supports AIGLX and the composite extension (which means compiz-fusion and cool desktop effects without the need for Xgl).

My own experience on Ubuntu 7.10:

  • Installation relatively painless using any of these guides: one, two, three
  • Performance reasonable except that (1) cube rotation a little choppy, (2) 3D GL apps flicker terribly (fix: turn off compiz)
  • Much less CPU/RAM usage than when running Xgl

If you´re happy with the Xgl solution, stick with it until things improve. Some progress, at least.

Feisty to Gutsy: things that I should know by now

  1. Never attempt to upgrade an Ubuntu distribution on the day of the new release
  2. If you do, don’t use your primary desktop machine
  3. Complex tasks that can trash a machine should not be performed after midnight

I only have myself to blame but still: I didn’t expect the upgrade manager to simply vanish midway through the procedure, leaving an unusable system. One thing that I have learned is not to panic. Provided /home is on a separate partition, you can always do a clean install from CD and restore your packages pretty quickly.

Not sure why I’m experiencing zen-like calm rather than seething rage – must be Friday.

Finally: ATI fglrx + xgl + beryl for Ubuntu feisty

I’ve had harsh words to say about ATI Linux video drivers in the past – and I’m not withdrawing them. My advice is still do yourself a favour and buy NVIDIA. That said, I did an Ubuntu install on a work machine today (we get little choice with the specs) and finally got the proprietary fglrx driver working with Xgl and beryl, for a fancy desktop. All thanks to this very clear post; I’ve read many and this is the best.

The key points are:

  • The open-source radeon driver has composite (for beryl/compiz), but no TV-out and doesn’t support newer cards
  • The closed fglrx driver has TV-out but no composite. However, you can get beryl/compiz to run by combining it with Xgl, which is as simple as installing xserver-xgl and editing a small start-up script.
  • Here’s the key: the beryl packages in feisty are version 0.21 and don’t like Xgl. You need to downgrade to version 0.20 in the beryl project repository.

Xgl can do nasty things to your fonts (this thread includes a fix for “my emacs is all squares”) and some apps, like Google Earth are difficult to run (this page contains a fix) but on the whole, things work. If you’re stuck with ATI give these tips a try.

One day either fglrx will have composite or radeon will have tv-out. Which first, I wonder?

Make your own NCBI handbook

My previous post reminded me of an Australian company that used to sell the NCBI Handbook on a CD for AUD 35. Yes, this NCBI handbook – available for free at the NCBI website. The only drawback is that if you want to download a copy, it’s distributed as 24 separate PDF files.

Well you could be stupid and pay 35 dollars plus postage for a free resource – or you could create a single PDF using some freely-available software and a small shell script. Specifically you’ll need:

  • wget – to fetch files over HTTP
  • PDFjam – to concatenate PDF files into one file
  • xargs – to submit the PDF filenames to pdfjoin, part of the PDFjam package

All of these are either available or easy to install on any Linux machine. And possibly other platforms, for all I know.

Here’s a shell script, ncbihbk.sh, to fetch the PDFs and stitch them together. Notice how the sneaky NCBI have named 3 of the files using a different convention to the other 21. I’m sure that it wasn’t deliberate.

#!/bin/sh
# ncbihbk.sh
# fetch NCBI handbook chapters 1-24 and concatenate

for i in `seq 1 24`
  do
if [ $i -eq 5 -o $i -eq 13 -o $i -eq 18 ]; then
# chapters 5, 13, 18
    echo "Fetching ch$i.pdf..."
    wget -q http://www.ncbi.nlm.nih.gov/books/bookres.fcgi/handbook/ch$i.pdf
    echo ch$i.pdf >> filelist
# don't bash the servers!
    sleep 3
else
# all other chapters
    echo "Fetching ch${i}d1.pdf..."
    wget -q http://www.ncbi.nlm.nih.gov/books/bookres.fcgi/handbook/ch${i}d1.pdf
    echo ch${i}d1.pdf >> filelist
    sleep 3
fi
done

# concatenate PDFs from list
echo "Concatenating PDF files..."
cat filelist | xargs pdfjoin --outfile ncbi.pdf

echo "Output in ncbi.pdf"
exit 0

Type “sh ncbihbk.sh”, sit back and relax. Voilà, the NCBI handbook in all its 407-page glory. Another triumph for free software. To concatenate any collection of PDF files, just run “pdfjoin –outfile mypdf.pdf file1.pdf file2.pdf file3.pdf. . .”

To be honest, it’s probably as easy to browse the handbook online.