Switching to Static

Nikola Tesla

For those of you who frequently read this blog (n ≈ 0) you'll notice that it looks a bit different. I've moved it from my own hosted Wordpress instance to static pages generated by Nikola and hosted up on Github.

Why bother? I didn't like my blog being something I wouldn't be proud to write or operate myself. Wordpress was overkill and not worth the trouble:

  • Wordpress is database driven for dynamic sites. My little blog isn't dynamic at all. Once you buy into the static idea, lots of otehr things fall into place.

  • Comments and account spam are still is a nuisance. The nice people at Akismet have done a great job holding back the tide, but I still get at least one bogus registration a day. I expect a service like Disqus or Facebook or Google+ will be more likely to keep pace with the spammers.

  • I want to author in markdown; maybe even ReST someday. All this wysiwyg-ish stuff in browsers is for the birds.

  • I don't actually need to host anything. I'm not running my own IRC server or anything. Even though Dreamhost has been a perfectly good service, I just want something... well, less Wordpress-ey.


So I need to pick a static web site hosting package, specifically one that is good for blogs. The big things I was looking for: static site generation, Markdown/ReST support, and ability to host on free services like Github Pages.

In additon I wanted these things (in no particular order):

  • active development

  • in real use on real sites

  • easy customization, ideally by theming

  • ability to move over posts and comments, probably via Wordpress's export function.

  • python, what I program in for fun

  • a bit extensible

I considered three options before settling on Nikola. There are a ton of static site generators, even when you limit them to Python. But the only alternatives I seriously looked at were Pelican and Hyde. Of these Nikola seems to have the most active development and the richest set of features. I ease especially drawn by their good documentation and theming.

Up and Running

Here are my notes of what it took. This isn't a nicely-written howto, but if you want to see the blow-by-blow, read on.

  1. The software was easy to set up and get started

    • pip install nikola did the right thing. Of course within a virtual environment, you have to keep the lab clean!

    • Along the way I found a few other requirements, like request, phpserialize, and markdown. These were easy to find/fix because of helpful error messages.

    • This is all now captured in the project's requirements.txt.

  2. Initial import from wordpress XML dump went ok but a fair bit of manual HTML prettification took some time.

    • The slugs aren't how I like them: 201311seven-things.wp instead of seven-things.wp. I tried a bit to do mass rewrite of those, but couldn't easily do that without breaking everything, so just decided to let this go for now. I'll just do slugs without dates going forward.

    • I considered html2text but figured I'd just let the HTML slide for now. Too much trouble to go back and clean all that up now.

    • The "wp" extension, by default, is mapped to markdown instead of html. Odd but easy to change.

    • Nikola has a nice simple redirect facility that the importer pre-populated for me.

  3. Migrate threads to Disqus - clean and simple, worked right out of the box.

    • wordpress plugin has a nice import facility. Said it'd take a day, but didn't take that long at all. Aside from one thread with 75 comments, not much else that should cause them much heartache.

    • nice simple URL mapping utility

  4. Publishing to github. Again, easy peasy. The way to make this work is to put all your static files in a repo titled USERNAME.github.io. In my case: sefk.github.io. Just a couple of "tricks" were needed to make this work smoothly:

    • So that it would correctly serve my own domain, you have to put a CNAME file in the root of the repo

    • I put my nikola themes and source files in the "src" subdirectory, and changed the OUTPUT_DIR configuration option to ... Github Pages wants things in the root.

  5. The final swich. I moved my domain from Dreamhost over to Gandi, which is the registrar I like to use. They throw in basic DNS with registration, which is sufficient for me.

So There You Have It

So far I am really pleased with the result. It's a bit more work to publish, but for me that's natural and what I want. I guess I wouldn't recommend this to someone who isn't adept with all these bits (virtual environments, DNS, github repos, etc.) but for me that's no problem.

Thanks to:

Airmail FTW

airmailFinally a thick-client email program that seems to have stuck. So far I am really liking Airmail.

For years I've flipped between various Mac fat clients and the GMail web interface. The web interface keeps winning:

  • Outstanding search
  • Great keyboard shortcuts (go Vi!)
  • Very good use of screen real estate

