Ubuntu Home Server 14.04

I had grand intentions.

This home server article was to be a detailed masterpiece, a complete documentation of my home server setup.

It hasn’t turned out that way, and many pieces are missing. Turns out, that writing a detailed article on setting up a server is much harder than just doing it! So what you see here is what I finally managed to publish, 5 months after actually building it. I hope you find it useful, and I don’t rule out the possibility that I may update parts of it in future.

Knowledge Requirements

The level I’m aiming at here is a novice sysadmin. If you’ve never heard of bash or used a terminal, you will struggle and I highly recommend starting with Ubuntu desktop and using the command line to get a feel for things.

You should also know how to use a text editor. I use vi, but feel free to substitute vi for nano, which is a much friendlier text editor for anyone not accustomed to vi’s modal interface.

Sometimes, I will give “magical one-liners”, which will perform several tasks in one step. Be careful with these! And don’t copy-paste them unless you are sure that they are suitable for your configuration. Even if a one-liner isn’t quite right though, I find them useful documentation as they are unambiguous. Just be sure you understand what you’re pasting.

Finally, before I get into it, I do not offer technical support for Ubuntu or this setup. If you get stuck, please feel free to comment, and either myself or another reader may help you, but any assistance should not be taken for granted, and will probably only be given if it might also useful to others. I am aiming this at technically savvy people who are prepared to do their own legwork. Hopefully, if you’re reading this, you’re not the sort of person that takes all this magic for granted. :-)

Choose your flavour

Even though you’ve probably decided on Ubuntu, there are several flavours to choose from, and the best choice for you boils down to a couple of things:

How “hands on” do you want to be?
If you’re happy doing a distribution upgrade every 6 months, and potentially a reinstall every couple of years, then using the latest stable release of Ubuntu (15.04 at the time of writing) makes the most sense. If you’re the kind of person that would rather “set and forget”, then I recommend using the latest LTS release.

How “pure” do you want the server to be?
If you’re the kind of person that doesn’t mind bloat, i.e. a full desktop install, then the Ubuntu desktop edition offers easier setup and some useful GUI tools, at the cost of increased power and memory usage. Some of these tools (network manager) can get in the way of shell-based configuration though, and a ssh session can be easier than having to plug a mouse and keyboard into a computer by the TV.

There are also more specialised distributions such as Kodibuntu (formerly XBMCbuntu), but for me, HTPC duties are secondary to NAS and server duties, so I prefer to have a clean base and treat Kodi as an add-on, rather than add NAS duties to Kodi.

Thus, I am going for the LTS release of Ubuntu Server because;

  • I like my servers to be clean and free of clutter
  • I value stability and don’t want to be forced to upgrade every 6 months

There is one caveat here and that’s proprietary drivers. The ASRock Z97E-ITX/AC motherboard I’m using has a Broadcom BCM4352 wireless adaptor, and the package provided in 14.04 failed to compile the kernel module. It was solved by installing the same package from 14.10, as detailed here.
Continue reading

Canon EOS – From 40D to 70D

It was time to upgrade. The 40D has been a trooper, but it hasn’t seen much use recently. Whether it’s the inconvenience of its compact flash memory cards, or just sheer size and weight, I have seldom felt the need to travel with it.

The 40D was released 8 years ago in 2007, which is a very long time in technology. I bought mine at the start of 2009, just after the release of the 50D, which carried a 30% price premium over the older model. I’ve never regretted my decision to go with the 40D, and I’ve had over 30,000 shutter actuations out of it, most of those with my favourite lens – a Canon EF-S 10-22mm f/3.5-4.5 USM. Now days, you can get a much cheaper 10-18mm lens which is slower (f/4.5-5.6), but has a STM motor and image stabilisation, making it much better for video. If you don’t already have an ultra-wide angle lens, seriously, get this one.

In the past year though, I’ve probably shot less than 100 frames with the 40D, favouring a much smaller Panasonic GX1 with a Samyang 7.5mm fish-eye and the excellent 20mm f/1.7 pancake. These lenses are as sharp as they are useful, but when using the little GX1 I don’t really feel like I’m “doing photography”. The experience is that of using a point & shoot, but the pictures I can take with it are almost as good as the 40D (better in low light with the f/1.7 pancake actually). Lugging the SLR doesn’t really make sense.

