1. Apache 2.2 and Digest Authentication

    A few weeks ago I wanted to enable digest authentication on an Apache 2.2 web server. I got basic authentication working within minutes, but I didn't want to send plain text passwords over the web, so how difficult could it be?

    I followed some tutorial on the net but …

    read more
  2. A Template for Python Unix Utilities

    One of the most often read postings on this blog is the one about my getopts-enabled shell script template. So I figured, a similar template in Python would also be useful. Like the shell script, it's quite trivial, but it might still save some time.

    The template is an example …

    read more
  3. Quick Tip #3: Creating Histograms in Python

    Since Python 2.5, creating histograms has become easier. Instead of dict, we can now use defaultdict which is similar in behavior to awk's associative arrays. Instead of raising a KeyError for undefined keys, defaultdict adds a user-defined item and returns it.

    I'll demonstrate this with a simple program that …

    read more
  4. An IMAP Configuration for Mutt

    Usually, I download all my email via fetchmail, sort it into folders using procmail and read the mails with mutt. This works reasonably well and I've been using this mail setup without major changes for about 10 years. Since I recently bought a netbook, I also wanted to read mails …

    read more
  5. Ubuntu: Changes in Python 2.6

    Once in a while, I install Python packages from source using distutils. The distutils-powered setup.py script found in many packages installs software in /usr/local/ - quite useful because it doesn't interfere with packages managed by your distribution. Since Ubuntu Jaunty and Python 2.6, this doesn't work anymore.

    Previously …

    read more
  6. Quick Tip #2: Set Operations Using Shell Tools

    Everybody knows that Unix shell utilities are powerful. Even though they're text-based, you can build a lot of useful things outside of the text domain. Today I'll show you how to implement set operations. All we need are sorted files as input, with each file representing a set.

    Let's create …

    read more
  7. Google Code: Migrating to Mercurial

    Although one could have guessed otherwise, I've always been a happy Subversion user. Which former CVS user hasn't? But now I'm ready to take the next step. For some of my personal stuff I've been using Mercurial for more than a year, so I thought it was time to take …

    read more
  8. Subversion 1.5 Merging Massacres

    Recently, I had the opportunity to work with Subversion 1.5 on a medium sized project. Since there were more than 20 developers working on the project with some of them in a different country, there was no other way than to use feature branches extensively. We thought Subversion's merge …

    read more
  9. A Case for Guard Clauses

    One of my pet peeves in programming is that few people use guard clauses. A guard clause is an almost trivial concept that greatly improves readability. Inside a method, handle your special cases right away and return immediately.

    Have a look at the following example:

    private int doSomething() {
        if (everythingIsGood …
    read more

social