But the killer is the reliance on a rock-solid Internet connection, and GMail's own slowdowns. Even though there is an offline mode, it is such a downgrade it's not worth using. So if you need to use offline you're in bad shape; same if you're on a slow or lossy connection, or if GMail is having a bad day.  Sadly, that's pretty often these days.

Airmail is cheap ($1.99 in the App Store) and super featureful. It coexists well with GMail's paradigm (archive vs. delete, threading includes sent items, drafts). Great configuration options. Visually pleasing. Robust.

There are really only three places where it has fallen short for me:

  • I miss GMail's tabs. Those are still the best way to filter mail, and I was impressed with how well that feature worked and quickly became natural.
  • Search. Airmail's isn't bad, but nothing is as good at this as Google's own.
  • Gmail (with Chrome) has a great feature where you can drop in a picture and it is resized to look good.  Lacking that I now have to manually resize my giant retina-display screenshots.

So-long to Sparrow and Mail.app and Mailplane. Or until someone does really nails self-hosting.

The Seven Things You're Not Supposed to Talk About


I liked this week's episode of This American Life. The idea is there are seven topics that you should avoid in conversation because they are always boring. I like this list!

Here is the transcript.  I repeat the list here.

  1. How you slept.
  2. Your period.
  3. Health. Of course if it's something serious, then that's conversation worthy, but normal sniffles, aches, and pains? No good.
  4. Your dreams.  Not big aspirations, this is literally what you dreamt last night
  5. Money.
  6. Diet. What you can and can't eat.
  7. Route. How you got here, what way you're going to get home.

I will endeavor to not waste all of your time droning on about any of these topics.

Halloween Down 20%, But Still Solid


This year we had a sizable number of trick-or-treaters at our house in the Willows neighborhood of Menlo Park. The 303 we saw was down from our high last year, but abou the same as the year before that.

So here are the totals:


The rate at peak was comparable to last year.

halloween2013-rate          halloween2013-cumulative

I don't have an explanation why we are down a bit. The weather was beautiful, indeed a little better than last year since rain started at 8:30 last year. Maybe the forecast rain coming last year got people out earlier who might have missed altogether?

It was outstanding having my friend Amy LaMeyer helping out. She operated the clicker that was new this year, and so kept me company, which was a ton of fun.

As always, the Google Spreadsheet with the graphs and raw data is publicly available here. Check it out!

K&R C Programming, Quantum Books, Cambridge, MA


Today in a box I came across my old K&R. Probably the most valuable book I've owned. My copy has been heavily used.

But the unexpected, fun thing was finding an old label on the back cover.

There is a lot in there.


  • January 1994. I had just graduated college, driven cross country with my friend Shig, and started my first post-college job. I would have been in that job four months or so and realized that I should just stop borrowing someone else's copy (probably Larry Claman's) and buy my own.
  • Purchased at Quantum Books, a great technical bookstore in the shadow of MIT in Cambridge, Massachusetts. It's no longer there. The bar that is there now (Meadhall) is a nice place, and I'm a big fan of beer, but it's not the same.
  • According to an inflation calculator, $35 in 1994 is $55 today. That's expensive for a little book, especially to the twenty-two year old me.
  • Note the email address: [email protected]. This was back when mom and pop dialup ISP's where what we all used, people and businesses alike. This particular one, Software Tool & Die, was my private email address at the time too. (Aside: they claim to be the first public dialup ISP, and I have no reason to doubt them)

It was fun being reminded of all this stuff. So the lesson of the story: it's still worth buying books, and when you do, don't remove the labels.

Launch Day


Today was launch day. It went really well.  I wanted to capture what a good launch feels like and contrast that with a more exciting launch, just five months ago.

Today we turned on our first class on Stanford's instance the open-source edX platform, what we're calling OpenEdX. The class is Statistics in Medicine, taught by Kristin Sainani of the Stanford School of Medicine. With over thirteen thousand students signed up it's a medium-sized MOOC (Massive Open Online Course).

