Tony's ramblings on Open Source Software, Life and Photography


I decided I wanted to provide DHCP to two different VLAN's each with their own subnet, connected to the same network card in my default router. All packets arriving on that network jack are tagged for either one or the other VLAN.

Initially I had trouble with the DHCP server only seeing packets on the root eth0 device and ignoring all the packets on the vlan devices (eth0.1 for instance.) There's a couple of changes I had to make for this to work. These instructions assume an Ubuntu server

The steps are:

Configure the VLAN devices

Linux, iptables, SNAT and Too Many Adapters

I've had some weird glitches with my primary firewall this week. After a reboot, certain SNAT rules just didn't... happen. Or, other SNAT rules did. And it always seemed to only impact SIP traffic.

For instance, after rebooting, SIP traffic from one internal phone server that's destined for another internal phone server at the other end of a VPN connection would spontaneously decide to SNAT itself to an external IP address, yet still go across the tunnel.

Or, SIP traffic destined for the outside would decide to route correctly out the right adapter, but leave the private address on it, ignoring the SNAT rule I could plainly see in iptables.

Owncloud and public shares not returning data

I just ran into an issue with Owncloud after updating where public password-protected shares would fail to open and just give a blank result to the browser.

It turns out this is a problem with the way that Owncloud is using Memcache. Now, I could go into the whole lecture of how Owncloud is using Memcache completely wrong (they are) in more than one way. Instead I'm going to just give you a quick fix.

So, if you notice these in your logs:

apache2: libmemcached/ memcached_return_t memcached_send_ascii(memcached_st*, memcached_server_write_instance_st, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.
apache2: libmemcached/ memcached_return_t memcached_send_ascii(memcached_st*, memcached_server_write_instance_st, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.
[Fri Oct 03 15:16:00.329950 2014] [core:notice] [pid 5009] AH00052: child pid 5157 exit signal Aborted (6)
[Fri Oct 03 15:16:00.330375 2014] [core:notice] [pid 5009] AH00052: child pid 5161 exit signal Aborted (6)
[Fri Oct 03 15:16:00.330517 2014] [core:notice] [pid 5009] AH00052: child pid 5201 exit signal Aborted (6)

Garmin Vivosmart Review

I recently switched from the Jawbone Up to the Garmin Vivosmart fitness tracking band. Here's my review.


ModX caching problem

ModX Revolution is a pretty slick content management system for non-programmers. But, it has a few issues.

For one thing, you cannot take a website developed on one server and drop it into another server without re-installing the framework completely.

More importantly, it has seriously aggressive caching, that sometimes is counter-productive. My photography site is accessible from more than one domain name running on nginx. I found out the hard way that if someone accessed it by one domain name and then someone else by another, the first to the cache would generate links that had the full url to the first domain name in them. For most sites that's not a problem but when you're running JSON with a reactive website, the links that are crossing domain names will fail to work due to security settings in the server and browser.

I ended up doing what I probably should have done the first time which is redirect all requests for one domain name to the main one automatically with the web server.

Headless Command Line Sync for ownCloud on Linux

ownCloud is a great way for paranoid people like me to run their own Dropbox-like service. It allows you to host your own files on a server that you can easily sync between desktops and mobile devices, and it's completely cross-platform!

The biggest challenge though was that documentation for how to run an ownCloud client on a headless Linux installation that doesn't have X installed is few and far between. But, it turns out it's really easy to do!

First, simply install the ownCloud client on your Linux headless server that you wish to sync it's data with your ownCloud server. It will install a few dependencies, but not a full Xorg installation so nothing to worry about.

Next, create a config file somewhere in your home directory. I created it as:


In that file put something like the following:



Obviously replace the URL with the actual URL to your server. Honestly though I'm not even sure it's needed.

Create a local directory that you wish to use to store your ownCloud files within:

mkdir /home/tony/ownCloud

Configuration of Asus Routers Running Merlin Firmware

NOTE: This is now outdated and Matthew has emailed me to let me know he'll be doing a new write-up soon.

Here's a guest blog post by Matthew Burkett on configuring the Merlin router firmware for OpenVPN.

Initial Setup
So starting from the point of opening the box or using the reset button, when you first power on the device you will need to enter the basic information. Secure username and password for the router login, wireless SSID (Name) and password for both 2.4 and 5 Ghz channels, and your internet connection info if it was not automatically detected by the router. At this point you should have a fast useable router with great wireless coverage, if you are a standard user congratulations your done. Get on face book and tell your friends, if you are like me however you have only just started.

Merlin firmware installation


Gluster on ZFS with Geo-Replication

I've been fighting with Gluster with geo-replication on ZFS for several months now but I believe I've finally stumbled on the configuration that works best and gives much better Gluster performance on ZFS.

First a peek at the landscape
I probably don't have your typical storage needs. On this particular cluster I'm storing around 15 million files averaging 20MB each. No more than 255 files or sub-directories in a given directory.

My Gluster configuration uses a two-brick configuration with replica 2 (mirroring) and a single geo-replication slave over SSH.

Each Gluster brick uses ZFS RAID-Z volumes, spanning four SATA3 7200 RPM drives, and a single 256 GB SSD configured as a cache drive for the volume. Each Gluster server is connected on a private gigabit network segment to each other, and for the initial data load the Geo-replication server was connected to the same segment.

The Geo-replication slave also uses ZFS RAID-Z, but does not have a cache drive.

The goal with this configuration is to enable snapshot backups on either brick, plus geo-replication backups to a distant datacenter.

It's Elementary My Dear Watson

A friend of mine has switched to Elementary OS and claims it's the best Linux desktop he's ever used. Debian / Ubuntu based but with a lot more focus on the user interface and making it both pretty and useful.

Is it time for Canonical to lose the Desktop Linux battle? Perhaps, as they seem to be diverging more and more from what the average Linux user want's to see. Unfortunately they seem to have missed that no matter how much you try to dumb down Linux for my Grandmother, 99% of Linux users are still going to be geeks, or have an install that is set up by a geek.

Maybe with Valve moving more towards Linux with SteamOS and porting their game platforms to Linux, and with Electronic Arts and Dice occasionally wanting to mention the word Linux so they don't feel left out, you'll see more mainstream adoption. I imagine we will go through something similar to Android - different vendors may try to push their own "versions" of Linux branded for them, just like Valve is doing with SteamOS.

Install Canon MG5220 Printer / Scanner in Ubuntu 13.04

I finally got around to setting up my Canon MG5220 printer / scanner in Ubuntu. It was a little challenging just because of a couple of settings and obscurity around how to use it in Linux.

First, using this old article, I was able to find, download and install the drivers.

The kicker in Ubuntu 13.04 is that they've pretty much nerf'd the printer administration system. Thankfully this printer plays nicely, once you change a setting.

After turning on your printer and attaching it to the wifi, you need to go to the web interface on the printer at http://[printeripaddress]/

Next, click the "Other Settings" button in the bottom right of that page.

Then, click "Network Settings" and change the "LPR Service Notification" to "On".

To recap this page you should see something like:

Once that's done go and add a printer and Ubuntu should find it automatically. If you've followed the steps to install the driver in the blog post linked above, it will find the driver automatically.