Serialization Format Performance

Posted Sun 31 January 2016 11:53 under category programming

Most of the work done in actual programming jobs is taking structured data in some particular format from one system, slightly tweaking it, and sending it off to some other system. When exchanging data between different processes, it's almost always necessary to serialize it into a series of bytes which can be sent across a dumb byte-oriented transport (such as TCP). There are hundreds upon hundreds of different serialization formats out there, but I just wanted to talk about a few of the most common that folks use with the Python programming language.

read more

<3 sed

Posted Fri 27 April 2012 17:41 under category tech

I wrote a fun sed script today:

sed -E -n -e ':t ; s/(.{21})(.*)/\\bf\{\1\}\n\2/ ; p ; s/\\bf\{(.*)\}\n.*/\1/ ; h ; :q { n ; G ; s/(.{21})(.*)\n\1/\2/ ; tp ; s/(.+)\n.*/\1/ ; bt} ; :p { P ; bq }'

Short, but effective. Can you figure out what it does?

(solution after the break)

read more

*nix Tip of the Day: Waiting in Scripts

Posted Sat 04 December 2010 16:22 under category tips

Scripting is what makes Unix-like operating systems great. Every *nix, be it Linux, BSD, OS X, AIX, Solaris, or whatever other random distribution you can come up with, comes with a capable shell (or three) and a good set of basic utilities. Where a Windows administrator has to either fall to the horror that is Batch files, write code in a big, heavy programming language language, or submit to the terrible dominance of “management utilities”, a Unix system administrator has tons of the tools at his disposal to fix and automate things. I could talk about scripting forever (it is a substantial portion of my job), but today I'm just going to talk about one small facet: waiting for things to happen.

read more


Posted Sun 17 October 2010 23:27 under category tech

Brief post. I decided to actually use Github once in a while now (not in the least because I use it for open-source stuff at work). My page is up at, and the work account which I'm a contributor on is at So, uh, feel free to comment on or improve any code that you see thereabouts.

Also, I am thinking about doing a series on git on this blog, since I get to use it rather quite a lot now, and there definitely aren't enough guides to it on the Internet ...

read more


Posted Wed 21 April 2010 01:17 under category programming

wamupd 0.1.2 is now available at (or via git, if you prefer). It fixes some TXT-related bugs filed by @daagaak. As usual, to learn about the project you can visit the wamupd page.

read more

dnsextd, TCP, and IPv6

Posted Tue 02 March 2010 17:45 under category programming

Hello interested parties. dnsextd (in my git repository) now supports TCP. It was actually sort of an amusing bug. I guess the dnsextd code must date back to PowerPC, because it had an extra ntoh call which on little-endian systems would cause TCP requests to fail. It's fixed in the "tcp" branch of my git repository. In case you're curious as to how to get that repository, you would use the following:

% git clone
% cd mDNSResponder-214
% git branch --track tcp origin/tcp
% git checkout tcp

If you need more setup help ...

read more