We have launched MOOC's for Stanford before: two in Fall Quarter, and one in Winter. Even though the classes were huge success, but the launch days weren't so smooth. We had written that platform, Class2Go, from the ground up with a small team in a dozen weeks in Fall; in the weeks before the Winter launch we ripped out the whole evaluation system, about one-third of the code, and replaced it with a whole new engine. In both cases most of our code was fresh off the presses.

Those launches were rocky. I'll tell the story of the DB class launch in January. The first thing we do is a "soft launch," where you open the front door and some people find their way in. Those first visits give you a sense of how things will go.  Surprisingly, the servers were a bit busy.  But we wanted to keep going, so we scaled up capacity and moved on.

The thing that drives real traffic is the announcement email. That gets people to the site. The announcements started going out, students started coming in, and the site lit up. We were in hot water. Servers were overloaded, and most surprising, the database was getting hammered. This was scary and unexpected. We control-C'ed the mail job and quickly hacked additional caching into the site.  We had to trickle out announcements over the next twelve hours.  We made it, but it was a long, stressful day.

And then the days/weeks post-launch were spent watching graphs, triaging 500 errors (user-visible "we're sorry" pages), and installing daily hotfixes. But we got through it. The classes were a success and the team was proud.

So, contrast that to today's launch.  Totally different.

Everyone came in early as usual. I bought bagels. We turned on the class (soft-launch) and the servers hardly noticed. We sent the announcement mails, people came and took their pre-course survey and watched the intro video. Hardly any load. This chart shows the average CPU on our four appservers from 8:00 AM PDT / 15:00 UTC until 10:45 AM or so.


Those are happy servers. Other charts we watched (db connections, load, etc.) told the same story. The most impressive thing was not a single user visible error, no 500's!

Those folks at edX made some solid software.  We're happy to be working with a strong group of engineers and a quality product.  We've had our hands on it only since April, and it was released open-source to the world on June 1.  I fully expect a lot of other universities and organizations are going to have a great time running classes on OpenEdX too.

I just turned off half the appservers since we're fine on capacity. Now off to bed with a good feeling.

Coding on a Flight


I'm surprised that that I like coding on flights. It's surprising because airplanes are generally hostile environments for most things, but I've found it a good place to code.

The obvious reason is the lack of interruptions and distractions. Usualy there is no wifi, or it is too spotty to count on. So no email or IRC or web. While I know that distractions kill flow, I never seem give myself license to unplug in normal life. I'm a manager, and being a manager means being interruptible.

But there's another reason. When I code unplugged, I code differently. I have to be self-sufficient. Instead of just looking things up on StackOverflow, I take 20% more time to figure it out myself. That's much more satisfying! It's just not that hard to rummage through the Django code or try things out in iPython.

Also it just sounds cool to say you coded something up on the flight.

But thre real question is should simulate "airplane mode" when grounded.  Hmm.

"Low" Retention Rates in Online Education Isn't Necessarily A Bad Thing


I am of two minds about Peter Reinhardt post today calling out online education's poor retention rates.

I agree that retention rates are low. At Stanford we we just completed the Winter run of Jennifer Widom's Database Class, here are the course stats:

  • Registered: 64,127
  • Turned in some work: 20,836
  • Took the final exam: 4,771
  • Received a Statement of Accomplishment: 4,854 (1,927 with distinction)

How do I feel that 23% of students who started the class finished? Or that only 7.6% who enrolled finished? Mostly I'm fine with that. I think there's a lot of value in someone kicking the tires. Some were experimenting with on-line education, some didn't know before hand if the class would be right for them. I share Curt Bonk's view that this shouldn't be seen as a black mark but as another form of outreach.

I consider this over forty thousand people who got some exposure to the topic, the platform, and what this MOOC thing is all about.

But I totally agree that increasing retention is a worthwhile goal and a valuable metric.   Online education platforms (mine included) should do what we can to keep students engaged.  This article has many good suggestions.  And there's a lot of room for experimentation.

(disclaimer: I'm the engineering manager on Class2Go, the open-source MOOC platform we've built at Stanford)