Azuka

I like to tinker with things

  • At GopherCon

    “Sorry, I’ll have to drop in 8 minutes” I typed into a dedicated Slack channel at work for a group bug fixing session. I was at GopherCon, not quite bright-eyed from a night of wrestling with my hotel’s internet connection, but looking forward to a Keynote talk about proposed changes to the encoding/json package. I had my badge flipped, because I didn’t want to talk to anyone and was in that little zone where I counted the time down before I had to head back upstairs to the Keynote ballroom.

    Read more…
  • Fun with php deployer and ssh

    A long, long time ago when my daily driver was a Windows machine, I used to deploy websites over ftp, then sftp. I remember SmartFTP being one of the first software tools I ever purchased. In time (around 2011), I got introduced to Capistrano when I started doing continuous integration/delivery and setting up multiple environments for my projects. Getting a consistent ruby ecosystem working for mostly php projects was annoying as I moved between Jenkins, Wercker (pre-Oracle), Shippable (before they got acquired by JFrog) and finally CircleCI.

    Read more…
  • A billing problem based on assumptions

    My partner and I started SingleSend a little over a year ago. Everything we knew about SMS messages was that we had a 160-character limit, so dividing the number of characters in a message by 160 and rounding up would tell us how many messages to bill for. That held true until we got a $750 bill from Twilio last month which didn’t quite match the sending statistics we saw.

    Read more…
  • That Minor SNAFU With Go Types

    Today’s specimen: type expectedError struct { error } func (e *expectedError) Cause() error { return e.error } func IsExpectedError(err error) bool { _, ok := err.(*expectedError) return ok } In one of my projects, I’m using consul for distributed locking, to prevent processing an item twice from a queue worker. My implementation looked something like the below: import ( "context" "github.com/hashicorp/consul/api" "github.com/pkg/errors" "os" "time" ) type lock struct { db datasource.

    Read more…
  • A Poor Guy's Local PHP Apm

    I’ve seen the benefits of instrumenting code for a very long time: with PHP, Go, Frontend Javascript, and more recently, NodeJS. When you have access to a full APM solution like I do at work (Newrelic), or on the side (with Elastic APM), it becomes easy to see at a glance not only what transactions (API calls, queued jobs, asynchronous processes, etc) are taking a long time, but also why.

    Read more…