Looking through some of my old photos recently made me realise how much I miss the Canon 10-22mm lens. The fish-eye is fun, and even has a wider field of view, but images from rectilinear lenses afford more creative flexibility in my opinion; the fish-eye look is distinctive, and not one you really want to characterise all your images.

A lack of options

It was a while before 40D and 50D owners had a real upgrade path, and the 70D is arguably the first true “heir” of the XXD series since the 50D, or at the least the first in the same price range to better the older cameras in every specification. Ever since Canon made the 60D much more “consumer” oriented, semi-pros and enthusiasts have cried out for a true replacement for the 40D and 50D, without the high price tag of the 7D. Personally though, I wouldn’t have had much beef with the 60D had I brought one. The tank-like build of the 40D always seemed excessive for my needs, and it was better than the 40D where it needed to be. The 70D though, is a significant upgrade and I’d encourage you to read dpreview’s article.

So, I finally decided to upgrade my SLR, opting for the heavily discounted 70D rather than waiting for the 760D for about the same money. There’s just something about getting a £1,000 camera for closer to £500, even if it is almost 2 years older!

But if you’re reading this you probably want to know; what’s it like to upgrade?

Canon 40D and 70D

Size and weight

The 70D is lighter, noticeably so, but not so much that you’ll start losing tone in your right arm. The 40D is a tank, and while I wouldn’t describe the 70D in the same way, it still has an appreciable heft to it.

The 10-22mm lens balances extremely nicely on the 70D, it feels like a better fit than it did on the 40D actually, but this reverses with the Sigma 17-50mm f/2.8. The Sigma is a heavier lens, which balances slightly better on the 40D, but still extremely well on the 70D.

Subjectively, the weight of the 40D + 10-22 is about the same as the 70D + 17-50. The difference being, with the 40D more of the weight is in the body. So yes, the 70D sheds some pounds, but these are both big cameras.


The 70D’s grip looks more compact but somehow feels “chunkier” – I prefer it to the 40D. The 40D has more space between the grip and lens and is better for gloves. It’s a trade-off, but given how rarely I have used the 40D with gloves it feels like a good one.

As for the battery grip, I bought one for the 40D and used it twice. I don’t plan to buy one for the 70D so no comment there!

40d 70d

The 70D is narrower, but there’s not a lot in it


Already missing the 40D’s rear dial and joystick.

The 40D has the same control layout as Canon’s pro cameras, and it’s excellent at not getting in the way. The 70D’s dial is smaller, more fiddly, but I’m sure I will get used to it with time. I really am not liking the feel of the directional controller in the middle however, “mushy” would be a generous way to describe it.

The 40D’s joystick was extremely useful for changing the focus point, but the 70D has a button next to the shutter for cycling through point options, and after that it’s a matter of rolling a dial (or using the mush-pad) to set. This makes it easier to change the AF area mode, at the expensive of being a little slower to set the actual point. So, another trade-off but not an altogether bad one. And the improvements to the focus system itself make up for any disadvantages many times over.

And then there’s the touchscreen.

Generally I prefer to shoot with the camera to my eye, but for the situations where you need to hold the camera above your head, the touchscreen will be extremely useful. This is a great feature to have.

40D 70D controls

The changes in controls are mostly good, but you’ll miss the old rear dial and joystick


If anything I’d say the 40D’s viewfinder feels a touch larger, but that doesn’t make sense as they have the same magnification. It could be something to do with the 70D having slightly broader coverage, so chalk this up as a narrow win to the 70D. It’s a long way from the small dim viewfinders of XXXD cameras, but of course you pay for this with weight.


Obviously the 40D never had this. It wasn’t a major selling point for me, but there is one situation where I think it will be very useful, and that is group photos that include me in the picture!

Turn wifi on, set timer to 2 seconds, open the EOS Remote app on your phone and you have a camera remote without carrying around something dedicated to the task. Brilliant.

Some have criticised the WiFi as being complex to set up, but as someone who works in IT I find it logical and very well implemented. Couldn’t be happier to have this feature!


