What You Should Know About DNS

This post is from an earlier incarnation of this blog. I’ve gotten a few requests to republish it (the original post date was 2009-06-23), so here we go.


Recently, I’ve found myself typing quickly into my IM client to a few friends, explaining how a DNS change of some kind was going to work. It occurred to me that I should probably just write something up that would explain some DNS basics.

DNS is a big topic. I’m not even going to attempt to cover all of it here. If you really want to dig into it, then I recommend that you get and read the bugs book. A lot of this book is devoted to talking about the BIND software package (more on this later), but it’s still pretty much the reference for understanding DNS. If, on the other hand, you fall into the overwhelming majority of people who need to “get it”, but don’t need every detail, hopefully this article will help you out.

Continue reading

Switching the Blog to MariaDB

WordPress, which is the blogging platform used to run this site, relies on PHP and MySQL to operate. A while back, Sun bought MySQL, and then Oracle subsequently bought Sun. Two of the most important pieces of that second acquisition were MySQL, and the Java programming language. Without getting into too much of the debates, many people feel that Oracle isn’t a great steward for either Java or MySQL. To that end, the original creator of MySQL forked the code and created an alternative called MariaDB. MariaDB aims to be a seamless drop in replacement for MySQL, with better performance and some extended features. I decided to see how “drop in” it really was by updating this site to use it.

Continue reading

using strace on multiple processes in linux

My distinguished and decidedly sexy colleague Josh Barratt recently noted that you can use multiple -p flags with strace in order to simultaneously attach to multiple process. This is very useful when you’re trying to debug something like Nginx where there are likely multiple child processes that you want to monitor.

If this is something that you think you might find useful, here’s a bash snippet that will make an easy to use straceall command:

function straceall {
  strace $(pidof "${1}" | sed 's/\([0-9]*\)/-p \1/g')

Just put this in your .bashrc, and then you can easily monitor a family of processes with a command such as:

straceall php5-fpm

if you’re trying to debug say a PHP issue.

Upgrading from Node.js 0.8.x to 0.10.0 From my PPA

The Node.js project recently pushed out a new stable version with the 0.10.0 release. This release supersedes the 0.8.x line and has a bunch of new features and enhancements. In particular, there’s a new Streams API you’ll probably want to check out. Also, the domain module has been elevated to “unstable” status, so you can start checking it out for your error handling. A lot of people seem to use my node PPA to install node on their systems, so I wanted to make a quick note about performing this upgrade.

Continue reading

Proxying WebSockets with Nginx

WebSockets are an exciting new technology designed to make it easier to create real time applications by providing a full-duplex communication channel between the browser and the server. In layman’s terms that means that information can be sent and received by the application at the same time. One of the easiest ways to write apps using WebSockets is to make use of the excellent Socket.io library, which is used in conjunction with Node. The usual strategy when building a Node app is to put Nginx in front of Node as a reverse proxy that serves any static content. This was a problem if you wanted to use WebSockets though, as Nginx didn’t know how to proxy those requests. Until now…

Continue reading

Speed Up Your Site with SPDY and Nginx

Speed is a Good Thing ™ when it comes to your site loading. Generally speaking, if people can’t start interacting with your site quickly, meaning within a few seconds of when they first get there, your engagement numbers are going to plummet. The folks over at Google are keenly aware of this and have therefore introduced a new protocol called SPDY which is designed to make the initial load time of modern web pages faster. It’s already in use at places such as GMail and Twitter, so this is not just a theoretical endeavor. My friends over at Automattic¬†sponsored an initial implementation of SPDY for the Nginx web server, and I’ll explain how to use this cool new tech on your own sites.

Continue reading

A Close One

I’m happy that Obama won the election. I don’t think he’s by any means perfect, but I definitely don’t want a commander in chief who believes he’s going to get his own planet after he dies.

That said, my happiness about Obama’s reelection is tempered by the fact that the popular vote was almost dead even. As a country, we really are very divided about who we are and where we want to go in the future. It’s going to take a lot of work to achieve the kind of unity we’ll need to make any truly substantive forward progress.

so i put the blog back online

I took the site down for a while as I wasn’t ever posting anything. But now that posting things hasn’t been an¬†option, of course I want to post things. So I’ve put it back up.

My interest was in no small part because I’m looking to figure out a pretty idealized hosting setup for a single VPS WordPress installation again. To that end, I’m using a nice modern version of PHP, and I’m running a build of Nginx that has the SPDY patch applied and the Naxsi firewall module added. I’ll be playing around with these over the next few days, if anything interesting comes up I’ll (hopefully) post it here.