For to be to make you smarter. For to be to get you dead.

blosxom and git 2012-06-04

When I moved all of my servers away from apache2, I started using blosxom in static mode. There's no dynamic content on this blog anyway, so there wasn't much sense in trying to get the CGI to cooperate with nginx. As such, I made a Makefile to build and deploy the site for me, which was pretty rad.

The site is also maintained in a git repository, though, and so I had the idea that pushing to the git repo should just automatically update the website. Here, I will share how I achieved this awesome magic.

First of all, I had to make a few changes to blosxom to get it to play nice with a git repository.

Here is my modified blosxom (based on 2.0):

Next is the Makefile I use to generate the static pages for blosxom. It also renders a minified stylesheet from my lesscss source file.

Now with these in hand, I am set up with my original plan. After writing my posts I could deploy as such

$ make
$ rsync -avz --delete  htdocs

But since I would need to push the changes back to git anyway, there's no reason to take that step. In order to do this, there are only a few easy steps. First, create a bare repo on the machine that hosts your blog and add a post-receive hook to it:

$ mkdir
$ cd
$ git init --bare
$ touch hooks/post-receive
$ chmod +x hooks/post-receive

The post receive hook I use is extraordinarily simple, since I already had the Makefile to do most of the work:

Now, back on your local machine, just add this new repo as a remote and you will be able to push to it to update your blog:

$ git remote add deploy
$ git push deploy master

Happy blogging.

Pickles 2012-02-11

Today, I decided that I would make homemade pickles.


I put a jalapeƱo in the mix for good measure. Now I have to wait a couple weeks for them to ferment and become awesome.

Update: It wound up being too cold in my house for the pickles to ferment, so I just have some salty, spicy cucumbers now. They are pretty tasty, but they aren't pickles. I will try again when it gets warmer.

gitweb and nginx 2012-01-26

Update: I have now added git-http-backend into this mix to allow cloning of these repositories over https. This complicated things quite a bit more than my original posting.

I have recently undergone the enterprise of switching all of my web servers from apache2 to nginx. I don't have anything in particular against apache2, but it uses much more memory and I don't really need most of its features.

This transition went smoothly for the most part, with the exception of converting my web-accessible git interface using gitweb. I found a few guides on the topic but nothing that worked quite the way I wanted it to.

First of all, I have made some alterations to the default gitweb.conf:

I cannot stand the way gitweb does uris by default, but the "nicer uris" was where most of the headache came from when I was moving to nginx. Here is the nginx configuration I settled on:

Hopefully this comes in handy to someone else trying to do such a setup.