Category Archives: General

importing advogato entries to pyblosxom

here is a version of Thomas's advogeto script to make it output the advogato entries with filenames in the date format used by pyblosxom's pyfilenamemdate.py plugin. And, because I can't get that plugin to work properly, here is a script to set the date of those files to the date in their filenames. That's useful when I mess up the dates on my files, avoiding hundreds of entries on one day.

Python isn't my speciality, so don't blame me for the ugly code.

Green party election posters

There are lots of election posters up in Munich for the European Election next month. I don’t remember ever seeing this many before, certainly not in Britain. The Green Party has the best ones. Here’s an amusing example.

greenparty_antibushclonesLuis, it’s a sign of the times that John McCain looks like a moderate to us now. John McCain would like to ban abortions.

pyblosxom

I've been playing with pyblosxom locally and with my hosted account. It's a while since I did much .cgi, so “premature end of script headers” in the apache error.log was confusing again. Of course it really seems to mean “some of your file permissions are wrong”. I don't think I've been aware of suexec before, though it's probably quite common. Dreamhost use suexec, so you'll get that error if the .cgi script is writable by all. It's about time something stopped me from trying to fix permissions problems by giving full access to everything.

pyblosxom is nice and simple – you just put text files in a directory of your choosing, and it uses the date of the file on the filesystem to assign that entry to a date on your blog. Obviously, having to put files in there directly using a ssh session is impractical, so there is a primitive weblog-add.py script that lets you do it over the web, using apache's regular .htaccess user/password thing to restrict access. It's kind of annoying that I have to think of a filename manually, but that's not the end of the world. Also, the page-layout template system seems quite simple, with no embedded code.

I did look a the WordPress online demo, and it looks a lot more user-friendly. But I'd like to avoid maintaining a MySQL database just for my blog. I'm marginally more familiar with python than PHP, so the appearance of PHP in their templates alarms me. Also, I keep hearing about PHP being somehow fundamentally problematic for security, though I don't have the slightest idea of why.

So I am trying to get the pyblosxom xmlrpc interface to work, so I can use friendlier tools to post blog entries. I notice that the xmlrpc plugin needs python 2.2 rather than 2.1 – I think that's what the "NameError: name 'True' is not defined" error is about. So I changed the top of the pyconfig.cgi script from "#!/usr/bin/env python" to "#!/usr/bin/env python2.2". I'm not sure if that is the right way to do it. Also, python 2.2 seems to come with xmlrpclib, but you have to download xmlrpclib and copy it somewhere manually if you are using python 2.1.

It looks like gnome-blog is not quite up to date with recent pyblosxom. When using the "Self-Run Pybloxsom" Blog Type, it tries to access an xmlrpc.cgi script, but there's none in the pyblosxom-0.9.1 tarball. When I try to use the "Self-Run Other" Blog Type with The "BloggerAPI" or "MetaWeblog" Blog Protocols, givint if the URL of my pyblosxom.cgi script, it reports an "internal server error" and I get this in my error.log file.

