Author Archives: Lorin

Getting timestamp from v1 uuid

Getting timestamp from v1 uuid Translated from J.B. Langston’s Converting TimeUUID Strings to Dates Java version to Python: import arrow import fileinput import uuid def main(): for line in fileinput.input(): line = line.rstrip() value = uuid.UUID(line) epoch_millis = (value.time – … Continue reading

Posted in Uncategorized | Leave a comment

Starting a new Minecraft mod

Starting a new Minecraft mod My kids are really into Minecraft, and are interested in mods. Here’s a quickstart to getting an OS X dev environment set up with IntelliJ IDEA. Prereqs You should have the following already installed on … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Testing the Vert.x kinesis module

I needed a simple way to test queueing a Kinesis message with the Vert.x Kinesis module. This Jython script will do it: import vertx from core.event_bus import EventBus from org.vertx.java.core.json import JsonObject from org.python.core.util import StringUtil module = “com.zanox.vertx.mods~mod-kinesis~1.4.13” def handler(_, x): … Continue reading

Posted in Uncategorized | Leave a comment

Using mitmproxy to log Docker API calls

The other day I needed to log the API calls made from my Docker client to debug a difference in behavior between the docker command-line tool and the docker-py Python client. Here’s how I did it. Disable TLS on boot2docker … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Plotting a counting process in an IPython notebook

There are lots of interesting timeseries data in software systems: events that occur over time such as numbers of users signed up, or errors of a certain type. I like visualizing these as a counting process, which is a cumulative count of the … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Start stopped instances that all have the same name

It’s worth learning the AWS CLI and jq in order to do one-off batch operations to EC2 instances. I needed to start a group of stopped instances that all had the same name. Here’s the one-liner: aws ec2 describe-instances –filters \ Name=tag:Name,Values=”name goes here” | … Continue reading

Posted in sysadmin | Tagged | Leave a comment

mitmproxy and ec2-api-tools

Here’s how you can mitmproxy on OS X to see which URLs the ec2-api-tools are querying against. 1. Install mitmproxy: sudo pip install mitmproxy Start it up: mitmproxy -p 8080 Configure the Java keystore to trust the mitmproxy CA certificate: … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

mod_auth_openid on OSX

I wanted to play with mod_auth_openid on my Macbook Pro. OS X ships with Apache installed, so all I needed to do was build the module and edit the Apache configuration. I wasn’t able to build mod_auth_openid from the git … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Networking Heisenbugs

While debugging an issue with OpenStack and floating ips, I ran into a strange issue where running tcpdump on the bridge interface on the network controller would cause packets to be forwarded successfully to a compute node, but if I … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

XPath and Chrome dev tools

Here’s a simple way to get the XPath of an element on an HTML page in page. Right-click on the element on the web page, choose “Inspect Element” from the context-menu Right-click on the highlighted HTML line that appears in … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment