I discovered this after a curious problem led me to email my VPS provider and get back a pointer to mailing list exchange. Possibly more interesting than the original problem, I also learned that this exists.
Back to flipping out...
The Home for People Who Like to Flip Out and Write Code
I discovered this after a curious problem led me to email my VPS provider and get back a pointer to mailing list exchange. Possibly more interesting than the original problem, I also learned that this exists.
Back to flipping out...
Posted by
Hank Gay
at
06:27
View Comments
Labels: entry, man, NetBSD, note-to-self
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...
Posted by
Hank Gay
at
22:16
View Comments
Labels: django, note-to-self, python, virtualenv, virtualenvwrapper
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...
Posted by
Hank Gay
at
10:28
View Comments
Labels: mac, note-to-self, postgresql, user-management
Ever get that feeling that there just has to be something built right into the shell that will solve the problem you're facing, but have no idea what that something might be? Enter apropos. It searches the man page blurbs for entries that match your keywords, which can be regular expressions. How is it that more people don't talk about features like this?
Back to flipping out...
Posted by
Hank Gay
at
22:40
View Comments
Labels: note-to-self, unix
nohup a Running Process
Posted by
Hank Gay
at
15:25
View Comments
Labels: note-to-self
git rebase --onto $NEW_BASE $OLD_BASE $BRANCH_BEING_REBASED
Back to flipping out...
Posted by
Hank Gay
at
15:19
View Comments
Labels: git, note-to-self
TIMESTAMP literal syntax
TIMESTAMP'2009-01-15 00:00:00.000'
Back to flipping out...
Posted by
Hank Gay
at
08:26
View Comments
Labels: note-to-self, Oracle
The next time you're doing some rough benchmarking and you want to prevent Oracle's cache from skewing your subsequent runs:
alter system flush buffer_cache;
Be forewarned: sometimes it takes a while to run this one, and you need system-level privileges.
Back to flipping out...
Posted by
Hank Gay
at
14:24
View Comments
Labels: benchmarking, note-to-self, Oracle
Here's an easy-to-follow snippet for the next time you need to parse an Accepts header.
Back to flipping out...
Posted by
Hank Gay
at
06:10
View Comments
Labels: http, note-to-self, python
If you need to do statistical analysis on data in your Oracle database, DBMS_STAT_FUNCS is your friend, especially the SUMMARY function.
Back to flipping out...
Posted by
Hank Gay
at
14:08
View Comments
Labels: note-to-self, Oracle, statistics