Not all rules live forever

At some point in high school, while gallivanting around New England on inexpensive gasoline and end of the day donuts some random guy at Dunkin' Donuts gave us on the cheap, I developed my first set of canonical rules to live by:

  1. When you're chucking a danish, everything's a cop car.
  2. When in doubt, go left.
  3. When in doubt, buy double.

These were born empirically from the demands of the time. A few years later, an addition was made:

  1. Even floors do not exist.

This rule was born from spite and soon after another rule was introduced to provide a loophole:

  1. Apathy is the lazy man's whatever.

Spite and loopholes aren't really good ways to build a morality or worldview so I am retiring rules #4 and #5.

Dredging the past and updating the present

A few months ago, while digging around my gargage, I found an old server of mine. I was looking for a particular bit of old data that I couldn't find on my current computer and thought it might be on this one. It didn't have what I was looking for but it did have a bunch of content from my old blog, going back to 2004.

It was a really old computer that wasn't cared for after I moved stuff to the cloud and the hard drives started failing reads almost as soon as I looked at the thing. However, with some running dd and a lot of finger-crossing, I was able to pull out a backup of the old blog. The backup, annoyingly, was a MySQL dump of a Wordpress page. After trying a handful of text based approaches and a couple of automated approaches, I figured I might as well install MySQL, load the dump into the database and hack together some one-off code to rip things out in a format that I liked.

The data extraction code isn't pretty but it gets the job done:

Read more…

Fortune Cookie: 2018-09-04

Adventure is
worthwhile in itself.
Lucky Numbers 25, 55, 8, 17, 54, 1

Commentary: Many things have intrinsic value; adventure included. Many things have extrinsic value; aphorisms included.


In my ongoing quest to make delicious alcoholic beverages, I have increasingly found myself digging into my ingredients. Syrups, as a class of ingredient, have received a decent amount of my attention. As an aside, if you're buying simple syrup, you are doing a lot of things wrong. In my experience, it is decidedly tricky to find decent grenadine, where decent is defined as being made with real pomegranate and without high fructose corn syrup or food coloring. So, I've started to make my own:


A pomegranate syrup that adds a sweet tartness to drinks and a distinctive red color. Notable in small quantities in a great many drinks and also as the second ingredient in a Shirley Temple, a drink the actress was apparently never fond of.


  • 1 cup fresh Pomegranate Juice (~2 large pomegranates)
  • 1 oz Pomegranate Molasses
  • 1 1/2 cup White Sugar
  • 1/16 tsp Xanthan Gum (optional)
  • 1/2 tsp Orange Blossom Water
  • 1 oz over-proof grain neutral spirit (Everclear or vodka)

Read more…

Bash history synchronization

Bash is my go to shell. I've tried fish; I've heard about zsh; but Bash is my go to.

I really like command history (pressing up arrow or Ctrl+R) and there are a few specific behaviors that I want in my history:

  1. If I have multiple terminals open, I want history shared across them.
  2. If I run the same command multiple times, it should be in my history once.
  3. My history should stick around forever.
  4. The last command, I entered should be the first thing I see when I press up arrow.
  5. Race conditions of long-running commands shouldn't erase history entries.

Turns out all of this is a little tricky with bash, but I've mostly managed it:

Read more…

Slowcooker Yogurt

Some jars of homemade yogurt

I have a 14 month old daughter, a wife that likes yogurt with granola, and I kind of like the stuff too. Needless to say, we go through a lot of yogurt in my house. Specifically, we go through a lot of plain, whole milk, Greek yogurt.

We were recently visiting my wife's aunt and uncle (my daughter's graunt and gruncle), and we had yogurt most mornings. They use an EasiYo to make their yogurt, which piqued my curiosity.

Fancy yogurt is pretty expensive at the store, upwards of $7 or $8 per 32oz container. Yogurt is just fermented milk and I've fermented plenty of things before. I should be able to make yogurt, right?

So, how about EasiYo? Turns out it's not that much cheaper.

We can do better, let's ask the Internet.

Turns out it's pretty straightforward; I just finished our second batch yesterday. It also turns out to be really good, and it's less than $2 per 32oz (milk choice depending).

Read more…

Let's Encrypt on App Engine

UPDATE: As of September, 2017, Google App Engine will manage SSL certificates for you.

Let's Encrypt is a fantastically convenient way to get SSL certificates for your website without paying a bunch of money or resorting to a self-signed certificate. It's also pretty easy to set up.

Easy as it is to set up, the instructions don't really explain much about setup for App Engine. It turns out to be pretty straightforward.

Read more…

Internet Time Now script

On account of being mentioned by Reply All, I've been listening to back episodes of [TLDR]. Listening to #15 - Internet Time caught my attention and made me aware of Swatch Internet Time. It's kind of impractical but also kind of fun, especially as I've been a little annoyed at recording times across timezones for something meant to persist, like this blog.

For fun, I whipped up a quick python implementation:

import datetime
import decimal

def decimal_time(ts):
    mus_ts = (ts.hour * 3600 + ts.minute * 60 + ts.second) * 1000000 + ts.microsecond
    mus_day = 24 * 3600 * 1000000
    dec_time = decimal.Decimal(mus_ts) / decimal.Decimal(mus_day)
    return dec_time * 1000

def internet_time_now(precision=0):
    precision = int(max(0, min(25, precision)))
    precision = 0 if precision < 1 else int(precision)
    format_len = 3 if precision < 1 else 4 + precision
    format_str = '@{{:0{l:d}.0{p:d}f}}'.format(l=format_len, p=precision)
    it_utc_p1 = datetime.datetime.utcnow() + datetime.timedelta(hours=1)
    return format_str.format(decimal_time(it_utc_p1))

Or, if you don't care about precision:

import datetime

def decimal_time(ts):
    s_ts = ts.hour * 3600 + ts.minute * 60 + ts.second
    s_day = 24 * 3600
    return int(1000 * s_ts / s_day)

def internet_time_now():
    it_utc_p1 = datetime.datetime.utcnow() + datetime.timedelta(hours=1)
    return '@{:03d}'.format(decimal_time(it_utc_p1))

Fixing Nikola Footnote Locations

Personally, I prefer to intersperse my footnote declarations with the text that is being footnoted when writing my. For example:[1]

[1] This is just an example.
I might want to write something[#]_ where there's a footnote there.

.. [#] I put the footnote definition here.

And then I continue on with the rest of my writing.

Wherever they are declared, I prefer to have all of my footnotes appear at the end of my posts. By default, Nikola puts the footnotes in wherever they are declared. A simple snippet of javascript can be used to fix the locations of footnotes:

$(document).ready(function() {
    $('.footnote').each(function(i, el) {

Simply wrap in a <script> tag and include in the BODY_END section of or add it to your theme.