Ben McCann

Co-founder of Connectifier.
Investor at C3 Ventures.
Google and CMU alum.

Ben McCann on LinkedIn Ben McCann on AngelList Ben McCann on Twitter

2015

OAuth in a command line script

08/05/2015

Many APIs today use OAuth. If you want to use an OAuth API from the command line, then what I recommend is starting a web server locally to handle the OAuth callback. Here’s a quick and dirty example of doing that in Python. #!/usr/bin/env python from flask import Flask,redirect, request import json import logging import Read More

Building Docker images with SBT

07/26/2015

A typical way to setup Jenkins is to connect it to your source repository (e.g. with the Git Plugin), run your tests after each commit, and then build a package for deployment when the tests pass. We’ll use SBT’s sbt-native-packager for this last step, which allows you to package your applications in numerous different formats Read More

MongoDB data migration

07/07/2015

Here is some benchmarking data regarding transferring data from one machine to another. These benchmarks were run on the AWS i2 instance class. mongodump – 15min / 100GB gzip using pigz – 15min/100GB network transfer – 20min/100GB extract archive – 30min/100GB mongorestore -j 12 – 2hr/100GB

Injecting JUnit tests with Guice using a Rule

05/04/2015

GuiceBerry is a pretty helpful library for injecting JUnit tests with Guice. However, it’s not super actively maintained and many of it’s methods and members are private making it difficult to change it’s behavior. Here’s a class, which essentially does what GuiceBerry does in one single class that you can edit yourself. import org.junit.rules.MethodRule; import Read More

IntelliJ Setup

05/04/2015

The font rendering on IntelliJ is horrendous and makes you want to gouge your eyes out. This is because is uses Swing. In order to make this not completely horrible, you’ll need to install tuxjdk, which contains series of patches to OpenJDK to enhance user experience with Java-based and Swing-based tools. I also recommend installing Read More

Formatting a Disk on Amazon EC2

02/10/2015

The following commands will format and mount your disk on a newly created EC2 machine: sudo mkfs -t ext4 /dev/xvdb sudo mkdir /storage sudo sed -i ‘\|^/dev/xvdb| d’ /etc/fstab # delete existing entry if it exists sudo sh -c ‘echo “/dev/xvdb /storage ext4 defaults,nobootwait,noatime,nodiratime 0 2” >> /etc/fstab’ sudo mount -a