Deleting remote git tags

A reminder for when you really want to destroy a whole bunch of stuff…

Find out what tags you have locally:

david$ git tag

Delete them all:

david$ git tag -dv1.0.0 v1.0.1 v1.1.0 v1.1.1 v1.1.2 v1.2.0

Push all those deletes to the remote system:

david$ git push origin :refs/tags/v1.0.0
david$ git push origin :refs/tags/v1.0.1
david$ git push origin :refs/tags/v1.1.0
david$ git push origin :refs/tags/v1.1.1
david$ git push origin :refs/tags/v1.1.2
david$ git push origin :refs/tags/v1.2.0

That’s it. Destruction complete.

How to join multiple mp4 files together using ffmpeg on OS X

Sometimes I need to concatenate several mp4 files together. ffmpeg is a good tool for this job.

On OSX, it’s easy to install using Homebrew:

brew install ffmpeg

If you have MP4 files, these could be losslessly concatenated by first transcoding them to mpeg transport streams.
Source –

Say we have 2 mp4 files to concatenate or join together, first we transcode each of these into an intermediate format:

ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts

After that we can concatenate these together using the following:

ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

For more file, just piple separate the additional files here: "concat:intermediate1.ts|intermediate2.ts"

IBM Connect 2016: 1402 – Getting Technically Cozy with IBM Connections Cloud APIs and App Dev

Last week, whilst at IBM Connect 2016 in Orlando, Florida, I gave a presentation with Patrick Li from AppFusions. The slides from the presentation are below:

The full code examples from the presentation are hosted on GitHub here:

Push speed test results from OpenWRT to Google Sheets

I recently read Use Raspberry Pi to Measure Broadband Speeds to Hold Your ISP Accountable on Make and realised that this was an excellent candidate for monitoring my somewhat unstable Virgin Media connection.

I use an OpenWRT router (running a VPN to add a little bit of privacy), so I could adapt the article to run on the router rather than an attached Raspberry Pi.

Here are the steps adapted for OpenWRT…
Continue reading…

Adding styles to the Confluence editor

I’ve tried to add styles to the Confluence editor. It wouldn’t take them. Perhaps one of Atlassian’s values is “Don’t f@@k the editor”.

<web-resource name="editor-scripts" key="editor-scripts">
  <resource name="editor-templates.js" type="download" 
    location="assets/js/editor-templates.js" />
  <!-- // TODO: Check whether I need a context here -->

<web-resource name="editor-styles" key="editor-styles">
  <resource name="css/confluence-editor.css" type="download" 
  <!-- // TODO: Check whether I need all the dependencies here -->

My confluence-editor.css styles just wouldn’t be accepted. Javascript injection worked just fine though. Perhaps I could use JS to inject my styles?

Yup. Adding this to my editor-templates.js file worked a treat:

var editorCss = AJS.params.staticResourceUrlPrefix 
  + '/download/resources/me.davidsimpson.confluence.addon.awesome-addon'
  + ':editor-styles/css/confluence-editor.css';

