Git show the conflicting commit during a rebase

To view the failed patch’s commit you can use the following bash function:

function show_patch() {
  git show $(head -1 .git/rebase-apply/${1} | awk '{ print $2 }')
}

Put it in your .bash_profile or similar.

Example useage:

show_patch 0001

Copy the patch number from git’s output message e.g. “Patch failed at 0001″

Vagrant and VirtualBox, modified files do not update when viewed in either NGINX or Apache

I recently got to grips with using Vagrant for web development. The VM environment I was able to create mirrors the one I created on our production servers at work. I also decided to go the whole-hog and create my own Debian Squeeze base box from scratch with the latest versions of VirtualBox Guest Additions, Ruby, OS updates etc. For a copy of it feel free to email me. Continue reading

Modern NGINX default server definition, with hostname automatically mapped to a directory

When I first decided to switch my primary web server from Lighttpd to NGINX I attempted to mimic the setup I had achieved in Lighttpd. As such, one of my first initial gripes with NGINX is that I had to create a new Virtual Host server definition for every new site I wished to add. What I really wanted was a default catch-all definition that mapped the hostname (without the www.) to a directory, while also retaining the ability to have additional site-specific definitions when needed. Continue reading