Custom 3D-printed King of Tokyo monsters

What could be better than being a giant monster and beating other giant monsters into submission? Well, clearly, being a giant monster that isn’t represented by a cheap piece of printed cardboard with a small plastic base, but instead a good sized solid three-dimensional plastic figurine! Unfortunately, the Internet has been lacking in the department of 3D-printable King of Tokyo monsters, so I set out to deal with the issue.
Continue reading

Posted in Games, Making stuff | 14 Comments

Elastic Beanstalk applications using two ports and Websockets

This blog post describes how to set up and deploy an AWS Elastic Beanstalk application written in Node.js that listens to both regular HTTP requests and Websocket connections.

TL;DR: Download the sample application, and deploy it into an EB environment created using eb create alb-test-app-dev1 --elb-type application.

By default, applications in Elastic Beanstalk only listen to one port, and that is reflected in settings of the Nginx proxy, the Elastic Load Balancer, and the ELB listeners. We must change Elastic Beanstalk’s default settings to make the dual port setup work, which is done with .ebextensions. Also, Websockets don’t seem to work too well with a “Classic” ELB. An “Application Load Balancer” must be used instead.

Continue reading

Posted in IT | 2 Comments

Useful paths for debugging Elastic Beanstalk deployments

Sometimes it can be painful to try and get an Elastic Beanstalk application to deploy cleanly. In order to effectively debug the issues, it’s necessary to SSH into the instance. This requires that you’ve added a Key Pair in the EB environment configuration before launching the instance(s). The address to SSH to can be found in your EC2 management console.

Once on the server, these paths are useful in debugging:

  • /var/app/current/ – This is where your application source code is.
  • /opt/elasticbeanstalk/hooks/appdeploy/post – If you’ve used post deployment scripts, this is where they are. Note that any post deployment scripts from any previous deployments to the same instance will be left here even if your latest configuration does not have those scripts!
  • /var/log/eb-activity.log – “tail -f /var/log/eb-activity.log” in order to get a live feed about how your deployment is going.
  • Posted in IT | Leave a comment

    Setting up a Raspberry Pi from scratch

    Getting started with a Raspberry Pi is basically really easy: All you need to do is get a disk image and burn it to an SD card. But of course, that’s just the very basic starting point. Theres’s plenty of setup work left to do after that, so I decided to gather it all in a blog post so I don’t need to re-invent everything every time I start a new project. Here goes:

    Continue reading

    Posted in IT | Tagged | Leave a comment

    RetroPi briefcase

    Here’s a quick build I just finished: A Raspberry Pi running RetroPi, installed in a Makita powerdrill briefcase with a 7″ TV and four USB controllers. Also included are all the components necessary to power the whole setup: A 12V PSU that powers the TV, and a 12V to 5V voltage regulator that powers the Raspberry Pi and the USB hub.
    Continue reading

    Posted in Electronics, Games, Making stuff | Leave a comment

    Forwarding SSH keys to a Vagrant box

    Scenario: A new Linux box has been installed with Vagrant, and now I must git clone a non-open repository to the server, so I need to forward my SSH keys to the root user on the virtual server.

    1) Add the following line to your Vagrantfile:
    config.ssh.forward_agent = true

    2) Once you’ve “vagrant ssh”‘d to the server:
    $ sudo -E -s su become root with your forwarded key.

    I found the answers at Stackoverflow and Serverfault, and decided to copy them here so I don’t need to Google them the next time I’m looking for the answers.

    Posted in IT | Leave a comment

    A method for neatly stowing the lines on a skydiving parachute

    Looking at the way some freshly licenced (and some older) jumpers struggle with making neat line stows, I figured I’d document the method I’ve been using to stow my lines. Here goes:

    A method for neatly stowing lines

    These instructions are for stowing a bight of lines on the right-hand side of the bag; for the left-hand side, the hands used are reversed.

    1. Start by slipping your right middle finger through the rubber band you’re going to use.

    Continue reading

    Posted in Skydiving | Leave a comment

    My “first order retrievability” toolbox

    Here’s my take on a toolbox observing the principle of “first order retrievability” as popularized by Adam Savage. In short, all tools can be reached without moving other tools out of the way first.

    The box itself is a Draper 48566 with the trays removed. The insert for the tools is built from foamcore to hold my most used tools on the front side, and a selection of less needed tools on the back. As it happens, my list of commonly used tools appears to be so short that there’s plenty of space for expansion later!

    Toolbox front side

    Toolbox back side

    Posted in Making stuff | Leave a comment

    Filtering out outliers in Arduino ultrasonic distance sensor data

    A friend of mine asked me how he could remove invalid data points from the measurements made by the ultrasonic range finder in his Arduino project. A quick search got me to this page, but some of the links were dead and there was no complete example on the page anyway, so I decided to roll my own.

    Here’s my take, written in Python since I didn’t have an Arduino handy for testing. This is based on dropping outliers from recent measurements to come up with a “fixed average”:

    #!/usr/bin/env python
    # Example on filtering out invalid data points in a stream, coming in from for
    # example an ultrasonic distance sensor.
    # This test data has two invalid data points; 310 and 210
    data = [40, 41, 40, 39, 42, 45, 310, 43, 41, 44, 38, 120, 121, 117, 120, 120, 210, 110, 112, 114, 117, 113, 78, 80, 78, 74, 60, 70, 76]
    raw_values = [];
    while data :
      # Read a raw value
      raw_value = data.pop()
      # Keep last 5 values stored in an array
      if len(raw_values) > 5:
      # For debugging only; Print out current stored raw values
      for raw_value in raw_values:
        print raw_value,
      # Calculate the raw average of all the stored values; This value will be
      # thrown off by invalid values.
      avg = round(sum(raw_values) / len(raw_values))
      print ":",
      print avg,
      # Drop the highest and lowest stored value if we have enough values.
      sorted = list(raw_values);
      if len(raw_values) >= 3:
      # And calculate an average based on the remaining three values. This is
      # closer to correct, but will be thrown off if there is more than one
      # invalid value currently stored.
      fixed_avg = round(sum(sorted) / len(sorted));
      print ":",
      print fixed_avg,
      # Print the difference between the raw average and the fixed average:
      print "(",
      print abs(avg - fixed_avg),
      print ")"
    Posted in IT, Making stuff | Leave a comment

    Amount of content in The Lord of the Rings vs. The Hobbit

    While cleaning up my desktop, I stumbled upon a calculation I did after the Hobbit movies came out. What I wanted to find out was how many words in the book would be used for each minute of the movie. Seeing as The Hobbit is a much shorter book than the LOTR trilogy, it would seem that there would need to be a fair amount of padding to make three feature length movies out of it. So, let’s see: Continue reading

    Posted in Books | Leave a comment