2017/10/20: GitHub 2FA from the command line

I recently had to enable 2-factor authentication on my GitHub account (some organisations require it). The options for the second factor on the website didn't look that great: provide a phone number we can send a text message to, or install an app on your smart phone (with explicit links which apps to use for the major smart phone operating systems). But I'm not a big fan of smart phones (no proper keyboard, where do I get my shell?, etc) and usually use my laptop for such tasks. The choices would have looked much nicer, had they mentioned what the apps do, instead of showing how they look like. It's simply a TOTP according to RFC 6238 (HMAC-SHA1, time step 30 seconds), and you can read the secret in base32 (when choosing to enable an app as second factor, over the QR-code there is a link for manually entering the secret). So, my "app" is oathtool from security/oath-toolkit, and all I do whenever I need a "code from my app" is simply oathtool --base32 --totp "${SECRET}" -d 6.