Kevin Cole

547 points
User profile image.
Washington DC

By day, a consultant for NOVA Web Development. By evening and weekend, he dons his costume (which looks remarkably like the jeans and T-shirts he normally wears), and goes out doing battle against the forces of proprietary software. He was the team contact for the Ubuntu DC "LoCo" and one of the hosts of the former OLPC Learning Club/Sugar Labs DC. (He has also served as a Red Hat Ambassador.)

Authored Comments

I volunteer for DC Books to Prisons [http://dcbookstoprisoners.org/]. There is a Django application written by volunteer at another books to prisoners project known as "Testament" ([http://blogs.terrorware.com/testament/2007/12/05/announcing-testament-a…] and [http://blogs.terrorware.com/testament/faq/]) which was recently improved by two of our NOVA Web Development [https://novawebdevelopment.org/] interns, one of whom is still in high school... Some here may wish to get involved with that.

A few of my "cannot-live-withouts" are regex based:

Decomment removes full-line comments and blank lines. For example, when looking at a "stock" /etc/httpd/whatever.conf file that has a gazillion lines in it,

alias decomment='egrep -v "^[[:space:]]*((#|;|//).*)?$" '

will show you that only four lines in the file actually DO anything, and the gazillion minus four are comments. I use this ALL the time with config files, Python (and other languages) code, and god knows where else.

Then there's unprintables and expletives which are both very similar:

alias unprintable='grep --color="auto" -P -n "[\x00-\x1E]"'
alias expletives='grep --color="auto" -P -n "[^\x00-\x7E]" '

The first shows which lines (with line numbers) in a file contain control characters, and the second shows which lines in a file contain anything "above" a RUBOUT, er, excuse me, I mean above ASCII 127. (I feel old.) ;-) Handy when, for example, someone gives you a program that they edited or created with LibreOffice, and oops... half of the quoted strings have "real" curly opening and closing quote marks instead of ASCII 0x22 "straight" quote mark delimiters... But there's actually a few curlies you want to keep, so a "nuke 'em all in one swell foop" approach won't work.