One of my concerns when Canon released the 5D mark II was the new coded batteries. This was an attempt to prevent third-party batteries from working as well as Canon ones, and cut counterfeiting. It worked for a while, but you can now buy batteries on eBay or Amazon which function identically to the real thing. I bought two for £16, which look, feel and were packaged like high-quality items, but it’s hard to tell what’s on the inside. Avoid anything Canon branded for less than £50 – it’s highly likely to be fake, and probably worse quality than 3rd-party batteries which don’t try to deceive you.


The GX1 with its pancake lens will still have its place in my bag, as other than the “nifty fifty”, no other EF lens I have can match its depth of field in the standard range. 20mm f/1.7 on a micro four-thirds sensor is roughly equal to a full-frame 40mm lens at f/3.5. This quite a bit of depth-of-field, something which the Sigma can’t match; f/2.8 on a 1.6x APS-C sensor is roughly equal to f/4.5 on full frame. To match that little Panasonic lens I’d need a 25mm lens of at least f/2.0, something which doesn’t exist for APS-C to my knowledge.

The Sigma 18-35mm F1.8 DC HSM beats it, but carries a massive size and weight disadvantage. The Sigma 30mm f/1.4 DC HSM is the only lens I can see that exceeds it in a reasonably compact pacakge, but it’s definitely no pancake.

From now on though, I can’t see myself using the Samyang fish-eye any more, unless I’m very constrained for luggage. My 10-22mm is back with a new body, and I’m sorry I ever left it!

Some links on this article are affiliate links, which pay a commission if you purchase after clicking them. This site is a hobby and runs at a loss, so any revenue helps pay for server costs. Thanks for your support!

Good news for Z3 Compact owners

There has been some rather good news for Z3 Compact (Z3C) owners the past couple of weeks. Firstly, Cyanogenmod started releasing nightly CM12 builds for the Z3C. But more importantly, a root exploit was released.

The thing that galled me most about the Z3 was that unlocking the bootloader permanently erased DRM keys which are required for some functionality. Usually this functionality is superfluous (I never intend to purchase any protected content from the Sony store), but in the case of the Z3C, erasing the DRM keys makes the camera worse in low light.

Unfortunately, unlocking the bootloader is required to install firmware from sources other than Sony, which means I can only do what Sony officially sanctions, unless I want to sacrifice camera performance.

I don’t believe I should have to make that choice.

This exploit restores the balance, but upgrading to Cyanogenmod while retaining the DRM keys is a fairly lengthy process:

  • Downgrade to an older, exploitable firmware version (before October 2014) with Flashtool
  • Run the giefroot root exploit
  • Backup the TA (trim area) partition with Backup TA (this saves the DRM keys so you can truly revert to stock)
  • Flash the rom of your choice, safe in the knowledge that it will always be possible to revert to factory condition!

Note that the DRM keys (probably Sony’s camera app as well) can’t be used with Cyanogenmod, so the camera will still be theoretically inferior to the stock Sony firmware. But this does allow me to revert to factory condition, or stick with firmware derived from Sony’s if I am not happy with the trade-off. Previously, this wouldn’t have been possible!

The Z3 is a great piece of hardware (read my brief review here), but Sony’s software and hostile DRM have been sore points. Now, I can finally have the phone I wanted (not to mention paid for).

Ubuntu 14.04 – No USB keyboard after upgrading kernel

After upgrading my Ubuntu 14.04 LTS install from linux kernel 3.13 to 3.16, USB input devices, particularly my keyboard, stopped working.

On rebooting to an older kernel, the keyboard worked again. The reason for this, is that the base kernel package doesn’t include the usbhid module, which is require for USB input devices.

The solution, is to install the linux-image-extra package for your kernel. In my case it was:

sudo apt-get install linux-image-extra-3.16.0-28-generic

You can either do this via ssh, or boot to an older working kernel first.

Afterwards, you should be able to do modprobe usbhid, or simply reboot, and your usb input devices should function correctly.

Sony’s “cancellation” of The Interview’s cinematic release is a shrewd move

Yesterday, Sony Pictures Entertainment (SPE) announced that it has cancelled the theatrical release of Seth Rogen’s “The Interview”, in the wake of terrorist threats.

In light of the decision by the majority of our exhibitors not to show the film The Interview, we have decided not to move forward with the planned December 25 theatrical release. We respect and understand our partners’ decision and, of course, completely share their paramount interest in the safety of employees and theater-goers.

