Postfixadmin Installer for Wheezy

Debian Wheezy ships with Dovecot 2.x which has a different config layout to the 1.x verion in Lenny and Squeeze. In response, I’ve created a wheezy branch of postfixadmin-installer (there’s an issue for it, too) which configures Dovecot 2.x and it’s actually been a really easy switch. In much the same way as the current version generally does away with the heavily commented documentation masquerading as a config file, this one simply moves /etc/dovecot out of the way and writes two files into it – dovecot.conf and dovecot-sql.conf (which are the same as for 1.x). This causes a pretty hilarious…
Read more →

Tidying up postfixadmin installer

I’ve *finally* merged about a billion changes into master in postfixadmin installer, chief amongst them is that most of the boring output now goes to a logfile, the vacation plugin might work after install and it the setup password is randomised. This is all procrastination in order to avoid working out how to configure Dovecot on Wheezy. It’s still a big pile of poor hacks rather than a ‘proper’ script, but if you just don’t look at the source you’ll be fine!


I’ve just spent a few days using up spare holiday, which means I’ve been making things for work that work doesn’t want but I do. This time it’s sitecreator, a tool for configuring websites and all their dependencies (Unix users, databases, ssh keys, DNS records etc.) on servers. Since there’s so many possible things for the site to rely upon, and I’m not *that* fond of reinventing the wheel, all it really does is generate passwords and call scripts. There’s a configuration file that tells it how many passwords to generate, how to work out what the username should be…
Read more →

Network Manager disabling Virt-manager’s bridge

This doesn’t work, and it’s filed as bug 1099949 in Ubuntu. So we’ll see how that goes. As of about six hours ago, I’ve had this regularly popping up in my syslog: Jan 13 20:13:54 amazing NetworkManager[1347]: (virbr0): device state change: unavailable -> disconnected (reason ‘none’) [20 30 0] virbr0 is the bridge created by virt-manager for its VMs to communicate on and, franky, NetworkManager has no business doing anything to it, let alone disconnecting it (especially when it doesn’t know why it’s doing it). Fortunately, NetworkManager has an unmanaged-devices option that you can put in the irritatingly-capitalised file at…
Read more →

Converting from Apache1-style to (Debian-style) Apache2-style vhosts

Yeah, some of us are still doing that migration. Anyway, historically Apache vhosts are all in one file at /etc/apache/httpd.conf or if you’re really lucky something like /etc/apache/vhosts.conf. Apache2 in Debian uses two directories – /etc/apache2/sites-available and /etc/apache2/sites-enabled. sites-available contains one file for each vhost and in order to enable them they’re linked to from sites-enabled. This is all fairly nice an elegant and human friendly, but tedious to migrate to from Apache1. Since this one’s coincided with a feeling that I should know more awk here’s how I just did this one: cp /etc/apache/vhosts.conf /etc/apache2/sites-available awk ‘/^”vhost” n }’…
Read more →

Finding exploited wordpress pages

WordPress seems to be hilariously easy to compromise (this might be a bad place to write that) and the general form of an exploit is to inject code like this < ?php $a = base64_decode(YSBsb25nIHN0cmluZyBvZiBiYXNlNjQgdGV4dAo=…….); right at the top of a script. base64_decode is rarely used by the Good Guys outside of mailers and doing tricks with images, but it’s almost never found right at the top of a script. I did write a really convoluted script that found calls to base64_decode and exec and guessed whether they were nefarious (generally, for example, base64_decode is called with a variable (base4_decode($mailBody)),…
Read more →

Unattended Virtualmin installs

A while ago I was asked to concoct a fire-and forget script to install Virtualmin without prompting. It’s really easy: #!/bin/bash if [ -z $1 ]; then echo “Usage”; echo ” $0 [hostname]”; echo “”; exit fi wget -O export VIRTUALMIN_NONINTERACTIVE=”1″ chmod +x ./ -f -host $1 rm And then you call it like so: ./

Per-extension logging in MediaWiki

This is another of those things that took me rather longer to work out than I would have liked, so hopefully this’ll appear in the sorts of searches I should have done. MediaWiki has this nifty feature where you can split the logging for particular extensions out into individual files by doing things like this:  $wgDebugLogGroups = array( ‘SomeExtension’ => ‘../logs/wiki_SomeExtension.log’,);  What’s not made overly clear (well, with hindsight, it is implied by the manual) is that the keys of the hash don’t necessarily have anything to do with the name of the extension. I assumed that, in debugging SimpleCaptcha,…
Read more →

Allowing uploads of arbitrary files in MediaWiki

I did RTFM and I did what it said, and still my Mediawiki complained when I tried to upload executable files and things with funny file extensions or mime types. if $wgFileExtensions is empty but $wgEnableUploads = true and $wgStrictFileExtensions = false it should just let me upload anything. I can’t think what other behaviour one would expect there, but set like that I can’t upload my dodgy files. So I’ve removed the code it uses to check. Here’s a pair of diffs if you’d also like to do this. These are on version 1.17.0 but I suspect it’s not…
Read more →

Tagging images by path in Shotwell

I’ve finally decided to use an image manager, and since it comes with Ubuntu this week I’ve gone with Shotwell. I’ve got a directory hierarchy containing most of my images which is sort-of sorted already, and I’m probably going to keep adding to it, if for no other reason than force of habit. I know that one of the wonderful features of these photo managers is that you can tag photos, and obviously a photo can be in more than one tag rather more easily than it can be in several directories. That said, all photo managers seem to have…
Read more →

1 2 3 6