Wishful Coding

Didn't you ever wish your
computer understood you?

Clojure static site generator

Ever wondered why systems like Wordpress generate the whole page every time a visitor comes around? I did, and I'm not the only one. There are numerous static site generators and caching plugins around, and this is one of the former. First I wanted to write a static site generator in Python, but there is already one. I started to learn Clojure, and met defn on the Clojure IRC channel, who also wanted to write a Clojure static site generator. We started coding, and that is how Utterson came to life. I must admit though that I haven't heard very much of defn since the start of the project. Utterson works by threading Markdown files through Clojure template files to generate static HTML files. Other files(images, etc.) are copied as-is.
java -jar utterson.jar src dest
The project is currently in a state in which it works, but it would make for an awkward blog, since there are still some base features missing. http://github.com/pepijndevos/utterson For now this blog is going to be using Wordpress, until I finish the generator and find solutions to problems like comments.

Three good reasons to run a Webkit Nightly

  1. You get to use the latest an coolest features around.
  2. You can try out my 3D CSS browser game, which is finally online.
  3. You can see this wacky CSS endless zoom effect, and other beautiful show-offs.
No, seriously... You might not need it for daily web usage, but if you are a developer, it's fun! Get it at webkit.org, even the nightly is more reliable than IE6. I'm using it right now to write this.
Published on

How to install Python/web.py on a shared host

In the past I have written a few Python web applications, but when I asked my host about Python, they told me they where specialized in PHP and nothing but PHP(that is why this site runs Wordpress). If your are lucky and have a very expensive dedicated server you can install whatever you want, but how about my poor projects? I'm not going to re-write them in PHP obviously. I figured that as long as you have a CGI bin, you can do whatever you want. I started writing a CGI script that would install Python and Web.py for me; Check out the resulting web.py example. This is the script that I came up with. It should be doable to customize this for Pylons, TurboGears, Django, or any other Python framework. You should at least fill in your own home directory twice, we're doing a Python installation inside you home directory.
#!/bin/sh

echo "Content-type: text/html

";

curl http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz | tar -zx
cd Python-2.6.4
./configure --prefix=/your/home/directory #change this to your home
make
make install
cd ..
curl http://www.saddi.com/software/flup/dist/flup-1.0.2.tar.gz | tar -zx
cd flup-1.0.2
/your/home/directory/bin/python setup.py install
cd ..
curl http://webpy.org/static/web.py-0.33.tar.gz | tar -zx
cp -r web.py-0.33/web .
Note that you should add .py as a CGI handler in your .htaccess file:
AddHandler cgi-script .py
Since our fresh Python installation is not on the PATH variable, you should include a shebang header in your scripts to point to the right path:
#!/your/home/directory/bin/python
Again, check the result!