John Bohn

My thoughts on software, tech, business, and more

An Illustrated Book of Bad Arguments

Book Cover

I’ve been looking for a short read to kick off book club with and today I found what I think is just the right book. Here’s the description from Amazon:

Have you read (or stumbled into) one too many irrational online debates? Ali Almossawi certainly had, so he wrote An Illustrated Book of Bad Arguments! This handy guide is here to bring the internet age a much-needed dose of old-school logic (really old-school, a la Aristotle).

Here are cogent explanations of the straw man fallacy, the slippery slope argument, the ad hominem attack, and other common attempts at reasoning that actually fall short—plus a beautifully drawn menagerie of animals who (adorably) commit every logical faux pas. Rabbit thinks a strange light in the sky must be a UFO because no one can prove otherwise (the appeal to ignorance). And Lion doesn’t believe that gas emissions harm the planet because, if that were true, he wouldn’t like the result (the argument from consequences).

Once you learn to recognize these abuses of reason, they start to crop up everywhere from congressional debate to YouTube comments—which makes this geek-chic book a must for anyone in the habit of holding opinions. It’s the antidote to fuzzy thinking, with furry animals!

Yup. That sounds awesome. I had a brief look at it on their website too and it looks great. As of today, the book is still on pre-order (yes, I’ve already bought my copy because the illustrations look awesome). It comes out August 26th, 2014 in hardcover, but you read the book in its entirety on the “An Illustrated Book of Bad Arguments” website for free!

Installing Ruby with rbenv

The need for multiple versions of Ruby

As you work on different Ruby project over time, you’ll find that different projects projects require different versions of Ruby. To handle this, a few tools have been created. My personal favorite is rbenv. I recommend all rubyists use it even if you’re just starting out. If makes installing new versions, tying certain versions to certain projects, and much more a breeze.

rbenv vs rvm

Besides rbenv, there is another ruby version manager that has been out for some time and at one point, was the de facto standard. That tool was RVM. RVM is still fairly popular although it’s popularity is waning in favor of rbenv. Why is rbenv more popular? Because it does less. Programmers generally like software that does one thing and does it well. In terms of managing multiple versions of Ruby, rbenv just does less. More specifically, from the rbenv wiki:

rbenv does…

  • Provide support for specifying application-specific Ruby versions.
  • Let you change the global Ruby version on a per-user basis.
  • Allow you to override the Ruby version with an environment variable.

In contrast with RVM, rbenv does not…

  • Need to be loaded into your shell. Instead, rbenv’s shim approach works by adding a directory to your $PATH.
  • Override shell commands like cd or require prompt hacks. That’s dangerous and error-prone.
  • Have a configuration file. There’s nothing to configure except which version of Ruby you want to use.
  • Install Ruby. You can build and install Ruby yourself, or use ruby-build to automate the process.
  • Manage gemsets. Bundler is a better way to manage application dependencies. If you have projects that are not yet using Bundler you can install the rbenv-gemset plugin.
  • Require changes to Ruby libraries for compatibility. The simplicity of rbenv means as long as it’s in your $PATH, nothing else needs to know about it.

Installing rbenv

If you’re on a Mac, the recommended way to install rbenv is via Homebrew. If you don’t have Homebrew yet, I highly recommend it.

To install rbenv via Homebrew, just run:

brew install rbenv ruby-build

Now that you have rbenv installed, you need to add a line to your profile so everything loads up correctly when you start your terminal. The location of your profile varies depending on how your system is set up, but it will typically be either ~/.profile, ~/.bash_profile, or ~/.bashrc. If you’re using Zsh, it will probably be ~/.zshrc. Add the following line to your profile:

eval “$(rbenv init -)”

To test that it works, run:

type rbenv

You should get something like the following back if it worked:

rbenv is a shell function

Installing a new ruby with rbenv

Awesome, you should now have rbenv installed and you’re ready to roll. Well, almost ready. rbenv by itself doesn’t do much good. Let’s add a ruby version. As of this writing, the latest version of Ruby is 2.1.2. Pro tip: you can view all versions available to rbenv by running the follow from your terminal:

rbenv install -l

To install Ruby 2.1.2, run the following:

rbenv install 2.1.2

And, if you want to make that version your default global version, you can run:

rbenv global 2.1.2

Wrapping up

That’s it! I hope this helps you get set up with rbenv. There are a few other things that you’ll be able to do, such as installing alternate versions of Ruby (like Rubinius). If you want to learn more about rbenv, check out the README on github.

Starting to Learn Elixir

It’s been a long time since I’ve really dug into a new programming language. I think it’s probably been about two years. That is way too long. I don’t necessarily feel like I’m getting stale, but I want to at least get back on track with learning one programming language per year. This year, is going to be the year of Elixir.

So what is Elixir and why did I choose it? Elixir is described on it’s website as follows:

Elixir is a functional, meta-programming aware language built on top of the Erlang VM. It is a dynamic language that focuses on tooling to leverage Erlang’s abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades.

Besides getting back on track with learning a programming language a year, I really want to learn a functional programming language soup to nuts. I know a few of the concepts and have played around a bunch, but I have yet to really dig in all the way and build anything of any real use.

Here are few more reasons:

  • There are a few projects that I’ll be making this year that sound like the could be a good fit for Elixir (given what I’ve heard).
  • Modern tooling that sits on the Erlang VM. Gives me an opportunity to understand the Erlang VM while also write code in a language I’m likely to enjoy and use.

