A few days ago, I found a handy script online that colorized the output of SVN status. It worked pretty well, but needed a little polish and a couple of tweaks to make it use more common Python idioms. Also, I fixed ANSI word-wrapping issues, created a configurable tab expansion feature (for better code alignment), added the 'colorizedSubcommands' sequence so that only applicable commands get colorized, and fixed subprocess calls so that piping through less will work (for example, try svn-color diff | less -r to see colorized diff output).
I hope you find my modifications useful. You can modify the colors used by looking up the ANSI color codes for your preferred color scheme and editing the 'statusColors' dictionary. Here's a useful reference for ANSI color values:
http://www.ibm.com/developerworks/linux/library/l-tip-prompt/colortable.gif
i've posted the code on snipplr, and it's also posted below after the break.
I was attempting to install DBD::mysql today, and I ran into a fiendishly difficult problem.
I've installed the mysql drivers for Perl countless times, but this time for some reason, I was getting the following error:
ool-4577f347:~/.cpan/build/DBD-mysql-4.004 root# make
cc -c -I/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -Os -arch ppc64 -fno-common -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"4.004\" -DXS_VERSION=\"4.004\" "-I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE" dbdimp.c
dbdimp.c: In function 'mysql_dr_connect':
dbdimp.c:1565: error: 'ulong' undeclared (first use in this function)
dbdimp.c:1565: error: (Each undeclared identifier is reported only once
dbdimp.c:1565: error: for each function it appears in.)
dbdimp.c:1565: error: parse error before numeric constant
dbdimp.c:1567: error: parse error before numeric constant
dbdimp.c:1681: error: parse error before numeric constant
make: *** [dbdimp.o] Error 1
This is something I wrote over at DocForge, but I'm keeping it here for posterity. You never know what those crazy wiki-ers might do with it over there ;-)
I've got a directory full of eBooks in the godawful Microsoft .lit format. I had marked with the Finder labels the ones I've already read, and wanted to convert all the ones I hadn't read yet into a readable format.
After using the Spotlight UNIX tools and applying liberal amounts of command-line trickery, the end result was a rather beautiful pipeline, if I do say so myself.
I'm hoping to get away from PHP in favor of mod_python, but the first thing I needed to do was get mod_python successfully working on Mac OS X. I tried once before, using the built-in Apache and Python binaries that ship with Mac OS X. At the time (I think this was still 10.4, but it could have been 10.3), the built-in Python wasn't multithreaded (or something like that) and the mod_python developers were starting to move away from Apache 1.3 altogether.
I had success recently compiling mod_python on Mac OS X Server, against the distributed (but inactive) Apache 2 installation in /opt. However, I found OS X Server to be basically garbage, so I did a fresh install of the client version of Mac OS X, and set about getting Apache 2 to compile, and then mod_python.
It was not easy.