Packet Disarray

Despatches from longb4

MP3 CDs in a 2005 Hyundai Tucson

In a cross-functional research opportunity blending music, computer science, and archaeology, I recently set out to burn some MP3 CDs for the 2005 Hyundai Tucson I’m driving at the moment. (Yes, right now!) Actually, I’m waiting for my Gordon Lightfoot discography to transcode, so I’m writing this up for the next time I search for it.

This now-ancient vehicle is kind of in the anti-sweet-spot for technology: it’s new enough to play CDs and “”“support”“” CDs burned as MP3 data files rather than CDDA (Redbook) audio, but not new enough to have an aux input or Bluetooth. Worse, burning arbitrary MP3s may not work, as I found out after I transcoded and burnt all my favorite Kanye albums on one disc with the command in this Stack Exchange answer (spoiler alert: didn’t work).

Instead, what worked for me was a variant on this Stack Exchange answer, where I did the FLAC decoding and LAME encoding in separate steps, to intentionally strip any tags. I’m not sure whether my original issue was extra metadata, variable bitrate encoding, or any extra streams ffmpeg could have been putting in the files and thereby confusing my elderly steed.

Supposing I’m in a directory called Gordon Lightfoot with album directories of FLACs, this is what worked for me:

for thing in */*.flac; do
    echo "$thing" "${thing%flac}wav"  # Cool filename substitution!
    flac -d -o "${thing%flac}wav" "$thing"  # Decode FLAC
    lame -b 256 "${thing%flac}wav" "${thing%flac}mp3"  # Encode 256k CBR MP3

Then, I just burnt them in directories on a single-session (mastered) CD-R with the native OSX CD burning tool.

FreeBSD 10 PVHVM on Xen

FreeBSD 10 changed the supported Xen configurations, notably providing Xen support by default in GENERIC using PVHVM mode. Previously, I’d been using FreeBSD 9 (i386) using a XEN kernel and PV mode, which is deprecated in FreeBSD 10. (If you need a refresher on Xen modes, I highly recommend the article Xen Modes: What Color Is Your Xen.)

There is a fairly established procedure that I tend to follow when setting up FreeBSD PV domUs, but it was difficult to find a guide on setting up PVHVM domUs on my current stack of open-source Xen (4.1) on Debian old-stable (7) using the xm toolchain. Well, here it is.

Setting Up Passphrase-protected SSH Keys Without Repetitive Typing

I’ve recently begun exploring Ansible, which is a Python-based configuration management and orchestration system that uses ssh (when in unix land). As one can imagine, typing your password for every connection to each server gets tedious. The solution to this problem is not to use simpler passwords!

Cisco Web Authentication Login Page MIME Type Restrictions

I co-wrangle a few Cisco wireless LAN controllers (WLCs) that manage a variety of SSIDs, including some that authenticate users on a landing page. Webauth pages are in an interesting niche: they’re among the pages many users see daily, and yet their design quality does not tend to be proportional to their prominence. That shouldn’t be a surprise — the set intersection of Cisco wizards and web frontend designers is pretty small.

I’m not a Cisco wizard — but I could play one on TV, and somehow it has fallen to me to breathe new life into campus webauth landing pages. I wanted to use responsive design for optimal performance across phones, tablets, and computers, and images in SVG format that would look delightful at all zoom levels and pixel densities. My landing pages worked perfectly as served from an nginx testing server, but SVG logos failed to appear when uploaded as part of a webauth bundle and served on a testing SSID on the WLCs.

Sorttable.js Not Sorting Dynamically-created Tables

At work, I’ve recently been building a web-based tool that aggregates information about network devices from a variety of sources, and allows searching based on given criteria. The js/html frontend communicates with a python backend via ajax requests. Having some experience with it in the past, I decided to use sorttable.js for sorting data by column.

Sorttable.js has an easy way to make a table sortable after dynamically adding it via DOM calls. Despite this, my table still wasn’t sorting anything when I clicked on column headers. I was adding new table rows with (paraphrased) document.getElementById('tableId').appendChild('someTrElem'), and they were showing up in the table, but none of the table headers had events listening even after calling sorttable.makeSortable.

Eventually, through exploring with my favorite DOM inspector, I discovered that all my table rows containing data had somehow been added as children of my <thead>, as opposed to the <tbody> I had also created. Once I started explicitly adding my new <tr>s to my <tbody> rather than the <table>, I was finally able to sort the table.

IPv6 Timeouts on FreeBSD With PF

After migrating my public-facing cloud servers to shiny new FreeBSD VMs on DigitalOcean, I was somewhat disturbed by the long delays or timeouts I experienced when initiating connections to certain hosts, such as and This would happen during the DNS lookup phase. The issue was not related to a single DNS server, or even to DNS lookups in general — when I manually did (for example) dig @, I got results immediately. However, when I removed DO’s two default IPv6 nameservers in resolv.conf, problematic lookups sped up, but they were still slow. I had enabled IPv6 when setting up the VMs, and I was using my trusty old pf.conf. Here’s an excerpt:

# (Setting up interfaces, macros, etc)
# ...

block log

pass out all keep state

pass in on $ext_if proto icmp

# (Allowing traffic to certain ports)
# ...


In early 2012, between when I applied for colleges and when I accepted one of them, I was invited to apply for a scholarship and mentoring program at WWU for women in computer science and math. Now, having been part of that program for a couple years and already fairly close to graduating, I’m overwhelmingly thankful for the opportunities it’s given me.

These were my answers to the questions I was asked when I applied.

Bus Error on FreeBSD With Sudo and LDAP

Today in weird ungoogleable errors:

[longb4@host ~]$ sudo ls
bar     baz     foo
Bus error
[longb4@host ~]$ echo $?

Wat. [1]

This was on FreeBSD 10.0-RELEASE (amd64), after executing what I thought would be a routine pkg upgrade. The pkgs that were thusly upgraded had been built in a Poudriere bulk build just moments before. I was logged in as an LDAP user (via pam_ldap, nss_ldap, and openldap-client) and using bash as my shell. New SSH logins to LDAP users still worked and sudoers could still sudo, so I knew at least that PAM, the LDAP client, and sudo weren’t completely hosed. Other commands I tried worked as expected — the misbehavior only manifested when I ran sudo.

Puppet Errors on FreeBSD: Uninitialized Class Variable @@lock in Object

I was vexed by this error when setting up a host with Puppet 3.6.2 on FreeBSD 9.2 recently:

Error: Could not set 'present' on ensure: uninitialized class variable @@lock in Object at 52:/usr/local/etc/puppet/modules/ldap/manifests/init.pp
Error: Could not set 'present' on ensure: uninitialized class variable @@lock in Object at 52:/usr/local/etc/puppet/modules/ldap/manifests/init.pp
Wrapped exception:
uninitialized class variable @@lock in Object
Error: /Stage[main]/Ldap/Package[net/nss_ldap]/ensure: change from absent to present failed: Could not set 'present' on ensure: uninitialized class variable @@lock in Object at 52:/usr/local/etc/puppet/modules/ldap/manifests/init.pp

The line it referred to was trying to install the net/nss_ldap package. I had run pkg2ng on the host and included the pkgng module in the node’s manifest.

Extending LVM Volume Size

I use LVM to manage virtual disks on my Xen hypervisor. It’s mostly “set it and forget it”, but occasionally, the virtual disks get close to filling up. (Monitoring this with Nagios gives me plenty of warning!) When I’d rather not go through the filesystems and choose what to delete, or when I’ve already done that and they’re still too full, it’s really convenient to be able to just extend the disk. For this reason, I try to keep at least 1 TB of space unallocated on my hypervisor’s main LVM volume group.


Let’s say I want to extend a 500 GB LV, which shows up as /dev/xvda5 on a virtual machine called guest. This LV is called storage on a hypervisor called host, and storage lives on a VG called hard-disk. I want to extend storage’s size to 750 GB.