Apparently, one of the demands of the GoP hackers that breached SPE, was that Sony should not release this film. I’m not making this shit up.

According to the USA’s own Department of Homeland Security, the threat is, unsurprisingly, not credible. Sony therefore, has no reason to cancel the theatrical release. Other than… publicity.

The trailer looks bloody awful, and if I was North Korea I wouldn’t take offense at all. Really, it should damage Seth Rogen’s reputation more than Kim Jong-un.

Cancelling it then, is exactly the right thing to do. Except that it really hasn’t been “cancelled”, as the release will eventually be “re-evaluated” once there is “no longer any threat to innocent lives”. Of course, no one would ever want to see a “highly controversial” film which “incited terrorist threats” and “offended an entire nation”.

Talk about making Lemonade.

Ubuntu Home Server 14.04 – A DIY NAS

It’s been more than 4 years since I wrote about home servers, but my Ubuntu Home Server article was, for a while, the most popular post on this blog. Since moving to the UK though, I’ve taken a more appliance-based approach to my home network. For the last few years I’ve been using a Boxee Box for media playback, and a 4-bay Netgear ReadyNAS duo NV2+ for storage, mainly to keep the bulk of my possessions to a minimum.

The appliance approach does have advantages. It is power efficient, easy to setup, and very low maintenance. But after getting an internet connection with decent upload speed, I wanted to run CrashPlan on the NAS without having to have another PC running. I managed to get it running by following directions I found here.

There’s just one problem:

3.3 months to upload 350GB is a little too long

3.3 months to upload 350GB is a little too long

Performance is abysmal, and I’ve only selected the most important data – my photos. I’m limited not by my internet connection, but by the NAS’s anaemic CPU and lack of ram (just 256Mb). Furthermore, it’s always had very slow read and write speeds – generally around 2Mb/sec, and loading a large directory via its Samba shares can take a while.

So I started to look for a replacement. My requirements:

  • Minimum 2GB ram
  • Strong CPU, preferably x86
  • 4+ drive bays
  • Linux based OS
  • Root access to said OS

The best pre-built option I could find which meets those requirements is the Thecus N5550, but at £383 it is a long way from cheap. And it barely meets the specs; an Atom CPU is strong for a NAS but not by modern x86 standards.

While the customised software shipped with a NAS does offer some conveniences, it also gets in the way of using newer Linux features such as BTFS RAID 5/6 (which is currently not considered stable but should be within the next 12 months). You’re also reliant on the vendor for distribution upgrades, and the priority is going to be shiny features which consumers will appreciate, not keeping the foundation OS up to date. The ReadyNAS NV2+ is currently running Debian Squeeze, and will be until the day support ends.

At this point I realised that a pre-made NAS with the level of power and flexibility I wanted doesn’t exist at a realistic price point. And with the end of Boxee support its days as a useful device are numbered, so a HTPC could be on the cards as well. It’s time to build my own server again.

Continue reading

They used to call this /.’d

Maybe these days it’s “hackernews’d”.

Some kind person posted a link to this article, which resulted in an email alert from Linode about outgoing traffic at midnight this evening.

This blog runs on a single wee Linode instance, but fortunately it’s over-engineered for its usual traffic volume, and served by nginx, php-fpm and the WordPress totalcache plugin.

It seemed to weather the storm really comfortably with load hovering around 0.2.

Network Graph

Wordpress Graph

Dear @Adobe and @Oracle, please stop offering crapware with every Java and Flash Player update. It gets old quick.

Unticking a box might seem like a small thing, but consider the following:

  • The number of Flash Player and Java updates are frequent due to security issues and staying up to date is very important.
  • Updating Java or the Flash Player is anything but a frictionless process as it is. For Flash, upon clicking the update prompt I am taken to a download page, where I must untick the box for whatever crapware is on offer, click download, open downloads, launch the download, close web browsers (and possibly other applications), click retry, finish. Java is a little better, but not much.
  • Many people have multiple devices to update which magnifies the annoyance factor.

We are not in the 90s any more. Apple, Microsoft and Google have all managed to make updates a 1 touch process (or less), and this is the expectation of your users.

So stop being precious about distribution, but in the very least, stop abusing the update process as a marketing opportunity. It is irresponsible and annoying to millions of people every day.