Ubuntu replaces /bin/sh with Dash

Trap for young players.  Ubuntu replaces the default interpreter for /bin/sh from Bash to Dash.  This was done for performance reasons, but certain scripts really don’t like this.  You can easily change it back with;

sudo dpkg-reconfigure dash

Information about this can be found here.  This was done quite a long time ago, apparently, but for whatever reason scripts that ultimately wind up calling the PHP 7.1 interpreter while under Dash break badly under some circumstances (resulting in PHP segfaulting).



Rumble Functionality with XB1 Wireless on Steam Link

If you have the newer (model 1708) XBox One Wireless Controller, you can get it to work with a Steam Link on native Bluetooth pretty easily.  But if it’s straight out of the box, the rumble motor won’t work on the controller.

In order to make it work, you’ll need a PC with Windows 10 and the Anniversary Update installed.  Go to the Windows Store and install ‘Xbox Accessories’ by Microsoft.

Then, plug in your XB1 controller with a USB cable into your PC (shut down Steam first).  The PC will then prompt you to update firmware on the controller.  Do so.  You’ll then have to repair it with the Steam Link, but once that’s done rumble functionality should work.

Threading a X-Tek Pure Buckle the Right Way

In case this is useful for anyone besides me, here is the correct way to thread the waist buckle onto a Scubapro X-Tek Pure Harness;

My sincere apologies for the Microsoft Paint drawing.  The long end of the red line represents the end of the webbing that is attached to the rest of the harness, and the short end is the end that you have in your hand.  The rest should be self-explanatory.  Threading it this way results in the buckle pulling tight properly when buckled in, and also means the other end of the webbing can slide over the buckle properly when putting it on.

You don’t want to know how many times I put it on wrong before I figured this out.  I swear that thing exists in n-dimensional space or something.

Converting a bunch of OGG music to MP3, preserving metadata

Quick one.  If you have a heap of OGG music that you want to convert to MP3 format, and also want to conserve the metadata that’s in the music, run this from Ubuntu;

for name in *.ogg; do ffmpeg -i "$name" -ab 128k -map_metadata 0:s:0 "${name/.ogg/.mp3}"; done

Done and dusted!

Netflow Collector on Splunk – Interesting Bug

The Splunk Add-on for Netflow appears to have a bug.  If you run through the configure.sh script accept all the defaults, it refuses to ingest any Netflow data.

This is because its script deletes all ASCII netflow data that’s older than -1 day old.

You can easily fix this by either rerunning configure.sh again and typing in every value, or edit /opt/splunk/etc/apps/Splunk_TA_flowfix/bin/flowfix.sh and change the following line;

# Cleanup files older than -1
find /opt/splunk/etc/apps/Splunk_TA_flowfix/nfdump-ascii -type f -mtime +-1 -exec rm -f {} \;

Change the +-1 to +1.  This tells the script to clean up all ASCII netflow data older than 1 day (ie, not everything older than some time in the future).

How to convert an MP4 to a DVD and burn it on Linux

If you’re using Vagrant with VirtualBox on Windows, create a new directory, throw the source mp4 in it, then create a Vagrantfile like this;

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-16.04"

  config.vm.provider "virtualbox" do |vb|
  vb.customize ["storageattach", :id, "--storagectl", "IDE Controller", "--port", 0, "--device", 0, "--type", "dvddrive", "--passthrough", "on", "--medium", "host:X:"]

Edit the host:X: to be the drive letter of your physical DVD drive.

Then bring up the VM with;

vagrant up
vagrant ssh
sudo -s -H

Now that’s done, do this.  You can start from here if you’re already on Linux or have some other means of getting a VM ready.  I assume you’re going to want to make a PAL DVD, and that your DVD is in /dev/sg0 (check with wodim --devices);

apt-get install dvdauthor mkisofs ffmpeg wodim
ffmpeg -i input.mp4 -target pal-dvd video.mpg
dvdauthor -o dvd/ -t video.mpg
dvdauthor -o dvd/ -T
mkisofs -dvd-video -o dvd.iso dvd/
wodim -v dev=/dev/sg0 speed=8 -eject dvd.iso

All done.  Assuming everything went well, you have a freshly burned DVD, all using open source Linux software, with no horrible adware that tends to come with Windows DVD burning software.

You can then get rid of the VM with vagrant destroy.

SSH Configuration on OpenWRT

If you’ve configured Dropbear (the SSH server) for OpenWRT so that it has a secondary listener for your WAN port (you may want to do this if you want the WAN SSH listener on a different port from the default), then you’ve probably noticed that it doesn’t come up on its own after your WAN link drops.

There’s a really easy solution to this.  Configure hotplug.d so that when your WAN interface bounces, dropbear gets restarted!  Put this into /etc/hotplug.d/iface/40-dropbear ;


if [ "$INTERFACE" = "wan" ] && [ "$ACTION" = "ifup" ]
 /etc/init.d/dropbear restart

This tip was found at the bottom of the documentation for Dropbear listed above.

Static MAC Generator for KVM

The following line will generate (pseudo-randomly) a static MAC address, suitable for use with a KVM virtual machine;

date +%s | md5sum | head -c 6 | sed -e 's/\([0-9A-Fa-f]\{2\}\)/\1:/g' -e 's/\(.*\):$/\1/' | sed -e 's/^/52:54:00:/'

Similar nonsense can be done with Hyper-V and VMware.

If you’re using MythTV 0.28 on Ubuntu 16.04 …

… you’ll want to know about this bug.  Put the following string in the end of your /etc/mysql/conf.d/mythtv.cnf ;


You may also want to try;



Raspian with Ralink 7601 Wifi Adapter

Recently picked up a Ralink 7601 Wifi Adapter (a no-name clone wifi stub from Ebay), for the princely sum of about $2 delivered.  It’s identifable easily because in lsusb it shows up as;

Bus 001 Device 005: ID 148f:7601 Ralink Technology, Corp.

Unfortunately, it turns out these things aren’t natively supported by Raspian without a firmware module.  But there’s hope!

This guide shows how to get it running, which essentially just boils down to this command;

wget https://github.com/porjo/mt7601/raw/master/src/mcu/bin/MT7601.bin -O /lib/firmware/mt7601u.bin

And then configuring it like you normally would in wpa_supplicant.  Pretty easy stuff in the end.