My experience doing relatively low level X stuff in Go

Today I wound up needing a program that spoke the current Firefoxremote control protocol instead of the old -remote based protocol that Firefox Nightly just removed . I had mychoice between either adding a bunch of buffer mangling to a very oldC program that already did basically all of the X stuff necessary ortrying to do low-level X things from a Go program. The latter seemedmuch more interesting and so it's what I did.

(The old protocol was pretty simple but the new one involves a bunch


Don't use dd as a quick version of disk mirroring

Suppose, not entirely hypothetically, that you initially set up aserver with one system disk but have come to wish that it had amirrored pair of them. The server is in production and in-placemigration to software RAID requires a downtime or two , so as a cheap 'in case of emergency' measureyou stick in a second disk and then clone your current system diskto it with dd (remember to fsck the root filesystem afterwards).

(This has a number of problems if you ever actually need


Why system administrators hate security researchers every so often

So in the wake of the Bash vulnerability I was reading this ErrataSecurity entry onBash's code ( via due toan @0xabad1dea retweet) and Icame across this:

So now that we know what's wrong, how do we fix it? The answer isto clean up the technical debt, to go through the code and makesystematic changes to bring it up to 2014 standards.

This will fix a lot of bugs, but it will break existing shell-scripts


Bashisms in #!/bin/sh scripts are not necessarily bugs

In the wake of Shellshock , any numberof people have cropped up in any number of places to say that you shouldalways be able to change a system's /bin/sh to something other thanBash because Bashisms in scripts that are specified to use #!/bin/sh are a bug. It is my heretical view that these people are wrong in general(although potentially right in specific situations).

First, let us get a trivial root out of the way: a Unix distributionis fully entitled


System metrics need to be documented, not just to exist

As a system administrator, I love systems that expose metrics(performance, health, status, whatever they are). But there's a bigcaveat to that, which is that metrics don't really exist untilthey're meaningfully documented. Sadly, documenting your metricsis much less common than simply exposing them, perhaps because ittakes much more work.

At the best of times this forces system administrators and otherbystanders to reverse engineer your metrics from your system'ssource code or from programs that you


Phish spammers are apparently exploiting mailing list software

One of the interesting things I've observed recently through my sinkholeSMTP server is a small number of phish spams that have been sent to meby what is clearly mailing list software; the latest instance was sentby a Mailman installation, for example. Although I initially thought allthree of the emails I've spotted were all from one root cause, it turnsout that there are several different things apparently going on.

In one case, the phish spammer clearly seems to have compromised alegitimate machine with mailing list


Thinking about how to create flexible aggregations from causes

Every so often I have programming puzzles that I find frustrating, notso much because I can't solve them as such but because I feel thatthere must already be a solution for them if I could both formulatethe problem right and then use that formulation to search existingcollections of algorithms and such. Today's issue is a concreteproblem I am running into with NFS activity monitoring.

Suppose that you have a collection of specific event counters, whereyou know that userid W on machine X working against filesystem Y


Where your memory can be going with ZFS on Linux

If you're running ZFS on Linux, its memory use is probably at least a concern . At a high level, there are atleast three different places that your RAM may be being used orheld down with ZoL.

First, it may be in ZFS's ARC, which is the ZFS equivalent of the buffercache. A full discussion of what is included in the ARC and how youmeasure it and so on is well beyond the scope of this entry, but theshort summary is that the ARC


How /proc/slabinfo is not quite telling you what it looks like

The Linux kernel does a lot (although not all) of its interestinginternal memory allocations through a slab allocator . For quite a whileit's exposed per-type details of this process in /proc/slabinfo ;this is very handy to get an idea of just what in your kernel isusing up a bunch of memory. Today I was exploring this because Iwanted to look into ZFS on Linux's memory usage and wound up finding out that on modern Linuxes it's a little bitmisleading .


Simple web application environments and per-request state

One of the big divides in web programming environments (which aresomewhat broader than web frameworks) is between environments thatonly really have per-request state and every new request startsover with a blank slate and environments with state that persistsfrom request to request. CGI is the archetype of per-request state,but PHP is also famous for it. Many more advanced web environmentshave potential or actual shared state; sometimes this an explicitfeature of the environment over simpler ones.

(One example of a persistent state environment