Here in Australia the general population uses the British DD/MM/YY format for representing dates, eg. today is 07/06/15, and the en_AU.UTF-8 locale in FreeBSD 10.1 honours that:

lrwxr-xr-x  1 root  wheel  22 17 Feb  2011 /usr/share/locale/en_AU.UTF-8/LC_TIME -> ../en_GB.UTF-8/LC_TIME

However I wanted programs to use the ISO 8601 YYYY-MM-DD date format (2015-06-07) instead. To do this in Linux, the general method seems to set LC_TIME=en_DK.utf8, but FreeBSD has no locale by that name.

As root, I could modify /usr/share/locale/en_AU.UTF-8/LC_TIME, but that could be overwritten when I upgrade to 10.2 with freebsd-update.

After reading locale(1) it turns out users can set PATH_LOCALE=$HOME/locale to use their own custom locales, so I copied /usr/share/locale/ to $HOME/locale/ then modified $HOME/locale/en_AU.UTF-8/LC_TIME:

$ diff -u /usr/share/locale/en_AU.UTF-8/LC_TIME $HOME/locale/en_AU.UTF-8/LC_TIME
--- /usr/share/locale/en_AU.UTF-8/LC_TIME       2011-02-17 13:19:18.000000000 +1100
+++ /home/ozzmosis/locale/en_AU.UTF-8/LC_TIME   2015-06-07 18:17:57.537156884 +1000
@@ -37,7 +37,7 @@
 %a %e %b %X %Y

Make sure LANG=en_AU.UTF-8 is set in your login, then logout and back in:

$ locale

$ date +"%x %X"
2015-06-07 18:42:59

While cleaning out all the disused apps on my phone & tablet in the hope of speeding it up a little, I thought I’d make a list of Android apps that I use regularly.

Adobe Acrobat
Aus Map (Melway)
Battery Spy
Call Confirm
Data Enabler widget
ES File Explorer
Facebook Messenger
Google Maps
Hacker’s Keyboard
Jota Text Editor
Lapse It
Metro Notify
My Tracks
Nexus Torch
Offi Stations
Play Music
Rotation Locker
rsync backup
Screen Brightness
Silent/Vibrate/Ring widget
Sundroid Free
Ultimate Sound
Ulysse Speedometer
VX ConnectBot
Weather Australia
Wi-Fi toggle widget
Zoner Photo Studio


With recent versions of Clang built from SVN in Ubuntu 12.04 Precise, you’ll receive the following error when trying to run clang:

