Format XML with PHP

Courtesy of TJ at devnet ...

April 5, 2007 · 1 min · Dave Perrett

Compile LibTorrent on OSX

Before you do anything, install darwinports , and then use it to install boost : ...

April 2, 2007 · 1 min · Dave Perrett

Installing MySql/PDO for PHP

I was getting something like this trying to run an application built on the Zend Framework : ...

April 2, 2007 · 1 min · Dave Perrett

Vi as default crontab editor

Dreamhost sets your default editor to pico. To change it to Vi, add the following line to the .bashrc file in your home directory : export VISUAL="vi"

March 22, 2007 · 1 min · Dave Perrett

Installing Trac

Before you do anything, Install Subversion . Install Python : ...

February 19, 2007 · 3 min · Dave Perrett

Svn server w/ Apache

Make sure you have a newish version of libtool $ wget http://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz $ tar xvzf libtool-1.5.22.tar.gz $ cd libtool-1.5.22 $ ./configure $ make $ make install ...

February 18, 2007 · 3 min · Dave Perrett

Cake actions from the terminal

Edit app/webroot/index.php and change the lines that read like : if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') { } else { $Dispatcher=new Dispatcher(); $Dispatcher->dispatch($url); } to something like : ...

February 7, 2007 · 1 min · Dave Perrett

Delete files by extension

To recursively delete all files with a given extension (eg all .pyc files in a django application), use : find . -name "*.pyc" -exec rm '{}' ';' Change the “*.pyc” part to delete different file types.

January 2, 2007 · 1 min · Dave Perrett

Splitting up Django models

Create a models folder under myApp. Delete models.py and add a model_name.py file in the models folder for each model model_name. Add the following to each model file : class Meta: app_label = 'myApp' Add a line in models/init.py for each model file : from myModelFile import myModel More information at djangoproject.com

December 31, 2006 · 1 min · Dave Perrett

Shell coloring for iTerm

Create a .bash_profile file in your home directory containing the following : . ~/.bashrc ENV=$HOME/.bashrc export ENV export TERM=xterm-color alias ls='ls -G' alias ll='ls -hl'

October 4, 2006 · 1 min · Dave Perrett