2017-10-06 - In Defence of the Social Care Tax

A short article explaining why the social care tax, better known as the dementia tax, proposed by the conservatives during the 2017 general election was a good idea, even though means testing policies are bad economics.

2017-02-08 - Logitech c920 and ffmpeg

The Logitech C920 webcam is well supported on FreeBSD using webcamd, and some playing around has lead to the best quality full HD video being recorded using ffmpeg like this:

Assuming /dev/video0 is the webcam, you may need to adjust if you have several recording devices, this command will record video from the webcam and store it in H.264 encoding in a Matroska container as output.mkv. The command arguments have the following meanings.

f oss
Audio device is of type OSS.
i /dev/dsp1.0
Audio input is from device /dev/dsp1.0.
itsoffset 00:00:00.5
Shift audio offset from frames by half a second.
Log verbose output to .log file in working directory.
f v4l2
Device is of type Video 4 Linux version 2.
vcodec h264
Input video codec is H.264.
Pixel formatting is yuyv422.
videosize 1920x1080
Set the video resolution to 1920 by 1080 (Full HD).
i /dev/video0
The input stream is to be recorded from /dev/video0, the webcam.
Copy non-key frame at the beginning of the video.
vcodec copy
Special value copy, means no encoding just copy the input to the output stream.
Output the same pixel format as was input.
framerate 30
Read the input at 30 frames per second.
Output to file called output.mkv.

That is all there is to it. Just press "q" when done recording.

2017-01-07 - Simple, Thread Safe Error Logging in C++

My attempt at striking the perfect balance between simplicity and features in a C++ logging framework. This one is header only, allows delayed instanciation of the actual logging engine and has simple, dare I say intuitive, syntax.

2016-12-16 - Openbox XDG Menu Generator

Openbox with tint2 is very hard to beat for a stable, high-performance desktop, but writing the menu can be a real pain, so I have written this little Python script to write a menu based on the XDG specification.

When run the script will generate generic menus based on the XDG top level classifications, with a few modifications for brevity and clarity. For example AudioVideo is renamed to Multimedia and the Education classification is grouped with Science.

After generating the menu the script will ask a few questions to allow you to establish a few handy shourtcuts to often used programs and create a custom configuration menu for theme selection, printer management etc.

Below is the output from a sample run, the final options will dump the generated menu to screen for inspection or commit to openbox by writing ~/.config/openbox/menu.xml, while backing up any existing one to ~/.config/openbox/menu.xml.old.

2016-05-07 - FreeBSD 11 On Dell XPS13

FreeBSD is a stable, fast and well organised UNIX-like operating system which sees much use on servers. Alas, it suffers from "worse than Linux" consumer hardware support, nonetheless it is possible to run FreeBSD as a desktop system on all but the most recent hardware. This article covers how to run FreeBSD 11 on a Dell XPS13 laptop with a haswell processor.