Last week, I started looking for a CalDAV server that suits my needs (I need one that does LDAP authentication), and I couldn't find one. The Apple Calendar Server claims to be able to use LDAP, but only through something calles "Open Directory", which only gets built on Darwin platforms, and RSCDS is PHP and wants to use its own user store on top of any authentication I do..
As I don't know enough about the Darwin Calendar Server internals, and I won't touch PHP, I decided to start writing my own WebDAV server (which I'll make into a CalDAV server soon), in perl.
The code is currently still a bit rough, a few mandatory bits of RFC4918 haven't been implemented yet (the "If" header, for example), and a few things are untested (other conditional headers), but it's possible to put files on it using Nautilus, and litmus tests show the basic bits work.
You can get a copy of the current code using
bzr:
bzr get http://foodfight.org/download/dav-server/main
I'm off implementing a super-simple version of HTTP Basic authentication, so I can start working on ACL support (RFC3744), which is another prerequisite for implementing CalDAV (RFC4791)...
I've updated my mass machine updater to skip commented lines (lines starting with #).
I maintain a few servers for people, and every time a security upgrade comes
out, I have to ssh to each of them, apt-get update; apt-get
dist-upgrade and wait. So I wrote a
small script to
automate this.
It requires a directory named log in your home directory (to write the logs to), and a file called upgrade-hosts.conf in a directory called etc, also in your homedir. It also depends on a private RSA-key in ~/.ssh/id_rsa.
Running the script will start an ssh-agent, and ask you for the passphrase of your RSA key once. Then it will ssh to all machines listed in the config file, and execute a command (some apt-get stuff) to upgrade the machine. Everything gets logged in files in the ~/log directory.
The config file should look something like this:
hostname1 some comment hostname2 some other comment
I run this blog on the subversion-version of pyblosxom. This usually works great, and code keeps working.. but a few days ago it didn't. After looking at the problem for a while I figured it out: subversion neglected to mention that there were conflicts during the latest update. Or it did mention it.. just not in an obvious way.
It also modifies your original files and replaces them with a some patchwork (full of "<<<") of the conflicting revisions. Which breaks stuff.
I guess using bzr spoiled me...
A few weeks ago I finally finished my first "real" application using the Catalyst framework: my brother's trumpet tabs site.
Because I was learning how to do things the best way, it now has mixed URL styles (one in the tab search section, one in the forums), but it works quite nicely. It even uses XMLHTTPRequest for retrieving forum posts when quoting!
I still keep finding small things to fix (mostly XML strictness or missing features that were present in the old backend) all the time though.. time to teach him how Catalyst works :)
Because my sister and a friend wanted to blog in Dutch, I've written locale handling for pyblosxom.
It's disabled by default, but once it's enabled, "date-style" URL's (http://your.blog/2006/May) will only work in the set locale (http://your.blog/2006/mei if your locale is Dutch, for example). It takes care not to break "standard" time/date formats (W3C, RFC2822), too. Most plugins I've tried also work with it out of the box.
If a plugin doesn't work, please report it to me, so I can send the author a patch. Usually it's an easy fix (don't use static names for months, etc.).
In the past few weeks I've been steadily improving my graphing framework, and I've added a lot of new plugins:
If you like graphs, check it out, and give me some feedback ;)
I've bought a 4-way temperature sensor for my new apartment, and decided that I needed to update my existing thrown-together rrdtool scripts. So I did. :)
You can get the result from http://foodfight.org/download/graph-spul, using either a plain HTTP or using bzr. It loads plugins dynamically based on the config file, and it includes 3 plugins by default (one for the temperature sensor, one for ethernet statistics, and one for reading temperatures from a hddtemp daemon).
Example output (yes I know I haven't wired up the other 3 sensors yet ;)):
After my last blog post I've been writing some more stuff for/using my new graphing framework:
So go ahead and download a copy from http://foodfight.org/download/graph-spul (that's a bzr repository).
Also, thanks to keyweed for writing the disk usage plugin.
I've recently started learning Python (again), and this time it seems to be sticking. The only problems I'm left with are the small, stupid ones that you only get if you've been writing Perl code for years:
re.match() != re.search()You'd expect re.match() and re.search() to be identical, but they're
not: re.match() only matches at the beginning of the string.
If you want "Perl-like" matching, use re.search(),
which will match even if the pattern doesn't start at the beginning of the
string.
break/continue vs last/nextI don't know why it took me ages to find this, but the Python
equivalents of Perl's last/next statements are
break and continue. And I keep remembering it the
wrong way around, too.
I'll keep updating this post with other "small things" I find as I'm getting to know Python better.
Op dit werk is een Creative Commons Licentie van toepassing.