Renewing self-signed certificate for ejabberd

I run an ejabberd server on an Ubuntu 12.10 box and this week I started getting notified by my IM client that the server’s certificate had expired.

Here’s how I managed to generate a new certificate.

WARNING: this process backs up, deletes and then restores your ejabberd database, so it is probably fairly risky.

# Move any previous backups out of the way
sudo mv /var/backups/ejabberd-* ~/Desktop/

# Move the expired certificate out of the way
sudo mv /etc/ejabberd/ejabberd.pem /etc/ejabberd/ejabberd.pem.old

# Reconfigure the ejabberd package (WARNING: backs up and deletes your database!)
sudo dpkg-reconfigure ejabberd

# Make the database backup file readable
sudo chmod a+rx /var/backups/ejabberd-*/
sudo chmod a+r /var/backups/ejabberd-*/*

# Restore the backup
sudo ejabberdctl restore /var/backups/ejabberd-*/ejabberd-database

If you’re lucky, your server will now be back up with a new self-signed certificate.

In general, the policy of using dpkg-reconfigure to handle creating new self-signed certificate seems to work nicely.

What is node.js?

Node.js is a way of writing your web applications wholly in JavaScript, which sounds like a terrible idea.

However, it is also an asynchronous programming environment that has been proven to scale really well, and it’s a collection of libraries many of which are excitingly small and well-encapsulated.

Here we just cover the basics of what it is:

Slides: What is node.js?

avconv performance slow in Ubuntu 14.04 trusty

I noticed that my TV conversion scripts were suddenly running very slowly after upgrading to Lubuntu 14.04.

After some investigation it turned out it had started defaulting to using libx264 encoding when the output file was named *.mp4.

When I ask it to use mpeg4 encoding instead, it goes fast again:

avconv -i MyProg.ts -acodec copy -b:v 2500 -c:v mpeg4 MyProg.mp4

I assume in previous releases it was defaulting to mpeg4, unless there’s been some huge performance bug introduced into libx264.

Interestingly, when I built the latest version of avconv from their git repo, it didn’t include libx264 at all, and happily defaulted to mpeg4.