clang: /usr/lib/x86_64-linux-gnu/ version `GLIBCXX_3.4.18' not found (required by /opt/clang-svn/bin/clang)

The solution is to symlink /opt/gcc-4.8.2/lib64/ to /usr/lib/x86_64-linux-gnu/

sudo ln -sf /opt/gcc-4.8.2/lib64/ /usr/lib/x86_64-linux-gnu/

Now clang will run properly:

$ /opt/clang-svn/bin/clang -v
clang version 3.5.0 (211951)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

It’s possible to build Clang from SVN in Ubuntu 12.04 LTS (Precise Pangolin), but you need to build GNU C++ 4.8 first, because the version that’s provided with Ubuntu 12.04 (GNU C++ 4.6) isn’t new enough to build it!

Firstly, install some build dependencies:

sudo apt-get install libmpfr-dev libgmp3-dev libmpc-dev flex bison

You might also need to do:

sudo apt-get build-dep gcc

Then build and install GNU C++ 4.8.2 to /opt/gcc-4.8.2/:

mkdir $HOME/src
cd $HOME/src

tar xvf gcc-4.8.2.tar.bz2

cd gcc-4.8.2
mkdir build
cd build

../configure --disable-checking --enable-languages=c,c++ --enable-multiarch \
  --enable-shared --enable-threads=posix --program-suffix=4.8 \
  --with-gmp=/usr/local/lib --with-mpc=/usr/lib --with-mpfr=/usr/lib \
  --without-included-gettext --with-system-zlib --with-tune=generic \

make -j8

sudo make install

“make -j8” above runs a parallel build, where multiple parts of the code are compiled concurrently. This speeds up the build process on multi-core CPUs provided a few GBs of free memory is available. If you find you’re running out of memory during the build, you can change this to “make -j4” or instead simply use “make” without the -j option to disable concurrent compilation.

Once GNU C++ 4.8.2 is installed, you can optionally free up disk space with:

rm -rf $HOME/src/gcc-4.8.2/

The version of Clang in SVN also requires a newer version of CMake than what’s provided in the Ubuntu 12.04 repositories (CMake 2.8.7). We’ll build and install CMake, but to make things interesting, we’ll use CMake 2.8.7 and our newly installed GNU C++ 4.8.2 to build CMake

sudo apt-get install cmake

mkdir $HOME/src
cd $HOME/src

tar xvf cmake-
cd cmake-
mkdir build
cd build

cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/cmake- \
  -DCMAKE_C_COMPILER=/opt/gcc-4.8.2/bin/gcc4.8 \
  -DCMAKE_CXX_COMPILER=/opt/gcc-4.8.2/bin/g++4.8 ..

make -j8
sudo make install

Finally we can focus on building Clang from SVN.

As per the previous blog post where we built Clang under Arch Linux, we need to install Subversion and Python 2.7 first:

sudo apt-get install subversion python

Now we do an SVN checkout of all the required components:

mkdir $HOME/src

cd $HOME/src
svn co llvm 

cd $HOME/src/llvm/tools 
svn co clang 

cd $HOME/src/llvm/tools/clang/tools 
svn co extra 

cd $HOME/src/llvm/projects
svn co compiler-rt

Finally we can begin building Clang:

mkdir $HOME/src/llvm/build
cd $HOME/src/llvm/build

/opt/cmake- -DCMAKE_INSTALL_PREFIX:PATH=/opt/clang-svn \
  -DCMAKE_C_COMPILER=/opt/gcc-4.8.2/bin/gcc4.8 \
  -DCMAKE_CXX_COMPILER=/opt/gcc-4.8.2/bin/g++4.8 ..

make -j8
sudo make install

After writing all of that, it’s possible I’ve missed some steps, particularly any build prerequisites. They should be fairly self-explanatory though. For example, I don’t recall if wget is installed by default in Ubuntu, so obviously you might need to run “sudo apt-get install wget” before you can use wget.


Clang is a compiler front end for the C, C++, Objective-C and Objective-C++ programming languages, and can often be used as a drop-in replacement for the GNU C & C++ compilers. Clang uses LLVM as its back end. It is possible to checkout the latest version of Clang from the LLVM SVN repository:

mkdir $HOME/src

cd $HOME/src
svn co llvm 

cd $HOME/src/llvm/tools 
svn co clang 

cd $HOME/src/llvm/tools/clang/tools 
svn co extra 

cd $HOME/src/llvm/projects
svn co compiler-rt

Arch Linux is a Linux-based operating system for i686 and x86-64 computers. It uses a rolling release model. To build Clang under Arch you’ll first need to install a few prerequisites, including cmake, make, gcc, subversion and python2.

To build Clang with GCC:


rm -rf $BUILD
mkdir $BUILD

-DPYTHON_EXECUTABLE:PATH=/usr/bin/python2 ..


Then run “make install” as root to install Clang to /opt/clang/.

You can also install an older version of Clang from the Arch repositories to build the SVN version of Clang. This should speed up the build process compared to using GNU C++. It takes roughly an hour to build on an Intel Core 2 Duo.


rm -rf $BUILD
mkdir $BUILD

-DCMAKE_C_COMPILER=/bin/clang \
-DCMAKE_CXX_COMPILER=/bin/clang++ \
-DPYTHON_EXECUTABLE:PATH=/usr/bin/python2 ..


Again, run “make install” as root to install Clang to /opt/clang/.

Lastly, you can build Clang from SVN with the version of Clang you just installed to /opt/clang/.


rm -rf $BUILD
mkdir $BUILD

-DCMAKE_C_COMPILER=/opt/clang/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/clang/bin/clang++ \
-DPYTHON_EXECUTABLE:PATH=/usr/bin/python2 ..


Finally, run “make install” as root to install Clang over itself to /opt/clang/.


On February 7, the SBS digital television channels in Melbourne (Mount Dandenong transmitter) moved from UHF 536.625 MHz to VHF 184.5 MHz. SBS now use the old analogue VHF channel 7 that was made available when all the analogue stations were finally switched off late last year. Currently the only station remaining on the UHF band is C31, at 557.625 MHz.

Below is a newly-updated channels.conf, suitable for use with mplayer.







Recently I’ve been evaluating Elementary OS, a Linux distribution based on Ubuntu Precise (12.04 LTS). Despite the Elementary desktop looking like they’ve cloned parts of the Apple OS X desktop a little too well I appreciate what they’re trying to achieve.

With Ubuntu itself, after about 10.10, their desktop environment started heading in a strange direction, trying to cater for a certain type of “modern” user, and doesn’t sit well with me. Personally I don’t want my desktop looking like a touch device and prefer a more “traditional” environment.

I’d go into this further (and less vaguely) but ultimately it’s just personal preference. I’m sure stock Ubuntu suits some people just fine.

The actual point of this post is that the current release of Elementary OS doesn’t support using software RAID from the installation CD. Apparently the Elementary installer is based on the graphical Precise installer which doesn’t support software RAID either.

One solution is to install stock Ubuntu Precise from the “alternate install” CD. The alternate installer runs in text mode, but does allow installing to a software RAID device. You can then add the Elementary OS repos to /etc/apt/sources.list.d/, and then using apt-get to install all the Elementary OS packages. When I tried this it appeared to work fairly cleanly, but for some reason still left me with somewhat broken desktop environment. Despite having an entirely empty $HOME directory (initially), some apps icons were missing from the Elementary dock that are normally visible on a regular Elementary OS install, and the window theme was still the Precise theme, not the Elementary theme.


I’m sure there are simple ways of fixing the above, but there might still be other problems behind the scenes caused by running a “hybrid” distro in this way.

A much simpler and less error-prone method is to install Elementary OS to a single drive initially, then install and run Raider. Raider converts a regular single-disk Linux installation to use software RAID, and pretty much just involves running ‘raider -R1’ (for a RAID1 setup), powering off the system, physically swapping the disks, then powering on again and running ‘raider –run’. You can then uninstall Raider if necessary; it is no longer required.

For the record I used Raider on a system running from an XFS partition (rather than the usual ext3 or ext4 format) and it worked perfectly.




I suspect future versions of Elementary OS (eg. the next version based on the upcoming Ubuntu 14.04) will support software RAID from the installer, but even so, using Raider should still be a viable alternative.

Obviously Raider can also be used to convert other existing Linux installations to a RAID configuration. Make sure you create a backup first though, just in case! (I recommend CloneZilla for that.)


Using the SQLite Integration 1.4 plugin on a newly-installed WordPress 3.6.1 site, if I post a new article with the following text:

Between foo and bar.

The text of the post is deleted (eaten) after I click Publish.

It is saved as a Draft post, with a title but no text.

Other articles are posted correctly, provided they don’t have the words “between” & “and” in close proximity, although I’m not sure what is going on there exactly.

This seems specific to the SQLite plugin, as I can’t replicate the bug using MySQL.

kjmtsh has patched the current development version of the SQLite Integration plugin to fix this bug. You can download it from here:

Click on the “Development Version” link. This link may also work.

Replacing your existing query.class.php with the new version should be all that is necessary.

This is a summary of the bug report I submitted to the WordPress support site.

I imagine the fix will also be in a future 1.5 release of the plugin.

Update: This was fixed in the 1.4.1 release.


About four years ago when I ran Windows XP on my main desktop PC I used a small bit of software named Middle Mouse Button. It reassigns the middle button of a mouse to act as a left double-click (or right double-click if you use a left-handed mouse). On modern computer mice the middle button is usually part of the scroll wheel, ie. you press the wheel down to use it. I forgot about this feature after I switched to Ubuntu.

I also bought a Logitech TrackMan Marble a short while after switching to Ubuntu. The Marble was okay, but quite bulky. It has several buttons, but no middle button, and no scroll wheel. Scrolling web pages up and down required holding a button down then using the trackball, which wasn’t ideal, and which isn’t the default in Ubuntu. It took me a bit of Googling to work out how to configure that behaviour. The commands I ran at startup were:

xmodmap -e "pointer = 1 8 3 4 5 6 7 2 9"

xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 8
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 1

Lately one of the Marble’s buttons started to become unresponsive, so I bought a Logitech MK270 wireless keyboard & mouse. The mouse has a middle button on the scroll wheel, which reminded me of my old mouse setup in XP. I wondered if I could use the middle button to double-click Ubuntu. Some Googling later, I came across the Mouse Customizations page on the Ubuntu Help site.

To cut a long story short, in Terminal, run the following command:

sudo aptitude install x11-utils xbindkeys xautomation

Then run:


Move cursor to xev’s window, hold the mouse still, click in the window using the button you want to reassign, and look at output in the Terminal:

ButtonPress event, serial 36, synthetic NO, window 0x3a00001,
    root 0x112, subw 0x0, time 405119162, (103,107), root:(106,165),
    state 0x0, button 8, same_screen YES

ButtonRelease event, serial 36, synthetic NO, window 0x3a00001,
    root 0x112, subw 0x0, time 405119311, (103,107), root:(106,165),
    state 0x0, button 8, same_screen YES

On the third line xev is telling me it’s “button 8“.

Now edit ~/.xbindkeysrc:

gedit $HOME/.xbindkeysrc

and add the following lines:

"/usr/bin/xte 'mouseclick 1' 'mouseclick 1' &"
b:8 + Release

Here, b:8 means button 8, to match the xev button above.

Finally, run xbindkeys:


You need to run this each time you start Ubuntu. You can do this manually (if you remember), or configure it to run automatically from System > Preferences > Startup Applications.

The above should also work on non-Ubuntu Linux distros as well as FreeBSD, etc. with some minor modifications.

Lastly, on my system this xbindkeys setting is also active within all my virtual machines in VirtualBox, as well as over Remote Desktop. Very handy.

Say goodbye to double-clicking.


I’ve belatedly switched my blogging software from Pyblosxom to WordPress (with a SQLite backend). Pyblosxom is elegant in its simplicity but WordPress makes it much easier to add or update posts remotely, among other things.

I’ll be manually migrating old posts across as time permits.

Two things made me delay the process. One is that I’m not a big fan of MySQL, which is normally used by WordPress. Fortunately there’s now a SQLite plugin for WordPress.

The other (relatively minor) issue is I needed to configure some subdomains for files that shouldn’t be managed by the blog. I could’ve used .htaccess files with redirection/rewrite exceptions but didn’t want to make things more complicated than necessary. Subdomains (eg. make it much easier to isolate the blog from everything else (photos, software, etc).

Evidently I’d been running Pyblosxom since November 2005, and Blosxom before that since September 2004. That’s a pretty solid run.

Update: All posts have been migrated. There was only one small hiccup with the content of one or two posts causing posts not to publish. The bug doesn’t appear in a test WordPress blog I set up with a MySQL backend, so for now I’m going to assume it’s the SQLite plugin’s fault. More on that in a future post.