Tag: perl
-
Perl Language server in VS Code
Thanks to Grinnz via haxmeister: Do cpan PLS and then install this plugin:
-
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…
-
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,…
-
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…
-
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…