Low-Overhead Linux Networking

I want to do more posts here that are quick roundups of interesting things I’ve read, rather than rambling commentary.

  • DPDK, the Data Plane Development Kit, permits a userspace application in Linux or BSD to bypass the kernel and directly interact with a network card. Handling interrupts to pass data from a 100 Gbps network card through the kernel apparently performs poorly.
  • Selectel’s “Introduction to DPDK: Architecture and Principles” looks like a detailed walkthrough of how it works. (I only skimmed it on the train tonight though.)
  • FD.io is a Linux Foundation project implementing a software dataplane employing vector packet processing (VPP). Its What is VPP? page is a good intro.
  • networking-vpp brings support to OpenStack networking.
  • Ligato and Contiv-VPP bring VPP to Kubernetes (et al.)
  • I’ve run up against mentions of YANG, which is “Yet Another Next Generation” DSL for modeling network data.
  • Intro to networking-vector packet processing is based on a 2018 FOSDEM talk. The Youtube video really helped things “click” for me.

2018 Camaro SS review

Last week, I had to have my car towed into the shop—and then from there to the dealership. (It felt sort of like when someone is taken by ambulance to a local hospital and then taken by medical helicopter to a larger hospital.) The dealership didn’t have any loaners, so they called Enterprise.

Now, Enterprise isn’t a bad company, and their cars aren’t necessarily undesirable, but no one bringing their car to a BMW dealership is hoping for an Enterprise rental. Like any other rental company, the car is always a little tin can that somehow doesn’t have GPS in 2018.

So imagine my surprise when they gave me the keys to this:

I didn’t know much about Camaros, but it turns out that, even more improbably for a rental car, this was one of the good ones, the Camaro 1SS with a V8 making 455 horsepower. Sitting in the driver’s seat with the Enterprise employee in the passenger’s seat as we completed paperwork, it was hard to contain my grin as I pushed the start button and the car let loose a throaty growl.

Once I filled out all the paperwork promising to treat the car gently and the Enterprise employee took off, I tried to at least leave the lot before doing all the things I said I wouldn’t. In my car, you need to give the pedal a fair bit of pressure when the light turns green. I almost think of it as slack in the pedal. Of course you don’t slam the pedal to the floor, but if you’re too ginger, people are going to start honking. Getting a heavy car rolling takes a bit of gas.

At first blush, the Camaro seemed the same. Give it a tiny little bit of gas, and the engine doesn’t deliver much power. So you do what I do in my car—give it a fair bit of pressure. And—oh shit!—that’s how I peeled out of the lot. With way more power than I expected, I let off on the gas in a panic, leaving me rolling through the intersection slowly and looking even more like I shouldn’t be trusted with this car. It didn’t take long to find a better balance, but it certainly wasn’t a great start.

Driving is a blast, though. It’s loud, and packs an awful lot of power. Whether it’s driving around town or passing a slowpoke on the highway, it doesn’t take much to get this thing going, and it’s hard to not have fun while doing it.

An interesting thing I discovered is that the car seems to shut down half of the cylinders when you’re cruising along at a steady speed, which is probably why the thing gets more than 20mpg:

(I don’t know who took this photo, but I’m sure they were on a dyno.)

But go to pass someone, and those extra cylinders come back in the blink of an eye. You’d never know they weren’t running if not for that screen showing it.

The specs show a 0-60 time of about 4 seconds. I didn’t dare try to run a timer while pinned to the back of my seat on the onramp, but I don’t doubt that number. I never got to the end of an onramp wanting for speed, but did often have to let off the gas long before the end because I had surpassed 80.

The ride wasn’t _un_comfortable, but you definitely felt every little bump in the road… And New England roads aren’t exactly smooth in early spring.


I had no trouble with headroom, but the car does sit quite low which probably helps. Audio controls on the steering wheel help you keep your eyes on the road, though I missed the volume controls my car had. The steering wheel felt like leather, imitation or not. The bottom of the steering wheel is squared off for reasons I don’t entirely follow; perhaps to help with legroom getting in. It was a little odd turning into sharp spaces where the steering wheel wasn’t round, but I tend towards shuffle steering so it didn’t come up too often.

A decently-sized LCD in the center console shows everything, from music to climate control settings. Climate control has dedicated hardware buttons, and adjusting temperature or fan speed is done by turning those huge center vents. An overlay on the LCD simply shows where they’re set. The screen has a slight downtilt which seems to prevent the glare that plagues my car’s center screen.

In the instrument panel, the tachometer and speedometer are both large analog meters. Their layout is the opposite of a BMW, but it’s not like it’s hard to figure out which is which. The gauges in the middle are digital displays styled to look like analog meters. A compass readout is front and center, and was just a tad distracting while turning.

The rearview mirror was adequate but remarkably small. At the same time, that also describes the rear window, so perhaps they’re paired well. Flipping the mirror to night mode is done by hand (soooo 2015!), and the button is recessed directly behind the OnStar button. Pressing the OnStar button by mistake makes a loud chime that will freak you out. (Ask me how I know.)

Visibility overall is poor. The front windshield is remarkably short, but gives an adequate view of the road ahead. Side visibility past 90 degrees, though, is atrocious. Trying to take a sharp left while watching for traffic from the right required crazy contortions with my head against the windshield to see past the passenger’s seat. You need to have your mirrors adjusted correctly in this, because peripheral vision is poor.

One review called the rear seats “vestigial,” which is the perfect word to describe them. I used them as a shelf to hold my umbrella. “Legroom” in the rear is comical; reaching to get my umbrella when it slid onto the floor, I didn’t have enough arm room to pick it up. Perhaps if the driver and front passenger have very short arms and legs and pull their seats way forward, you could seat four if the rear passengers were emaciated. I really can’t imagine when you could fit anyone in the back, unless they were maybe in a car seat. (And if you’ve got a toddler, I humbly submit that perhaps a Camaro isn’t the right car for you at this stage of your life.)

In short: having the Camaro for a weekend was a blast. And I certainly wouldn’t mind having one as an occasional fun thing to drive. But by the time my car had two functioning axles again on Monday, I was happy to get something more practical back. Visibility and comfort are surprisingly important.

Bulk-editing HTML files with images containing a # sign

A friend of mine recently pinged me with a problem he’s having. I wanted to share the problem and its solution, both because I hope it will help him and maybe others, and because my initial attempts at the problem were way more complicated than they needed to be.

The problem

My friend used some software to generate a whole bunch of HTML reports, and the reports contained images with names like “Project #1 – Blah/Image #1.jpg” or such. None of the images showed up.

He was savvy enough to recognize that the # (octothorp, pound sign, number sign, “hashtag symbol,” etc.) was the problem, but this was little comfort: with about 100 generated HTML files, each with six images, editing it all was perhaps an entire day’s work.

The problem is that the pound-sign is a special character in URLs, the fragment identifier. (I admit, I had to look up what it’s actually called.)

The over-engineered fix

What I struggled with was this: I could easily write a quick shell script to rename all the folders, and then mass-edit the HTML files. It would probably be 5-10 minutes of work.

What I couldn’t do easily, though, was write a Ruby (or whatnot) script without seeing the files and then get my friend to run it, on what I presume is a Windows computer without a Ruby interpreter. It’s one of those problems that I could very easily fix for myself, but communicating it or getting it to run for someone else is tremendously more complicated.

So I proposed that he just create a Zip file with the entire folder contents, including 600 images, and send it to me to fix.

This is a bad fix for two reasons. One, emailing 600 images is crazy. But two, there’s a much easier fix that hadn’t occurred to me.

Tech-savvy, non-programmer fix

Having suggested the above fix at first, I mulled over something else he said: this was one of those things he wasn’t sure how to even search for on Google, because he didn’t really know the terms. I think this is a problem we’ve all faced at one time. (For example, when I dropped a tiny little weird-shaped screw into my carpet and wanted to buy a replacement. If you have no idea what the thing is called, and I didn’t, finding it online will be even harder than finding it in your carpet.)

I wondered: what could you search for? I tried “how to bulk-edit HTML files” or something of the sort. It likely wouldn’t have gotten him the details he needed. But it helped me realize an easier fix!

There’s an easy way to bulk-edit text files, beyond writing a script to do it. And it’s something that programmers in particular should be familiar with: text editors.

And then something else occurred to me: you don’t actually need to rename the files! You just need to percent-encode the # in the URL!

So this suddenly becomes a much easier solution to relay.

  • Back up your work!
  • Download a free and reputable text editor. Notepad++ is highly-regarded on Windows, but I’m not a Windows user. I use Sublime Text on my Mac, and I still have a TextMate install as well.
  • Open the entire folder in the text editor.
  • Use the editor’s global search-and-replace / find-and-replace functionality. In Notepad++, it looks like it’s called Find in Files.
  • Make sure you really do have the project backed up; global search and replace on a project can be a real pain to undo if it goes wrong.
  • Search for # in all HTML files (*.html) and replace it with the percent-encoded representation, %23. This can look ugly: “Photos #1/pic.png” becomes “Photos %231/pic.png”. (The space should technically be %20, because a space is also a special character, but browsers are better about figuring that out.) Make sure “Replace all” or the equivalent is selected.
  • Ideally, test it in one file, save that file, and verify that the images now show up.
  • Let it roar through all of the files for you.

There’s one other risk worth noting, which is that the # sign could be used elsewhere in the file, particularly in its correct use as a fragment identifier, like if there was a link to different sections within the page. In that case, you would need to be slightly more selective in your search and replace, and this is where it gets gory. You’d need to find a search string that matches only the image URLs, make like “Photos #”, and then replace it with the same thing, but with the “#” changed to a “%23” — i.e., search for “Photos #” and replace it with “Photos %23”.

Towerspotting: Mt. Uncanoonuc

In what is apparently now a series, here’s another “Towerspotting” post. This time I traveled to Mt. Uncanoonuc in Goffstown, NH. (Months ago, actually.)

]2Mt. Uncanoonuc from drone

There are actually two Uncanoonucs, South Uncanoonuc and North Uncanoonuc. South Uncanoonuc, actually the shorter of the two (by 3 feet), stands at 1,321 feet. It is suggested that the word “uncanoonuc” may be from the the Massachusett word for “breast.”

Just a short bit outside of Manchester, the 1,321-foot summit has a height above average terrain (HAAT) of about 250 meters, or 820 feet, which perhaps explains why it’s home to much of the southern NH TV and radio stations.

The contents of the mountain are perhaps better revealed by a lower shot from when I took my drone up there earlier this fall:

]4Mt. Uncanoonuc towers

From left, we’re seeing:

  • WGIR-FM’s old tower, now used for backup
  • A tall Crown-Castle tower (red and white), home to WGIR-FM’s primary antenna system (out of frame; some cellular stuff is all you can see in this shot)
  • Immediately behind it and barely visible, a self-supporter that I think is owned by SBA; home to cellular, microwave, some some land-mobile stuff
  • WMUR-TV’s antenna and tower, also red and white.
  • An abandoned (?) tower, comparatively quite short
  • WMUR-TV’s old antenna/tower from the analog-to-DTV cutover; a microwave dish is mounted much lower
  • WZID-FM’s tower; the 3 lumps on the side are their FM bays, with the two smaller red ones on the side being their backup antenna (I think).
  • Just to the right of it, almost overlapping, is a commercial land-mobile tower
  • Dead center, another commercial land-mobile tower. This looks to be one of the taller sites, over 200 feet, but I’m not sure it actually has an ASR on file ???
  • To the right, the diminutive-looking WNEU-TV tower that’s actually cranking out 80 kW, the most powerful station up there by far.
  • A wide self-supporter that I believe is owned by the Town of Goffstown. There may be another land-mobile tower directly behind it; not sure
  • A very short tower with a few VHF fiberglass whips. The site is on a very small concrete pad and houses a doghouse-sized enclosure that is literally falling apart. Town records have it appraised at six figures.
  • At far-right, an Industrial Communications tower, which looks to be home to cellular and land-mobile stuff.

I’m about 95% sure on those. Corrections welcome!

Here’s another view, showing a few of the towers and looking over to North Uncanoonuc:

]6 North Uncanoonuc, viewed from South Uncanoonuc

Here is WZID’s tower:

(It’s far more likely that my camera was a little crooked than the tower having a lean…) The structures at the very top are simply lightning rods/dissipators. I’m not totally clear what’s up there, but I suspect that the 3 bays at top are their primary antenna system, with the two smaller ones on the left being a backup. The antennas are cross-polarized, to serve listeners whether their antennas are horizontal or vertical, and consequentially look a bit strange compared to your average antenna.

The round dishes are most likely 900 MHz studio-transmitter link antennas, feeding the broadcast audio.

WZID is licensed for 14.5 kW on 95.7, though FMpower suggests that this is probably maximum power for a Class B station based on HAAT.

And here’s WNEU-TV, a Univision station:

Walking around the top of the hill, each tower is surrounded by a barbed-wire or razor-wire fence, and also contains a transmitter building. WNEU’s is one of the only ones that makes a lot of noise, with a substantial HVAC system with giant fans. It made sense when I started looking up licenses, and found that they’re licensed for 80 kW output.

For comparison, here’s WMUR-TV:

They’re licensed for 6.5 kW.

And finally, WGIR-FM, whose antenna we were almost looking into on some of the drone shots:

They are licensed for 11.5 kW at 101.1 MHz, but, like WZID, it seems this is maximum legal power based on their height.

There is also some ham stuff up there, including a few DMR repeaters through DMR-MARC, and a 220 MHz link for the N1IMO repeater. At one time there was a 6-meter repeater as well, but it seems to have faded from the Internet and I’m not sure it’s still around.

Food Wishes / Steak Diane Recipe

I’ve been thinking for a while about trying to do a lot of short posts here with links to things I happen across that are interesting. Let’s see how long I can keep this up.

While in Portland earlier this month on a business trip, we went to a restaurant where I had the most incredible steak frites of my life. (The restaurant was La Moule, whose restaurant has the same optical-illusion wallpaper as their site.) It was served a la Diane, a term I’d never heard before.

Fast forward a bit, and I happened across the Food Wishes series on YouTube. They’re short and drew me in. This is a bad introductory one because it’s one of the more complex recipes I’ve seen of his, but it turns out that Chef John has a video on how to make Steak Diane!

Dipping My Toe in DMR

Because I’m always looking for an excuse to buy a new radio, I’ve been looking at the various VHF-and-up digital modes in use on the ham band. There are a multitude of them in use.

Going by New England Repeater Directory’s 2 meter page, here are the number of repeaters listed for each digital mode:

  • P25: 4
  • NXDN: 9
  • D-STAR: 23
  • C4FM: 24
  • DMR: 49

(To be clear, that is just on the 2-meter ham band in New England.)

Why DMR?

DMR drew my interest because it’s the most widely deployed in the region (NEDECN, etc.), by far. (More than the next two combined!) In part, this is probably because groups like NEDECN and EWARN, as well as the the international DMR-MARC group. They link up repeaters over the Internet (primarily, at least), making it a wide-area network. (This linking isn’t unique to DMR. It’s not even really relevant to DMR per se; it just happens that all or nearly all of the local DMR repeaters are linked. D-STAR repeaters are similarly configured from what I’ve seen.)

DMR is also interesting to me because it’s a two-slot TDMA system. Put more simply: in digitizing the user’s voice, it captures 60ms segments of voice from the microphone, converts them to digital format, and then transmits them in 30ms of airtime. Therefore, a single frequency can carry two conversations simultaneously. They’re dubbed slots, and many of the aforementioned ham repeaters will carry a local talkgroup on one slot and a larger-area one on the other. Users select which they want as if they were changing channels. (Another fun aspect of this: battery life is said to be improved about 40%, because the transmitter runs half as much.)

The other thing I think DMR has going for it is that it’s an open standard (ETSI) with a lot of commercial gear from a number of manufacturers. That serves to drive down cost a bit. DMR isn’t entirely unique here, but it seems to be the cheapest path.

As with some of the other digital modes, DMR supports things like one-to-one calls (though the operators of the networked ham repeaters ask that it not be used there) and sending of text messages / data.

So, I decided to jump in, and ordered a radio off eBay:

It’s a Motorola XPR 5550, VHF. Interestingly, it also has a dedicated GPS receiver built in.

I’m now onto my next challenge: obtaining the programming software (CPS) for the thing. Because it’s a commercial radio versus something targeted at hams, it’s not easily programmed. (FCC Part 90 regulations intentional forbid allowing users to enter their own frequencies, for example, since in many cases that would wreak havoc.) For some reason, Motorola insists on selling the software through Motorola Online (MOL), which requires that you request an account and wait days for it to be manually provisioned. They also, frustratingly, charge close to $300 for it.

The software is floating out there for illicit download, but I want to do this right. Also, this being a newer commercial rig, it only supports “narrowband” 12.5 kHz channel spacing out of the box. Ham radio has not narrowbanded, so this is undesirable. Motorola offers a free “entitlement” to enable legacy 25 kHz channel spacing, but getting it apparently requires an active CPS subscription.

So for now, this really slick digital radio sits on my desk, monitoring the pre-programmed 146.52 2-meter calling frequency, in analog FM. I can’t wait to get this to do a bit more!

Towerspotting: Georgetown, MA

Being a radio nerd who’s trying to spend more time outdoors, I’ve figured out a good way to kill two birds with one stone: hiking up hills with radio towers on them. Since the towers tend to be atop hills or mountains overlooking the surrounding community, they often have pretty scenic views.

Today was an almost completely cloudless day, so I decided to cross Baldpate Hill in Georgetown, MA off my list. (Note that the cover image on that page is not from Baldpate! I was disappointed.) I never did find the “fire road” on Spofford Street; I’m pretty sure it does not exist. The only way I’m aware of to get where I went—plainly the same place on the map as that site depicts—is via an access road on Baldpate Street just before Baldpate Hospital.

I expected a fairly scenic summit with panoramic views, but it was nothing of the sort. Baldpate has dense foliage, and lots of poison ivy that discourages you from venturing off-trail. (And by trail, I mean the dirt road.) Really all there is to see are a few towers and some plants.

I did pass this guy walking up the trail:

Backlit spider’s web

This Jack in the Pulpit blends in well, emulating poison ivy’s distinctive leaves a lot more closely than I realized:

Jack-in-the-Pulpit plant

Walking up the access road, the first thing you come to is a grassy clearing with a couple large water towers:

Water towers atop Baldpate Hill

At the top of the hill, you come to a fire tower:

A fire tower atop Baldpate Hill converted into a cell tower.

At least, it was a fire tower. It’s now fenced in and loaded up with cellular antennas. I should have grabbed a picture of the feedline; though I knew they used low-loss coax due to the high frequency and low-power handsets they’re trying to receive, I guess I never really appreciated multi-inch-thick coax until I saw it in person.

Between the “fire tower” and the water towers lies the communications tower. It’s about 250′ tall, and posted as ASR 1004094.

ASR 1004094, an 80m tall tower atop Baldpate Hill in Georgetown.

The tower is listed as being owned by New Hampshire Public Broadcasting, which is odd because, as far as I can tell, they have no presence on the tower. It looks like it’s just cellular, land-mobile, and microwave.

Some licenses near the top of the tower list a height above average terrain (HAAT) of about 450′, so the hilltop itself must be about 200′ above average terrain. With the tree cover, though, there’s nothing really to see. I do wonder what the views from the fire tower would be like if it were open.

Playing with the excellent Radio Mobile Online, here are projected coverage maps from the site. There are, tragically, no ham repeaters up there to the best of my knowledge, but here’s what coverage would look like.

Both maps are based on being almost at the top of the tower (80 meters), 30W out of the transmitter, 1.5 dB loss, and 6 dBi antenna gain, for about 85W ERP. Modeled for 70% reliability.

446 MHz:

And here’s 146 MHz:

There are, in fact, no 2m of 70cm ham repeaters in Georgetown at all, according to the New England Repeater Directory.

Much of the stuff actually on the tower appears to be T-band and 900 MHz SMR/LMR, though a lot of it is licensed for 300W – 1kW ERP. Other tenants, according to the FCC database, include Georgetown and Boxford public safety, Northeast CMED, an ambulance provider, and a few others.

BTW: I failed to bring my “real” camera along, but was pleasantly surprised by what the iPhone camera could do. I used Photoshop to lighten up the shadows on the tower photos, but otherwise these are straight out of a cameraphone.

Understanding pepper (OC) spray ratings

Pepper spray has been legal in Massachusetts without any sort of permit required for a few years now. It’s also known as OC spray, from the extracted oleoresin capsicum, being an oleoresin formed from capsicum, the ingredient that makes hot peppers spicy.

I recently picked some up, and would like to share a few things I’ve learned.

Where to buy pepper spray

Finding pepper spray in MA can be hard. I’ve seen it in lots of places across the border in New Hampshire, but it’s hard to find in Massachusetts. Making it worse, shipping it to Massachusetts is either prohibited, or thought by online merchants like Amazon to be prohibited. I ended up picking mine up in a sporting/gun shop.

