sed tricks: conditional replacement

I wanted to change the read names in a fasta file. Basically, I wanted to run a sed replacement, but only on lines that start with >, changing lines like >GoodInfo_LotsOfTrash into just >GoodInfo, but I wanted to leave lines that didn’t start with > alone.

• • •

Installing ruby without sudo

I do a lot of work on a compute cluster where I don’t have administrative privileges. I wanted ruby, but I didn’t want to ask it to be installed. It turns out that you should probably use version control for all your languages! Python has virtualenv, ruby has rvm.

• • •

Eternal ssh

Mosh is an awesome tool for folks who repeatedly ssh to one machine. In an ideal world, you can keep stay logged in to the machine even as your computer’s internet connection turns on and off. Mosh does exactly this. I keep one terminal window open with mosh; whenever my computer reconnects to the internet, it automatically restarts the ssh session right where it left off, with no password entry or anything.

• • •

Using git with Word documents

I like git, and I like to use it with most of my projects. I use LaTeX for documents, but sometimes I need to use Word. (Apparently ISME J does not accept submissions in TeX. It only accepts Word, rtf, and [unbelievably!] plain txt.)

• • •

Dropping pages from a pdf

When I got a journal article through Illiad, there was an annoying first page about copyright law. After futzing around with Preview for a while, I downloaded the command-line tool pdftk.

• • •