Traceback (most recent call last):
  File "pyblosxom.cgi", line 49, in ?
    p.run()
  File "/home/murrayc/murrayc.com/blog/pyblosxom-0.9.1/Pyblosxom/pyblosxom.py", line 116, in run
    self.defaultHandler(config, data)
  File "/home/murrayc/murrayc.com/blog/pyblosxom-0.9.1/Pyblosxom/pyblosxom.py", line 130, in defaultHandler
    defaultfunc=blosxom_process_path_info)
  File "/home/murrayc/murrayc.com/blog/pyblosxom-0.9.1/Pyblosxom/tools.py", line 396, in run_callback
    return defaultfunc(input)
  File "/home/murrayc/murrayc.com/blog/pyblosxom-0.9.1/Pyblosxom/pyblosxom.py", line 304, in blosxom_process_path_info
    data['flavour'] = (form.has_key('flav') and
  File "/usr/lib/python2.2/cgi.py", line 601, in has_key
    raise TypeError, "not indexable"

But I feel that I've done quite well, and I'm sure somebody will email me with a helpful clue.

pyblosxom

I've been playing with pyblosxom locally and with my hosted account. It's a while since I did much .cgi, so “premature end of script headers” in the apache error.log was confusing again. Of course it really seems to mean “some of your file permissions are wrong”. I don't think I've been aware of suexec before, though it's probably quite common. Dreamhost use suexec, so you'll get that error if the .cgi script is writable by all. It's about time something stopped me from trying to fix permissions problems by giving full access to everything.

pyblosxom is nice and simple – you just put text files in a directory of your choosing, and it uses the date of the file on the filesystem to assign that entry to a date on your blog. Obviously, having to put files in there directly using a ssh session is impractical, so there is a primitive weblog-add.py script that lets you do it over the web, using apache's regular .htaccess user/password thing to restrict access. It's kind of annoying that I have to think of a filename manually, but that's not the end of the world. Also, the page-layout template system seems quite simple, with no embedded code.

I did look a the WordPress online demo, and it looks a lot more user-friendly. But I'd like to avoid maintaining a MySQL database just for my blog. I'm marginally more familiar with python than PHP, so the appearance of PHP in their templates alarms me. Also, I keep hearing about PHP being somehow fundamentally problematic for security, though I don't have the slightest idea of why.

So I am trying to get the pyblosxom xmlrpc interface to work, so I can use friendlier tools to post blog entries. I notice that the xmlrpc plugin needs python 2.2 rather than 2.1 – I think that's what the "NameError: name 'True' is not defined" error is about. So I changed the top of the pyconfig.cgi script from "#!/usr/bin/env python" to "#!/usr/bin/env python2.2". I'm not sure if that is the right way to do it. Also, python 2.2 seems to come with xmlrpclib, but you have to download xmlrpclib and copy it somewhere manually if you are using python 2.1.

It looks like gnome-blog is not quite up to date with recent pyblosxom. When using the "Self-Run Pybloxsom" Blog Type, it tries to access an xmlrpc.cgi script, but there's none in the pyblosxom-0.9.1 tarball. When I try to use the "Self-Run Other" Blog Type with The "BloggerAPI" or "MetaWeblog" Blog Protocols, givint if the URL of my pyblosxom.cgi script, it reports an "internal server error" and I get this in my error.log file.

Traceback (most recent call last):
  File "pyblosxom.cgi", line 49, in ?
    p.run()
  File "/home/murrayc/murrayc.com/blog/pyblosxom-0.9.1/Pyblosxom/pyblosxom.py", line 116, in run
    self.defaultHandler(config, data)
  File "/home/murrayc/murrayc.com/blog/pyblosxom-0.9.1/Pyblosxom/pyblosxom.py", line 130, in defaultHandler
    defaultfunc=blosxom_process_path_info)
  File "/home/murrayc/murrayc.com/blog/pyblosxom-0.9.1/Pyblosxom/tools.py", line 396, in run_callback
    return defaultfunc(input)
  File "/home/murrayc/murrayc.com/blog/pyblosxom-0.9.1/Pyblosxom/pyblosxom.py", line 304, in blosxom_process_path_info
    data['flavour'] = (form.has_key('flav') and
  File "/usr/lib/python2.2/cgi.py", line 601, in has_key
    raise TypeError, "not indexable"

But I feel that I've done quite well, and I'm sure somebody will email me with a helpful clue.

Annoying g++ improvement of the day

I know there's bound to be a good reason for the C++ spec to say we can't do this, and I can guess at it, but this gcc 3.4 C++-conformance improvement, pointed out to me by Bryan Forbes, is an irritation. Of course, I don't know the reason exactly because there is still no freely-available copy of the C++ spec online. No, I don't want the C# one instead

Don't mention the war(s)

More documentaries seen at Dok.Fest:

  • Willkommen an der Grenze: Mostar, in Bosnia is divided into Croation (christian) and Bosnian (muslim) parts. The 2 sets of inhabitants try not to talk amongst themselves about the war and refuse to talk to each other about anything.
  • Cement: Inhabitants of Beocin, in Serbia, talk about their town's shaky dependence on the cement factory, and their hopes for the boxing club that it sponsors.

I really like that the directors have often talked briefly after the films.

Don’t mention the war(s)

More documentaries seen at Dok.Fest:

  • Willkommen an der Grenze: Mostar, in Bosnia is divided into Croation (christian) and Bosnian (muslim) parts. The 2 sets of inhabitants try not to talk amongst themselves about the war and refuse to talk to each other about anything.
  • Cement: Inhabitants of Beocin, in Serbia, talk about their town's shaky dependence on the cement factory, and their hopes for the boxing club that it sponsors.

I really like that the directors have often talked briefly after the films.