Tag: scripts

  • 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…

  • 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…

  • Sitecreator

    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…

  • 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…

  • 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:…

  • 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…

  • 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…

  • Splitting massive MySQL dumps

    As I posted yesterday, I have a massive MySQL dump to import. I tried BigDump, but one of the tables kept producing errors and so BigDump would exit. I don’t need the whole db imported, so I wrote this to split it by table. It produces a new sql file for every table it finds,…

  • Whoo! Theme update!

    I’ve updated the theme, and applied my handy modifications that make it more grey. Here’s the diff on the css file, if you’re wondering what I did (and for next time when I forget). I despise CSS, so it’s all nice and easy. The changes are to give the <pre> tags a grey (#EEE) background…

  • Generating Fluxbox menus for VNC (Vinagre) connections

    One of the lovely things about Fluxbox is the text-driven menu. One of the nice things about Vinagre (Gnome’s VNC client) is the xml-based bookmarks file. Here’s a handy script to create a Fluxbox submenu out of your Vinagre bookmarks: #! /usr/bin/perl use strict; use warnings; use XML::Simple; my $HOME = $ENV{ HOME }; my…

  • Dell Warranty Info

    I hate navigating the Dell website. It’s inconsistent and messy and noisy, and all I generally want is a single date (when the warranty expires or expired on a given box). So I wrote this. It scrapes the Dell website, and returns the warranty info for the service tag it’s been passed. I’ve CGI’d it…

  • Getopt in Perl

    Oddly, it’s taken me until this afternoon to have real need for using getopts in Perl. After a not-overly-brief look around, I’ve settled on Getopt::Long for the purpose. It’s marginally more complicated than the alternative (Getopt::Std), but more flexible and better at error checking. To use it, you pass a hash of valid options to…

  • PHP error on fresh install of PHPWiki:
    Non-static method _PearDbPassUser::_PearDbPassUser() cannot be called statically

    I’ve just installed PHPWiki 1.3.14-4 from the debian repositories and out of the box I got the following message on trying to log in to it: Fatal error: Non-static method _PearDbPassUser::_PearDbPassUser() cannot be called statically, assuming $this from incompatible context in /usr/share/phpwiki.bak.d/lib/WikiUserNew.php on line 1118 The problem appears to be that, as of PHP 5.something,…

  • Munin plugins are really easy to write

    Munin plugins basically need to output variable names and values, and a little bit of config. They’re tremendously easy to write. My plugin is mostly useless – it graphs the value returned by /dev/urandom, and the random constants from debian and dilbert. Current graph is here and the code is as follows: #! /bin/bash case…

  • Simple complex password generator

    These are really easy to write, but it’s always handy to have your own. This one lives here in its cgi form. #! /usr/bin/perl use strict; use warnings; ## Let the browser know what we’re sending it print “content-type: text/html\n\n”; ## Spew some HTML since we’re not going to get away with plain text formatting…

  • Rearranging BT Meridian csv reports

    This is a pretty specific-use script, but I’ll stick it here anyway since I keep losing it. It’s to rearrange the output from a BT Meridian switch reporting on the usage of its DNs. What it does is to space the DNs such that each DN appears in a row with a number equal to…