I’ll post more about it as a go. For now, I’m just looking forward to learning something new.

Weekly Picks: 2014-07-14

I’m trying something new. Posting my evernote web clips from the past week. We’ll see if I can do it every week. I’m going to give it my best.

Amazon Cognito

This looks like Amazon play at being a SSO as a Service. I always thought they were going to try to merge it in with IAM, but I can see why they didn’t. They are very different things. The cool thing is that you can store and sync across devices apparently. I don’t know much about the service yet, but definitely plan on checking it out soon.

Amazon Zocalo

Amazon’s second offering this week. It looks like it’s they’re offering to compete with Google Drive and potentially dropbox. Seems like a decent multi-user real time document contribution service. I kind of doubt that I’ll be using it any time soon though.


Looks like a way to get around CORs purely in the browser. Have no idea how it works, but it caught my eye,

Coreutils View

This was pretty cool. It adds progress monitoring to a few coreutil commands (cp, mv, dd, tar, gzip, cat, etc). Going to give this a show. You run the command after you run the other commands though. I wonder if you could integrate it in the tmux bar?


Just want it sounds like. Create a table from a foriegn schema.

New Raspberry PI (model B+)

Seems neat. I don’t have a raspberry pi, but I’ve been considering one to run a monitor a company dashboard locally. Probably overkill, but who cares :).

TLDR;: * More GPIO * More USB * Micro SD * Lower power consumption * Better audio * Neater form factor


I have no idea what this is really supposed to be. I gave it a very brief scan. Seems like it’s trying to be a single web framework to run multiple programming languages under. No idea how that’s supposed to work. Sounds cool though. I’ll probably give it a look given all the SOA related things I’ve been doing lately.

Bitly: Scaling to 6 billion clicks a month

Overview about lessons learned at Bitly. I need to give the talk (the second link) a good watch this weekend.

Algorithm: The Hacker Movie

Do you even need to ask? Cap’n Crunch liked it. Of course I’m going to watch it.

New Parallella boards

If a new Raspberry PI wasn’t enough, there are new Parallella’s as well. Probably won’t buy one for a bit, but interested. One of them is actually touted as be a “Desktop” personal computer. I call bullshit given the spec, but what the heck, who knows.

SQLite: Small. Fast. Reliable.

Nice little article reminding us that SQLite is actually a cool little DB.

Google’s Project Zero

Google’s going to help keep us all safe on the internet now. I’m not sure exactly what’s going on here. I think they’re just putting a bunch of security researchers in a room and trying to beat black hats to zero day vulnerabilities.

iTerm 2 (2.0)_

Version 2.0 of iTerm 2 (is there an echo?) dropped this week. I’ve already used triggers to try to help me stop typing full commands that I have aliases for. I’m also going to give a look at the tmux integration. I’ll probably just stick with my vanilla tmux, but who knows. It could be cool.

The Tao of Programming

Totally forgot about this. Always a classic though. If you’ve never read it, I highly recommend it. It’s worth it.

Why We Use OCaml

I know next to nothing about OCaml, but after reading this, I know a little more than I did.

Official Google Analytics iPhone App

Looks pretty slick. If I used Google Analytics more, I’d be all over it. Soon enough I’ll pull it down and try it.

Learn facts while pulling code changes

A colleague of mine at AlphaSights wrote an awesome pro tip on coderwall. Check it out and learn something with every pull.

Find Deleted Files in Git

Occasionally I’ll remove some files from a git repository that I need to get back for one reason or another. Specifically, recently I was working on a project where I was working with a bunch of audio files that I reorganized and moved to separate directories (a.k.a. organized a bunch of stuff that was all thrown into a big heap of files). One of the many things that I love about git is that you are able to easily recover these files or directories, do what you need to them, then move them around some more, commit the “undelete” or just “redelete” them.

To accomplish this, you use the plumbing command git rev-list (more info on plumbing vs. porcelain). Git’s rev-list command is extremely important and ultimately used by multiple porcelain commands. Here’s a great description of the basics from the man.

List commits that are reachable by following the parent links from the given commit(s), but exclude commits that are reachable from the one(s) given with a ^ in front of them. The output is given in reverse chronological order by default.

You can think of this as a set operation. Commits given on the command line form a set of commits that are reachable from any of them, and then commits reachable from any of the ones given with ^ in front are subtracted from that set. The remaining commits are what comes out in the command’s output. Various other options and paths parameters can be used to further limit the result.

So, if I have a file that I deleted a month or so ago called foo.rb but for some reason I need to bring it back into my local repo. I can easily bring it back by running the following:

git checkout `git rev-list -n 1 HEAD -- foo.rb`^ foo.rb

So, that’s obviously a bit of a long-winded shortcut. Let’s break it down.

It’s really two commands in one. Let’s start with inside the ticks.

git rev-list -n 1 HEAD -- foo.rb

The -n 1 says “give me one revision”. HEAD represents the tip of the current branch. The bare double dashes (or ) represents my current branch. When all put together we are saying, print the latest commit hash starting from the commit I am currently on, in the branch that I am currently on, that modified foo.rb. The caret (^) is a shortcut that represents the previous commit to whatever it appends.

Once you grok that, the next part is pretty easy. Once interperted by the shell, the command is just a normal checkout from an alternate commit.

If none of that makes sense, feel free to comment and I’ll try to clarify. When in doubt though, just trust me :).