Custom error pages in CodeIgniter

September 27, 2016

The simplest way to create custom error pages is to edit the files at /application/views/errors/html/error_*.php such as error_404.php (for 404s), error_db.php (for database errors) and error_general.php (for most other errors).

Read More

Deleting remote git tags

September 12, 2016

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 -d v1.0.0 v1.0.1 v1.1.0

Push all those deletes to the remote system:

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

That's it. Destruction complete.

Read More

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

April 11, 2016

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 files, just pipe separate the additional files here:

Read More

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

February 9, 2016

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:

Read More

Adding styles to the Confluence editor

November 25, 2015

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 --> </web-resource>

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.

Read More

Why is my machine contacting

November 16, 2015

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.

Read More

Older posts