2010-12-29

Note to Self: Source Django's bash Completion Automatically

If you're using Doug Hellman's awesome virtualenvwrapper to manage your Django projects—and you really should be—try adding the following line to your $VIRTUAL_ENV/bin/postactivate script:


source "$VIRTUAL_ENV/build/Django/extras/django_bash_completion"

If you used the --no-site-packages option to create the virtualenv, that should automatically source the Django bash completion script everytime you workon into your project. If you didn't, you just need to figure out where the Django bash completion script is squirreled away on your system and use that path instead. BTW, --no-site-packages should really be the default.

Back to flipping out...

2010-11-22

Note to Self: Changing info for the postgres system user

Do you use MacPorts? Ever switch from one version of PostgresQL to another, e.g., 8.4 to 9.0? Did you notice that it started complaining about a non-existent home directory for the postgres system user? Me, too.

My first instinct was to edit the user, but there is no entry for postgres in /etc/passwd. That led me to this excellent article. Using that info, I cooked up the following command:


sudo dscl localhost change /Local/Default/Users/postgres NFSHomeDirectory /opt/local/var/db/postgresql84 /opt/local/var/db/postgresql90

Back to flipping out...

2010-08-11

Sneak Attack: The Smell of Hell

Excellent article on code smells.

Back to flipping out...

2010-08-05

Sneak Attack: Oops, I forgot to sudo in Vim

Ever forget to sudo before you started editing that file in vim? Here's a nifty, tee-based trick to save you some hassle.

Back to flipping out...

2010-07-20

Sneak Attack: TEMPORARY (Tablespace) Insanity

If you ever find yourself cursing about an ORA-01652: unable to extend temp segment by 128 in tablespace TEMP at 11 PM on your birthday, this article might be just the thing for you.

Back to flipping out...

2010-07-19

Sneak Attack: GNU Screen and the Scrollback

Handy article on scrolling with screen, which I use rarely enough that I always need to look this up.

Back to flipping out...