ck's Weblog: The Human Experience, Interpreted

Navigation:

Now Playing:

Jerk Comments

Friday, March 6 2015

Every now and then, I'm tempted to add "cool story, bro" to an inline comment:

# This script assumes it will run exactly once per day.
# Cool story, bro.

0 Comments

MacGuffin Full of Stars

Thursday, March 5 2015

I watched Lucy last night and an odd effect on the MacGuffin caught my eye:

Given the way the third act plays out, it seems like one of many nods to 2001: A Space Odyssey (the novel, in this case):

"The thing's hollow — it goes on forever — and — oh my God! — it's full of stars!"

–David Bowman

I, however, prefer to see it as a tribute to Stan, Monkey Island's best salesman:

Stan!

0 Comments

Steam Link

Wednesday, March 4 2015

Valve announced the Steam Link yesterday. For $50, it will stream games from any Steam installation. That means I'll be able to sit in my living room playing a game that's actually running on my gaming PC at the other end of the house. I've wanted that for a long time.

Now I'll see if I can get through my remaining PS3 games before it's released.

0 Comments

Gravity Review

Monday, January 12 2015

Kerbal Space Program made me hate Gravity (the film).

I'm not sure I would have liked much to start with; I have a natural dislike for Sandra Bullock's characters. It's not necessarily rational, but I usually find myself wanting her character to fail. With good physics, it probably would have been capped at 3 out of 5 (Netflix) stars.

But the physics were flawed, even more noticeably so because I've spent so much time in Kerbal Space Program. Kerbal quickly forces players to understand the basics of low- and zero-gravity Newtonian mechanics, at least if they want to succeed. The game also reinforces the notion that in space, every resource is scarce, and every action should be planned out so it can be executed with maximum efficiency.

I hadn't appreciated that I now have a very specific notion of how things should move in outer space, and it's clear when something doesn't look right.

I don't want to re-hash last year's discussion about everything wrong with Gravity. I'm late to that party. But here are a few bullet points that might help anyone who's either filming a movie about zero-g, or planning to pick up Kerbal Space Program (the latter being the much better option):

  1. If you're burning fuel to accelerate toward an object in your same frame of reference, you should plan a similar amount of time and fuel to slow down before you get there. Otherwise, you'll die.
  2. Every single action near an orbiter needs to be slow, careful, and precise. Otherwise, you'll die.
  3. If you find yourself unexpectedly spinning, arrest that motion before you try anything else. Otherwise, you'll die.
  4. If you try to use your personal jetpack for hooning (e.g. flying circles around your orbiter), you'll probably fling yourself into space, run out of fuel, and die.

I hope that's helpful.

0 Comments

Updated Database Backups

Monday, August 4 2014

I've updated my previously-shared database backup script to take advantage of modern technology:

$!/bin/sh

DATE=`date +%Y%m%d`
DAYOFWEEK=`date +%u`
DATABASES=`mysql -ss -e 'SHOW DATABASES' | grep -v information_schema`
TMPDIR=`mktemp -d`
BUCKET='<redacted>'

for DB in ${DATABASES}; do

FILE=${TMPDIR}/${DB}-${DATE}.bz2
mysqldump --events ${DB} | bzip2 -9 - > ${FILE}

# Copy this backup to Amazon S3 for durable external storage.
s3cmd put ${FILE} s3://${BUCKET}/nightly/

# If it's Sunday, do a weekly backup as well.
if [ $DAYOFWEEK = 7 ]; then

s3cmd put ${FILE} s3://${BUCKET}/weekly/

fi

rm ${FILE}

done

rmdir ${TMPDIR}

All of the rotation and deletion functionality has been removed. I've replaced it with S3 lifecycle rules:

  • Files in the 'nightly' directory are automatically deleted a few days after upload.
  • Files in the 'weekly' directory are kept online for a few weeks, then archived to Glacier for a few months before deletion.

There's a small but important difference in those rules compared to the previous system, which kept the most recent three nightly and five weekly backups. If my system goes offline for a period of time, or if my backup script fails, backups will continue to be expired with nothing coming in to replace them. As such, I expect to continue to tweak the lifecycle rules as I watch data going through the system to make sure I'm comfortable with the availability.

0 Comments

Copyright © 2001-2015 Chris Kuehn