gitflow tools on github

We’ve adopted gitflow for one of our projects. The git command line tool integrations found on github are very handy. Note: be sure to adopt the -avh version of the tools found in this repo: gitflow for git on github. To install on Mac OS use `brew install git-flow-avh`. The non `-avh` version of this tool is 7 years out of date — we mistakenly used that version initially and ran into bugs that have been around for many years (and which are fixed in the `-avh` version).

Watching program flow in a time-sensitive situation

I’m working on some unit test in Java (well, Kotlin) for an Android project. When I set a breakpoint, the failure mode changes because there are timeouts and races going on. This is not an ideal situation, but I’m debugging someone else’s code here. So I found a clever way to log what code is getting called, and from where, by using breakpoint actions. Just put `new RuntimeException().printStackTrace()` in as a breakpoint action! Now your log shows when code got hit, and why it got there, but doesn’t actually stop execution, so it does less intrusive shift to the timeouts and race-conditions.

Receipt Validation on iOS

This has been a pretty major headache: Trying to validate a receipt for an in-app purchase on iOS.


  1. Use cocoapods OpenSSL-Universal pod to get openssl
  2. Copy Apple’s suggested code, but add the key missing call OpenSSL_add_all_digests() prior to PKCS7_verify()
  3. This last thing is what fixes the mysterious error that reads, “error:2107D06D:PKCS7 routines:PKCS7_BIO_ADD_DIGEST:unknown digest type”

Now, to explore the contents of my ASN1 package!

Kotlin, please allow return from closures

Edit: After writing this, I was helped by Andrey on Twitter and now I know about the return@

The simple answer is:

sequence.flatMap {
if (it.containsKey("connnected") {
return@flatMap Observable.just(it.getBoolean("connected"))
return@flatMap Observable.empty()

Here is the original post.

Today’s kotlin frustration… trying to map a Bundle into types. E.g. if the bundle has the key “connected” get it out as a boolean. otherwise, skip the event.

so I do

sequence.flatMap {
if (it.containsKey("connnected") {
return Observable.just(it.getBoolean("connected"))
return Observable.empty()

Except, oh Kotlin, you back-stabbing-friend… closures don’t allow `return`

So I edit it…

sequence.flatMap {
if (it.containsKey("connnected") {

That’s probably obviously wrong to you now, but it took me a long time to see the problem.

And the fix.

sequence.flatMap {
if (it.containsKey("connnected") {
return Observable.just(it.getBoolean("connected"))
} else {
return Observable.empty()

I don’t see why Kotlin disallows the return — and it makes this kind of error much less likely. The fact that closures evaluate to the last expression is handy for doing tiny bits of work, but I find that reactive networks in RxJava are much easier to express with blocks — and if they get more than a few lines long, you sometimes really want the ability to do an early return without introducing the nested scope of an `if` statement.

After installing openvpn I cannot connect to my raspberrypi

So I installed openvpn on my Raspian distro on my Raspberry Pi 2. As soon as I started it up, I lost all connectivity to my Pi.

And I don’t have a display, keyboard, or mouse — all my management has been over the network.

How to recover?

I tried a bunch of things, but here’s what worked, in brief.

  • Power off PI and put SD card in my Mac.
  • Copy the SD card to an image file using `dd`
    • dd bs=32768 if=/dev/disk0 of=if=raspberrypi.img

Now we edit the image. If you have a way to open ext4 filesystems already, just remove the files (see rm step below). Here’s how I did it:

  • Install Veertu emulator (VMWare or VirtualBox would work too) with the latest Finnix Recovery Distro.
  • Create the Finnix VM in Veertu and add a 4GB Hard Disk. Boot it up once so it creates the disk image.
  • Move raspberrypi.img on top of the recovery image, e.g.
    • mv raspberrypi.img ~/VM\ Library/Finnix\ Rescue\ 2/hd1.img
  • Boot Finnix again
  • Mount the image
  • mkdir -p /mnt && mount -t ext4 /dev/sda2 /mnt
  • Remove the openvpn startup scripts
    • rm /etc/rc*/*openvpn
  • Unmount
    • umount /mnt
  • Power off Finnix
    • shutdown -h now
  • Copy the image back onto the SD card:
    • dd bs=32768 if="~/VM\ Library/Finnix\ Rescue\ 2/hd1.img" of=/dev/disk0

Put the SD card in your Raspberry Pi and reboot!

Update: The reason RPi doesn’t boot with open vpn is because ifplugd tries to HOT plug it.  To fix this, explicitly list the real network interfaces in `/etc/default/ifplugd`:

  • Replace
  • INTERFACES="auto"
  • with
  • HOTPLUG_INTERFACES="eth0 wlan0"

(Do that instead of the rm step above to prevent openvpn from killing the wifi.)


I’m so excited about Linea, new sketching app for the iPad from Iconfactory. Already we’re seeing some amazing drawings and sketches from users! Creating new software and releasing it into the wild is exciting and thrilling. We’re already hard at work at a dot release, so please give it a try and let us know how you like it.

Now running nginx and secure

So I think I’ve finished migrating my blog to the new server. It’s on Ubuntu 16.04 now, instead of 12, and running on PHP7 instead of PHP5, and on mariadb instead of mysql, and on Nginx instead of Apache.

Lots of little problems came up.

For one thing, the old database was configured so that the character set was latin1 instead of utf8. But wordpress was putting utf8 bytes into it. Which worked fine until I went to migrate the data. Because now-a-days mysqldump delivers data in utf8 encoding by default, so in order to get the bytes out unmolested, I had to specify to dump as latin1. Then, it’s necessary to edit the dumped .sql file and change the latin1 in there to utf8. Quite a headscratcher. If you see accented characters showing up as TWO weird characters, this is probably what happened to you.

ssh user@hostname.tld 'echo XXXXXpasswordXXXXX | mysqldump --default-character-set=latin1 -u root -p database' > data.sql

Next, a shout out to Lets Encrypt which is providing the SSL certificates for my domains. Configuration was incredibly easy.

I’m still running on Linode, which is working reliably — as it has done for the past many years! They no longer let me create an instance of the size I used to use, so my new instance is slightly smaller… when all is said and done I might save a little money!

I’m also trying an experiment where I track changes to my Linux configuration in `/etc` using GIT. Unfortunately, lots of files change in `/etc` for reasons that aren’t meaningful configuration changes… so it will probably be of dubious value.

Now on to the rest of my domains…


Have you tried out the new iOS Messages Stickers yet? I bet you’ve found some that are your favorites: silly emoji or some of your favorite Disney characters? My favorite pack so far is FeelieFaces ( by Sydikos! It’s over two dozen animated faces that show the whole range of human emotion. There are sad face FeelieFaces and happy faces, too! The best one, in my opinion, is the Pirate face who says “Arrrggh!”: