Hi, I'm Brandon Thomson. Welcome to my little corner of the Internet.

Let me begin with a serious subject. I think the future is likely to be different than many people expect. Because there is going to be increasing scarcity of critical resources like petroleum and fresh water, most of us will have no choice but to learn to live with less than we are used to.

These concerns are one reason why I do not own a car, even though I live on the outskirts of suburbia where most would currently consider car ownership to be required. The way I see it: if most of us are going to be forced to get by without a personal automobile in the future, then why not get started now?

Motorized transport obviously isn't going away completely, but I am still fond of the bicycle. Bicycles do not require fuel, they are easy to maintain, and I need the exercise anyway!

Here in Gainesville VA the infrastructure is not set up very well for bicycling, but it's still doable. Check out this video I recorded in 2013:

As of 2015 I go out at least weekly for groceries, including during the winter months.

Contacting Me

Send email to bt@brandonthomson.com.

I enjoy receiving feedback from visitors to this site, and I reply to most personal email I receive.

Any questions or comments you might have about material found here are quite welcome. At the least, I will respond to thank you for taking the time to share your comment with me.

It usually takes me at least a few days to reply to email, but if you do not receive a reply within 10 days then it is possible that I did not receive your message. Here are some reasons why that may occur.

You can also find me at: Github, Youtube.

Golang Software

I do most of my software development work in the Go language, which I highly recommend. Here are some of my open-source golang packages:

HTTPS Support Available

This site is available over encrypted HTTPS. While HTTP access will always remain available, using HTTPS can help decrease the odds that this site has been modified by your ISP or by a malicious third party before being delivered to your web browser.

I'm not fully convinced that HTTPS as it's implemented in modern browsers is a good thing to promote, but in this case I have decided to enable it. I don't have full control over the servers this site is hosted on, though, so you should not rely on HTTPS to prove that this content was really authored by me (and not by a malicious third party).

Click here to reload this page over https.

Projects I Like

mplayer2 LaTeX Perfect
vimus xmonad Rockbox youtube‑dl PRISM‑Break chromium Sabbath
ZFS Solarized Closure
Go SuperMemo EFF FreeBSD Remind Erowid DuckDuckGo mpd Vim Dungeon
Newsbeuter Click‑Stand Deshaker feh

Although some of these are commercial ventures, no consideration of any kind was provided in exchange for the links. In addition, I provide these links because I like these projects and I want to promote them. It is not my intention to imply that I am affiliated with any of these projects in any way, because I am not.

Why You Should Have Your Own Domain Name (Permalink)

Every now and then you see a post on Reddit or Hacker News from someone who has lost access to their @gmail.com email account. The post then continues for a few paragraphs about the huge amount of grief this has caused this person.

Don’t let this be you. There are three simple steps you can take today to reduce the impact of events like this:

  1. Buy a domain name. You know, like brandonthomson.com. They cost about $10/year.
  2. Spend a few more bucks to get email service for the domain.
  3. Forward your old email to yourname@yourdomain.com. Start giving out your new address.

Done. All of this takes about 15 minutes, and puts you in much better shape than you were with your @gmail.com address.

I used to recommend that people use Google Apps for email on their domain because it was free, but as of 2014 it is no longer free. There are better choices and Google is no longer competitive on price or features. If you are a programmer, I also recommend looking for a service which supports Sieve scripts for easy and maintainable mail filtering.

Some people might wonder, isn’t it smarter to just use your ISP’s email service? Well, maybe. I would say yes only if the ISP lets you use you own domain. But if all you can get is an @comcast.net address, forget it.

It used to be that when an ISP provided an email account with internet access, they were providing a helpful service. But now that reliable email costs at most a few dollars per year, ISP email accounts have become a clever form of vendor lock-in. Think about it: Comcast certainly knows that if you have an @comcast.net email address, you’re going to be less likely to switch to Verizon because of the additional headache it will cause. Don’t be one of the millions who fall for this trick: get an @yourdomain.com email address and change ISPs at will.

So far I’ve only talked about email, but all the same ideas apply to web services. You want to put as much of your content as you can on yourname.com, not yourname.blogspot.com or yourname.wordpress.org or facebook.com/yourname. The bottom line is this: if something is not hosted on your own domain name, you don’t really control it. You are like a serf serving on the fiefdom of a distant master, who may change the terms of your service at his whim. A domain name costs practically nothing and gives you so much more control over your web presence and your email that the only reasons people choose not to use them are either ignorance or severe laziness.

Well, we’ve solved the ignorance problem. Now you know! I can’t help you with the laziness, but I can suggest you take a couple of minutes today and get this stuff taken care of. It’s worth it!

Why You Should Use Rockbox (Permalink)

In the 21st century, a portable digital audio player (DAP) is one of the few good ways to stay informed about world events.

Many people use their cell phone as an audio player. I prefer not to carry a cell phone when all I need is an audio player, because:

These drawbacks can be solved (or at least made less severe) by simply using a dedicated DAP instead.

Once you’ve decided to get a dedicated DAP, you’ll want to learn about Rockbox, a custom firmware which can be loaded onto a variety of DAP devices. Rockbox adds a ton of features to each device, and, perhaps more importantly only needs to be learned once. After you’ve learned the interface, switching to a new DAP model will not require any re-learning because it will still be the same old Rockbox.

Before you can decide which DAP to buy you’ll want to look at the list of supported devices. The ideal player is supported by Rockbox, has an SDHC/SDXC-compatible card slot for future storage upgrades (some players which only support SD in the stock firmware support SDHC in Rockbox), and uses standard AA or AAA rechargeable cells1. An old-school monochrome reflective LCD display should be preferred since it can be read in most conditions without wasting the energy for a backlight. Display resolution is relatively unimportant because Rockbox can be configured to use tiny fonts so that you can get a lot of mileage out of a few pixels; commercial audio players often use gigantic non-configurable fonts which make it annoying to navigate.

Commercial interests would prefer that you buy a new portable audio player every couple of years but there’s no good reason to do so as the technology has been more or less perfected at this point. It would be better for everyone if we could step off the hype train for a minute and start building hardware to last for the long haul (instead of planning in advance to send it to the landfill every 24-36 months), but I digress.

Factors besides these aren’t nearly as important.

Unfortunately as of early 2012 I think you can only find any 2 out of 3 of these features in new products (some discontinued models have all 3, but you’d have to buy one used).

Widely available dual portable charger/power-sources which accept AA cells and output regulated USB 5V may help you get more life out of an old player with a dying custom-fit lithium ion battery (don’t buy a “new” battery since you’re likely to get old stock that’s been sitting on a shelf for years). You may even be able to remove the internal battery and run the player directly from the external power source to help avoid charging losses. These devices can be had for less than $20 although finding a quality one can be challenging. Apparently short circuits and melting are not unheard of.

If your player lives on a shelf, efficient switch-mode power supplies with a USB connector are pretty cheap these days and handy because they are compatible with lots of devices. Be careful, though: more cheap junk than ever is being sold online and you should always verify UL certification on anything plugged into your mains if you want to avoid nasty surprises.


1. Replaceable, standardized batteries have many advantages over custom-fit lithium ions. For one, you can carry a spare set and replace them in order to return the device to full charge instantly. For another, they can be cheaply replaced at end-of-life without needing to replace the player. The "gumstick" battery size is more space-efficient than AAA or AA due to its square shape, but is also less common and probably not desirable for that reason. Unfortunately, standard batteries are typically larger and heavier than custom-fit lithium ions of equivalent capacity.

Dvorak, or Why I Learned to Love the Status Quo (Permalink)

Legend has it that the standard QWERTY keyboard layout we all know and love was designed to slow typists down so they wouldn’t jam up the keys on old typewriters with long levers. True? Who knows. In the modern era we have an alternative in the Dvorak layout, developed in 1936 by a guy named (you guessed it) Dvorak. Supposedly he studied common English texts and assigned letters proper positions based on their frequency, thus saving us all many many miles of finger travel, if only we would use it.

Sounds reasonable, right? I certainly thought so.

I used a Dvorak keyboard layout for more than seven years. It was fun and liberating in the beginning. Not only was there the sense that I was cooler than everyone else, but I invariably got to enjoy a humorous little moment whenever someone tried to type something on my machine (alternate keyboard layouts are very rare in this country and almost always elict profound confusion). “Having a little trouble there? Oh, ha ha, let me help you with that.” That was always entertaining.

Truth is, though, I never typed any faster with Dvorak. I’ve always been around a 60wpm typist when I’m trying, and it was generally the same after a month or two of full-time Dvorak use.

The biggest difference with Dvorak was how comfortable it was for normal English sentences. It’s hard to explain how a keyboard could be more “comfortable” to someone who’s never tried an alternative layout, but basically there’s less stress on your fingers because they don’t have to move as far. Typing feels very fluid with Dvorak; QWERTY is just frenetic by comparison.

You’re probably wondering why I switched back after seven years. It’s true that it was annoying to need to learn how to change a keyboard layout every time I used a new operating system (Windows, Mac Classic, Mac OS X, FreeBSD, Linux, I knew how to do it everywhere), but it was certainly doable.

But no, the real problem is that if you do not control the machine, you cannot change the layout.

Back when I was attending a university I was embarrassed to look like a computer novice in front of the other students whenever I needed to use a public terminal. I had to revert to hunt-and-peck because the keyboard layout was not changeable (and for good reason, I suppose). I don’t much mind looking stupid, but it does get old explaining to people why you cannot in fact type on a standard keyboard.

The issue became more serious when I needed to use locked-down Windows and Solaris systems to take exams. Typing speed was essential and it just wasn’t possible for a mere user to change the keyboard layout. You could say the school deserves blame for failing to allow this, but didn’t I deserve more blame for being a weirdo? Anyone who considers using Dvorak should know that any time you take a computerized test like the GRE, you can bet you won’t be able to change the layout.

The other big problem with Dvorak is that programming languages and keyboard shortcuts are almost invariably designed around a QWERTY layout. Ctrl-C and Ctrl-V? Not exactly convenient in a Dvorak layout. Linux commands like ‘ls’ which are easy to type in QWERTY are more painful in Dvorak. These things are more important and annoying than you might imagine unless you have used Dvorak for a long time. It also wasn’t uncommon to find software, especially full-screen games, which ignored the system keyboard layout and assumed I wanted QWERTY. Flash games that used the keyboard were usually pretty awful too.

I wasn’t a Vim user at the time, but I doubt Vim with Dvorak is as nice as Vim with QWERTY. Sure, some users have written little hacks that change the keys around to make it more usable, but I bet there are plugin incompatibilities, problems, and stupid annoyances that come because it’s just not a popular configuration.

I loved Dvorak for all its merits, but I’ve also learned the value of adhering to a flawed standard. I suspect I won’t be switching back.

Single-Page Sites (Permalink)

In an era where many (most?) people have broadband and high-speed high-latency satellite Internet is becoming more common, I’m not sure it makes sense for small personal sites like this one to have multiple “pages” anymore. Browser vendors are gradually hacking around the inefficiencies of the HTTP protocol with prefetching and pipelining, but while we’re waiting, this site aims to be as fast as possible without sacrificing usability or backwards-compatibility.

Serving all your content as a single HTML file has some interesting advantages. For starters, anyone who wants an offline copy of the entire site can create one instantly using the “Save as…” feature in every browser. Modern browsers and computers can handle enormous HTML documents (especially when no complex style rules are used), so document size isn’t a big issue.

Another benefit: content is more “discoverable” than on a traditional multi-page site since users can just scroll down to find it all rather than having to step through a hierarchy of links. Of course we still have links here, but they mostly scroll the page or go offsite. Zero-latency local link handling should be refreshing for satellite Internet users! Want to search for something? Forget about Google, Ctrl-F is all you need.

Getting the links right is a little tricky. If you want users to see the content they expect quickly, inbound hash links are a no-no. An inbound hash link to content half way down the page requires people to wait for a mountain of content they don’t care about to finish loading before they can see what they were interested in, a situation that is especially problematic for dial-up users.

The URL hash isn’t sent to the server so there’s no way to rearrange desired content to the top if you rely on inbound hash links, either.

The solution is to use hybrid links: plan for incoming links to be normal URLs so the server can put the requested content at the top of the page. Use hash links in the served HTML for clients that don’t support Javascript, but replace them with normal URLs in Javascript for advanced clients so that “Copy Link Location” gets a proper inbound link instead of a hash link. Finally, use Javascript onclick handlers to do local navigation using hashes, but also replace the text in the location bar with an external URL using the HTML5 History API so that it has a correct external URL if it is copied.

I know, it’s a bit confusing and I didn’t do a great job of explaining it. But if you look at the HTML source of this site and observe how the links behave it should be pretty easy to figure out what’s going on.

This solution works pretty well. Browsers pre-emptively render while content is streaming so low-bandwidth users who load the site without a fragment link still see what they were expecting quickly even though the total content size is very large. If they leave before the whole site is finished loading, oh well, no harm done.

Mobile browsers are another issue entirely: users of such browsers often have small bandwidth caps and would probably appreciate having their bandwidth conserved. I never use such devices so I admit being a bit biased against them.

There are some disadvantages, to be sure: non-technical people won’t necessarily understand what permalink means and can inadvertently share links that load the wrong part of your page. Technical users usually get the idea but can get confused at first since the technique is uncommon.

If you care about “SEO” or are trying to maximize ad revenue you obviously shouldn’t touch this technique with a ten-foot pole. But those sorts of sites usually aren’t all that user-friendly anyway. We’re trying to maximize user-friendliness here.

I’m not sure whether or how much search engines punish sites that design pages this way. I know they must have some way of dealing with duplicate content on multiple pages because most of the popular blogging software replicates content onto a home page, category pages, etc. It’d be nice if there was some standard to tell them, “Hey, ignore this content on this page,” but I’m not aware of any such standard.

Anyway, I’ll keep an eye on it and update this section if I get more data.

Anyway, those are some of the reasons this site has been constructed as a single “page.” If you’re a technical person thinking about setting up a site I recommend giving it a try.

Computer Languages (Permalink)

These days I usually reach for Go whenever I need something more complex than can reasonably be done in sh. It is fast enough for almost every task, comes with a great standard library, and has an engineering-oriented design philosophy (in other words, it is concerned almost entirely with practical matters for programmers and is of very little interest to academics).

Unlike many other languages, Go’s feature set is intentionally kept rather limited. This sometimes annoys those of us who like to geek out with language features, but also limits Go’s bloat, keeps its compilers fast, and reduces its learning curve.

This site is served by Appengine Go.

In college Python was my favorite language. I liked the apparent simplicity and speed with which programs could be written. Go has now replaced Python as my first choice for all new projects. Why? Many short programs can be written more quickly in Python than in Go. However, I think Go “scales up” much better than Python does. Both for large programs and programs which will be maintained over long periods of time, Go is clearly superior. And since it’s hard to tell in advance whether any given program is going to remain small or grow over time, I find it’s easier to just write everything in Go from the beginning.

Python has a lot of perks I miss in Go. List comprehensions are probably numero uno, followed by autocompletion in the REPL when parsing XML files or working with unfamiliar APIs1.

I used to try to avoid shell scripts in favor of Go, but since I’ve started working more closely with FreeBSD I’ve come to appreciate shell scripting much more. When you’re working in the right kind of problem domain shell scripts can be much more readable and concise than Go code, and of course they are also several orders of magnitude smaller in file size. Often file size is more important than execution speed.

I know enough Haskell to keep my xmonad.hs up to date (read: not much). Haskell is fun to play with, but after puzzling over a few of ghc’s legendary 5-page error reports resulting from changing just a single character in my otherwise-working xmonad.hs file, I’ve decided not to use it for any serious work.

I use JavaScript because it’s mostly the only choice if you want to write web apps, but I’m not a big fan of the language. I am never excited to write JavaScript like I am to write Go. When I write webapps, I try to put as much of the logic as I can serverside (where I can use Go) and use Javascript for only trivial things.

Javascript is more tolerable if you can use ECMAScript 5 features. If you can’t (maybe for compatibility with old web browsers), Closure makes it bearable, sortof. Although Closure itself is very technically impressive, I find the end result is still a bit clunky because of the inherent complexity of what it does. Maybe Dart will be a better solution in the long term, but I’m not holding my breath.


1. I suspect we'll have similar functionality for Go eventually. Some folks have made promising progress with a edit-compile-run loop which can be almost as fast as a REPL for small programs.

Can you connect LED strip lights to your computer PSU? (Permalink)

Got a 12v LED light strip? Wondering if you can hook that up to your computer? Doing so almost certainly violates some electrical codes and also good common sense, but yes, it will technically work. It’s also pretty damn convenient for, say, putting bias lighting behind or around your monitor since it will always turn on and off with the computer and you needn’t ever bother with a switch1.

The real thing you want to avoid here is accidentally starting a fire. Unfortunately, it’s possible: a not-quite-ground fault which develops in the led strip or wiring which has high enough resistance to avoid triggering the PSU’s short-circuit and over-current protection but low enough resistance to draw, say, 20 amps of current could do it. Computer PSUs are powerful enough to supply that much current continuously (unlike your average wall wart) and risk of fire is a reality.

You could mitigate against that risk by adding a small inline fuse, automotive or glass-tube-style2. Anywhere from 250ma to 3A seems reasonable depending on how many LEDs you want. This would reduce the level of risk to something I’d consider reasonable but would probably still violate electrical codes which specify a maximum power supply size for low-voltage lighting.

Once the risk of fire is reduced, the next question is: what happens to the voltage on the 12v rail when there is a short behind the fuse? Does it drop far enough to crash the PC (or trigger the PSU’s short-circuit protection and shut the whole thing off)?

The ATX spec says power supplies should shut off very quickly when a load of less than 0.1 ohm is detected (if you have a cheap one, I suppose it might smoke instead!) I decided to test my 450W FSP Group PSU to see what would happen.

The 2A fuse I tested had a cold resistance rating of 0.055 ohm, meaning we’d expect that when the fuse is used to short 12v and ground the PSU will shut off, probably before blowing the fuse. Indeed, that was the case. The power supply shut off with the fuse element still intact.

Soft power on was not functional after the PSU’s short-detection triggered. To get it to turn on again, I had to use the hard switch to disconnect power for a while.

For the next test, to get the resistance above 0.1 ohms I added a few 1 ohm resistors I had lying around inline with the fuse.

This time the fuse blew with a bright flash. I looked at the computer screen to see that it had rebooted, but the PSU was still running. Apparently this little experiment didn’t trigger the PSU’s short-circuit protection, but the voltage was disturbed enough to cause a reset.

That’s somewhat of a bummer because it means there’s a good chance your PC will reset if you accidentally short your LED string, even with a tiny fuse in there to boost the short resistance a bit. But then, if that’s happening to you more often than once a decade, you’re probably doing something wrong.

In any case I’d strongly recommend against using a PWM dimmer with this setup. Good PSUs/motherboards can probably cope with the additional high frequency noise but it certainly isn’t going to do the components any good.


1. Another way to accomplish this same goal is to hook a current sensor up to a relay which controls the supply side of a separate power supply for your LEDs. The current sensor detects when the computer PSU is not drawing much current (because, say, the PC is off) and switches off the relay. This disadvantages of this technique are that it wastes some power, requires additional expensive components, is less reliable, and has to deal with mains voltage making DIY treacherous and inadvisable. The main advantage is you can buy off-the-shelf kits that do it: I have an APC UPS with this feature built in, and similar surge protectors are available. A second advantage is that you don't have to worry about disrupting the computer if there is a short in your light strip since it has its own independent voltage source.

2. You could consider using resettable fuses in place of regular ones like most USB ports do, but I think they're a bit more challenging to mount inline on a wire run. I suppose you could solder wires directly to the leads rather than using a fuse holder since it shouldn't need to be replaced. Keep in mind that your PSU may also be able to source more current on the 12v rail than a given resettable fuse is rated to interrupt, so consider all the numbers carefully if you go that route.

My Internal Software (Permalink)

Lately I've been making an effort to publish more of my "internal" software. You know, the stuff that I wrote just for my use on my own box?

I'll admit I have mixed feelings about publishing this stuff. On the one hand, it seems like a crime that so many tens of thousands of lines of interesting code will disappear forever if I get hit by a bus or something, especially when it's so easy for me to post it online. On the other hand, I do like for there to be a certain minimum level of quality in software that I publish, and my own internal tools are often not up to snuff. I also recognize that much of what I write is hyper-specific to my own needs and will probably never be used by even a single other person, so there's no point in polluting the global hive mind with it.

Thus, while I'll never be one of those people who publishes every last bit of my code and configuration data, I think I should probably publish more of it than I have in the past. Without further ado, then, here are a few of my internal tools:

golang-scrollback-search — A terminal app that helps you search in a running command's scrollback. Particularly useful for servers which spew huge amounts of log data.

Thought Index

Favorite Projects

These are the same projects listed above, but in long format (for search engines and people who don't like HTML trickery):

Although some of these are commercial ventures, no consideration of any kind was provided in exchange for the links. In addition, I provide these links because I like these projects and I want to promote them. It is not my intention to imply that I am affiliated with any of these projects in any way, because I am not.


My favorite part of college, besides learning about Unix, was getting to use LaTeX and all the neat packages like PGF/TikZ. For whatever reason I enjoyed that a lot more than the actual content of all the assignments and papers I worked on.

Some selected work:

Other Writing

I've given up on Blogger, but here are some notable posts from an old blog:

Project Graveyard

This gem is usually attributed to Leonardo da Vinci: “Art is never finished, only abandoned.” In that light, these projects were loved but are not currently being maintained.


This site does not have a built-in commenting system (Why not?) but please let me know about any errors, omissions, or similar problems by email: bt@brandonthomson.com. You can also send me general feedback or comments. I enjoy receiving feedback by email and I look forward to hearing from you.

Atom Feed

Most content on this page is also available through an atom feed. Sorry, no RSS.

Unlike a typical blog, here I frequently update old content to reflect my latest thinking. My goal is not to have any articles on the site that contain outdated information or that I no longer agree with.

Unfortunately, this style of publishing creates a slight impedance mismatch with typical feed semantics. So, here is how this feed works:

I don't always make new posts on a consistent basis. Even if new items don't appear here for a year or two, that doesn't necessarily mean I've abandoned the feed or never plan to post here again. I might just be taking a break.

This feed was only tested in newsbeuter, so please let me know if you run into any problems with your particular client.

Finally, this feed will always contain *all* the items *currently* published on this site (not just the n most recent items, and also not necessarily all the items that have ever been published).

Email Problems

If you sent me an email and did not receive a reply within 10 days, my apologies. I usually reply to personal mail, so it seems that something has gone wrong. Here are the most common reasons this can happen, some with remediation steps:

License / Duplication

Except where otherwise noted, all text content on this page is copyright 2010, 2011, 2012, 2013, 2014 Brandon Thomson. Feel free to duplicate and distribute for non-commercial (but see note below about podcasts) purposes according to the terms of the Creative Commons Attribution-NonCommercial 3.0 United States License.

As an exception to the non-commercial rule, this material can be freely read in any quantity on any podcast. Permission is granted regardless of whether the podcast or the associated websites contain advertising or involve commerce. This exclusion applies to audio formats only, so please be sure to remove the content from published text transcripts of your podcast unless you abide by the non-commercial rule.

If you host this content in text format on any domain that also contains commercial advertising, I may consider that to be an infringing commercial use even if you do not personally receive revenue from the arrangement. This determination is at my discretion.

Small excerpts are usually considered fair use in commercial review, criticism, or commentary.

Links back to brandonthomson.com (We do https!) are always appreciated but not required. Thanks :)

Any doubts? Contact me. I enjoy hearing about where my content is being used, so don't hesitate to get in touch!

Creative Commons License