MFA tokens in your terminal

All the stuff described here I learned from my dear colleague Giulio. I’m sharing it here because it’s cool, and because I don’t think he’d share it anywhere other than our internal mailing list.

Do you use MFA a lot? Are you tired of reaching for your phone to check those codes on Google Authenticator app? Perhaps you’ve been logging to too many different AWS accounts because your work requires that? ­čśö Here’s a couple paragraphs of advice that will ease your pain.

First, install oath-toolkit. On OS X you can get it with homebrew. Once it’s installed, you’d want to define a function for your shell, like this perhaps:

function mfa () {
   oathtool --base32 --totp "$(cat ~/.aws/$1.mfa)" ;

This specifies an mfa alias which calls oathtool and expects one argument: name of a file (sans extension) inside your ~/.aws/ directory which contains a string that is the base for computing your time-based one-time passwords. To continue the AWS-based example, you can find the code in the AWS console while setting up a new virtual MFA device.


Once you click on “Show secret key for manual configuration,” you’ll be presented with a 64-character string, which you’ll need to put in a ~/.aws/account-name.mfa file. After that, whenever prompted for the MFA token, type mfa account-name in your terminal.

“Hunger makes me a modern girl”

I know Carrie Brownstein through “Portlandia,” a quirky sketch show she’s been doing with Fred Armisen for the last couple of years. I’m a huge fan of how accurately “Portlandia” pokes fun at alternative-culture so commonly associated with Pacific Northwest.1 What I learned later, only after doing some research on Fred and Carrie, is that they were both well-known before the show even started. Fred, to a perhaps lesser extent, through SNL, and Carrie, probably to a much greater extent, through Sleater-Kinney.

SNL is obviously not very popular in Europe, but the fact that during my teenage years I have never heard about Sleater-Kinney was always a bit surprising to me. Sure, alternative-scene rock bands from Seattle like Nirvana, Soundgarden and Pearl Jam made its way to (even Eastern) European radio stations, but the much larger phenomenon of what’s known as the “Pacific Northwest scene” remained rather unknown, or at least not commonly known. This way one could, as it turns out, live one’s life all through the crazy 90s and only discover Sleater-Kinney in 2012. Oh, and what a fantastic discovery that was. Continue reading ““Hunger makes me a modern girl””

How are zlib, gzip and Zip related?

Abhishek Jain asks Stack Overflow about the differences between zlib, gzip and Zip, and gets a fascinating and very insightful response from none other than Mark Adler. I particularly like the comment Adler made when the OP asked about referenecs for his answer.

I am the reference, having been part of all of that. This post could be cited in Wikipedia as an original source.

This, to me, is a perfect example of the enormous impact of open source and free software libraries developed in the 80s and 90s have on modern-day computing. All these small components of Linux or *BSD systems that were developed over the years now play such crucial parts in so many complex systems we rely on every day.

Free/open source software developers are the heroes of the internet era, and as such should have monuments built to their glory and schools named after them.