Skip to content

Blog

Notes on systems, automation and open source.

Manage Bind and zone files using Ansible

You might have seen my quite simple role ansible-bind-role which lets you manage your bind configs and syncs your zone files. Precondition First let me explain why zones files are not generated in this role: My precondition was, that zones might come from different sources. They may be generated from an application or rsynced from anywhere else. Further, I didn’t want to force people to handle zone files the one way.

Read more

Using Vagrant to test Ansible roles

Continuous integration will tell you whether a role still applies cleanly, but while you are writing one you want a faster loop: a machine you can throw away, apply the role to, break, and recreate. A local hypervisor such as VirtualBox plus Vagrant gives you exactly that for a role like ansible-role-ntp. This post was written in 2014 for Vagrant 1.x and Ansible 1.x. The Vagrantfile below has been updated so it still works: the original precise32 box and the files.

Read more

A European timetable in your console

Sysadmin Python

If you want a properly geeky departure board for your train connections — on your own terminal, or on a wallboard at an event — you can have one in two commands. This post is from 2013. fahrplan is a thin client over the public transport.opendata.ch API and has seen little development since; the API itself is unofficial and its response format has changed over the years. Note also that pip install into the system Python is refused on current distributions — use pipx or a virtual environment, as below.

Read more

Extracting MP3 audio from an AVI file with ffmpeg

I look this up every few months, so here it is in one place. ffmpeg takes the video apart and writes just the audio track to an MP3 file. The whole file: ffmpeg -i sample.avi -vn -c:a libmp3lame -b:a 256k sample.mp3 -vn drops the video stream, -c:a libmp3lame selects the MP3 encoder and -b:a 256k sets the audio bitrate. For a variable bitrate instead, replace -b:a 256k with -q:a 2, which gives roughly 190 kbit/s at a noticeably better size-to-quality ratio.

Read more

Postfix: Host not found, try again

Sysadmin Postfix

If you configured Postfix to relay all outgoing mail through a smarthost and that host does not have an MX record — or does not have one anymore — the queue starts filling up and the log fills with deferrals: Jul 14 12:45:39 myhostname postfix/smtp[2349]: 74FBF30501: to=<recipient@example.org> relay=none, delay=3944, status=deferred (Name service error for name=smtp.example.com type=MX: Host not found, try again) The Postfix FAQ is right about the cause, which still leaves the question of what to do about it.

Read more