if (AJS.params.isDevMode) {
  editorCss = editorCss + '?_=' +;

  '<link type="text/css" rel="stylesheet" href="' + editorCss + '" media="all">'

Note the cache busting timestamp for local development.

Why is my machine contacting

I’ve been looking at the network traffic and noticed a lot of calls from one machine to an address I’d never heard of:

Screen Shot 2015-11-16 at 00.59.42

Information on this seemed somewhat sketchy until I spotted this page on Multicast Addresses

ALL-SYSTEMS.MCAST.NET All systems on the local subnet.

What? All the machines on my local network? Really?

Pinging it confirmed this:

$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=0.103 ms
64 bytes from icmp_seq=0 ttl=64 time=14.788 ms
64 bytes from icmp_seq=0 ttl=64 time=239.376 ms
64 bytes from icmp_seq=0 ttl=64 time=256.191 ms
64 bytes from icmp_seq=1 ttl=64 time=50.762 ms

The machine accessing is running a DLNA server, so it appears to be broadcasting its presence to all the machines on the local network. Panic over.

Installing OpenWRT on a Linksys WRT1900ACS


Linksys recently released their WRT1900ACS router. Linksys said it collaborated with Marvell to ensure full open source support in the latest version of OpenWrt’s Chaos Calmer release (15.05) at launch. I’ve not seen many OpenWRT compatible routers on the market in the UK, so my interest was piqued. It seems like a decent (though expensive) router, so I thought I’d give it a go and install OpenWRT.

The WRT1900ACS page on the OpenWRT wiki was a little vague about which version of the firmware to install, but stated that the router had Marvell Armada 385 & Shelby hardware, so I used the openwrt-mvebu-armada-385-linksys-shelby-squashfs-factory.img image to flash the firmware. This worked, so I’ve document it here for others.

This merely documents what worked for me. If you brick your router following these instructions, I’m sorry, but you do so at your own risk.

Installing OpenWRT

Download the OpenWRT firmware: openwrt-mvebu-armada-385-linksys-shelby-squashfs-factory.img

Connect to the router with the supplied network cable.

Login to The password is admin. Don’t use the setup wizard. Specify manual setup.

Browse to Connectivity and in Router Firmware Update click on Manual > Select File


Select the previously downloaded openwrt-mvebu-armada-385-linksys-shelby-squashfs-factor.img, then click on Start.


Click on Yes in the Unrecognized file name modal:


Click on Yes in the Update firmware modal:


Click on OK in the Reboot Router modal:


Almost immediately, you’ll be able to browse to and see that OpenWrt has been installed:


It should ask you to set a password at this point. (I forgot to get a screenshot of that).

By default, the wifi is disabled, but it’s really straightforward to enable and secure in the admin UI.

You’ll also be able to ssh into your router. This is where the fun begins…


Secure your internet access with a VPN

The next sensible step is to setup your VPN connection. I use Private Internet Access as my VPN provider, so my VPN setup is tailored to PIA. This is incredibly easy to configure, thanks to previous work by Logan Marchione and Andrew Brereton.

Follow the script and you’ll be done in a couple of minutes.

Reboot nightly

Sometimes it’s best to just restart regularly. Here’s how:

Start & enable cron as it’s not enabled by default.

/etc/init.d/cron start
/etc/init.d/cron enable

Add this line to the crontab to reboot every day at 3am:

0 3 * * * * reboot

Save your eyes, enable the Bootstrap theme

One last thing, go into System | System | Language and Styles and enable the Bootstrap theme. It means that your admin UI is no longer an eyesore.

It turns this:

Screen Shot 2015-11-16 at 00.30.14

Into this:

Screen Shot 2015-11-16 at 00.32.48

Separation of concerns for JIRA gadgets

This blog post started out as an answer to a Stack Overflow question.

For my gadgets, I separate out all the XML, HTML, JavaScript and CSS from the atlassian-plugin.xml.

The setup is initially more complex, but once you’ve got this correct, the separation of concerns is much nicer than mangling everything into the atlassian-plugin.xml file.

The relative paths on the other hand do indeed look crazy.

My file system looks like this:

- resources/
    - gadgets/
        - css/
            - example.css
        - html/
            - example.html
        - js/
            - example.js
        - examaple-gadget.xml
    - atlassian-plugin.xml

In /resources/atlassian-plugin.xml:

<!-- add our web resources -->
<web-resource key="${project.artifactId}-resources" name="${project.artifactId} Web Resources">
  <resource type="download" name="example-gadgets/" location="/gadgets"/>

<gadget name="Example JIRA Gadget" i18n-name-key="" 
        key="example-jira-gadget" location="gadgets/example-gadget.xml">
    hosted at: 
  <description key="jira-query-gadget.description">The JIRA Query Gadget Plugin</description>

In /resources/gadgets/example-gadget.xml (replace ${project.artifactId} & ${project.groupId} with the correct value):

<?xml version="1.0" encoding="UTF-8" ?>
  <Content type="html" view="example.view" preferred_width="100%" 

In /resources/gadgets/html/example.html (replace ${project.artifactId} & ${project.groupId} with the correct value):

<!DOCTYPE html>
    <link href="../../../../../../download/resources/${project.groupId}.${project.artifactId}:${project.artifactId}-resources/gadgets/css/example.css" 
      type="text/css" rel="stylesheet">
    <script src="../../../../../../download/resources/${project.groupId}.${project.artifactId}:${project.artifactId}-resources/gadgets/js/example.js">

From this somewhat excessing starting point, you’ll have content, behaviour and styles completely separated. If that floats your boat, then you’ll be happy.

How to format a disk to FAT32 on a Mac / OS X

From Alex Plumb on superuser:

If you’re comfortable with using the Terminal, try this:

First, look at the partition table by running this command:

diskutil list

You should see something like this:

#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *16.0 GB    disk1
1:                        EFI                         209.7 MB   disk1s1
2:                  Apple_HFS Example                 15.7 GB    disk1s2

The partition we want to change is /dev/disk1.

We want to change the device to an MBR-formatted FAT32 partition.
To do that, run this command:

sudo diskutil eraseDisk FAT32 NAME< MBRFormat /dev/disk1

where NAME is the name you want to give to the disk.

As mentioned in the comments, you cannot put square brackets into the volume’s name lest things mess up. To avoid having everything fail, simply ensure that there are no square brackets in the FAT32 volume’s new name.