Posts Tagged "code"

Serialization Format Performance

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

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

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

Github

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 github.com/Roguelazer, and the work account which I'm a contributor on is at github.com/Yelp. 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 yet. Yes …

read more

wamupd-0.1.2

wamupd 0.1.2 is now available at //files.roguelazer.com/projects/wamupd/wamupd-0.1.2.tar.bz2 (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

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 //files.roguelazer.com/projects/mDNSResponder-214.git
% cd mDNSResponder-214
% git branch --track tcp origin/tcp
% git checkout tcp

If you need more setup help, Dynamic DNS: Part …

read more