Why all the numbers are meaningless

But here’s the part that really trips me up: the ratings. The spray I purchased is listed as “10% OC (2 million SHU).” Intuitively, I assumed this meant that it was 10% of the maximum strength possible. (If 10% is 2 million SHU, the maximum must be 20 million SHU.) But this is totally wrong! The SHU rating or the percentage alone are meaningless numbers.

What this actually means is this:

  • The solution in the canister is 10% oleoresin capsicum, and 90% other stuff (inert ingredients). If this number were 100%, I assume it would be a sticky goop that you couldn’t spray, so it’s necessary that a decent percentage of the contents be something like water or propylene glycol.
  • The OC that’s in the spray is rated at 2 million Scoville heat units (SHU).

As an analogy: you have a rum and Coke, which is about 25% rum and 75% Coke. The rum used is 80-proof, or 40% alcohol. If your goal is to get drunk, neither of those metrics is meaningful on its own. 25% rum doesn’t necessarily tell you how strong the alcohol is, and “The rum in this Coke is 100 proof!” isn’t good news if they only put a dollop of it in your drink. What you’d actually want to know is the total amount of alcohol.

The same is true of OC spray. Sabre, one manufacturer of pepper spray, has a blog post explaining that you need to consider the product of the two numbers, known as the percentage of Major Capsaicinoids, or MC. The same math is discussed in a number of places; the Sabre blog post is just the first place I saw the math given a name.

Pure capsaicin is 16 million Scoville heat units. So if the oleoresin capsicum in my canister of pepper spray is 2 million SHU, it’s 2/16 = 12.5% of the maximum strength.

But only 10% of the canister is OC, so it’s 12.5% × 10% = 1.25% MC. (Well, the Sabre article uses the same starting numbers to arrive at 1.33%. I’ll assume that I’m the one that’s off on the math.)

A competing product is marketed as 6% and 3 million SHU. That’s 18.7% × 6% = 1.122% MC. Other sources have higher SHU ratings at lower percentages. This all gets very confusing, because manufacturers seem to just decide whether they want to market their product on having a high-percentage of OC, or on a high SHU number. You need to compare the total percentage of capsicum if you want to do any sort of meaningful comparison.


If you’re going to carry pepper spray, you would probably do well to also carry something like these decontamination wipes to help alleviate the effects, in case you end up getting some of the spray as well. (There are a few other products linked from there as well. Having never used any of them, I can’t recommend one over the other. All I can say is that Sudecon wipes fit in my glovebox nicely.)

Related compounds (science nerds take note!)

As mentioned above, the “active ingredient” in hot peppers is capsaicin. Pure capsaicin is 16 million Scoville heat units. The hottest pepper is the Carolina Reaper, around 1.5 million SHU. (You should definitely not vape it.)

However, capsaicin isn’t the hottest compound. That honor appears to belong to something even tougher to pronounce, Resiniferatoxin. Found naturally in a plant known as Euphorbia poissonii (what could be scary about a plant whose Latin name is poissonii?), Wikipedia writes that it “causes severe burning pain in sub-microgram (less than 1/1,000,000th of a gram) quantities when ingested orally.”

All of these compounds seem to act on a receptor in the body known as TRPV1, which controls body temperature and “provides a sensation of scalding heat and pain.” There’s also a compound known as capsazepine which inhibits the TRPV1 channel, effectively blocking the effects of capsaicin and its ilk. I’m yet to see it being marketed as an antidote to pepper spray, though.

Running on new hardware

I’ve just completed a server move, and the site should be back in business.

The old setup was a beefy server in my basement with 24GB RAM and eight cores. But access was via a jenky IPv6 connection over my cable modem, with external access via a varnish instance running at Digital Ocean. Something in my home network configuration causes that to be extremely unreliable, taking the site offline for days.

It’s now running on an AWS instance, which I hope to make an auto-scaling group. Actual content resides on an EFS volume, which is surprisingly performant. And it’s all behind a new application-style ELB, which also supports HTTPS and HTTP/2.

For now, I am using neither varnish nor a CDN, to see how it goes. Access is directly to the ELB, with every page hitting Apache. WP Super Cache should keep things pretty performant with any luck.