Kevin B. Linux Engineer. Pilot.

Uploading to Firefox Send with Python

I saw Firefox Send pop up on HackerNews the other day and thought it was pretty interesting. I uploaded and downloaded a few small image files and then had the bright idea that it'd be cool to use Python to upload/download files from Send. This led me down a bit of a rabbit hole, similar to the way the author of this article got sucked into the Starbucks API.

If you'd like to follow along locally, the referenced image, frame00.png, is from Google's Clojure-Turtle repository.

The first things I looked at after uploading a file were the request headers

Continue reading

Generate One Time Password in Python

I hate pulling out my phone every time I need that stupid 6 digit code to login to Gmail/GitHub/Dropbox/AWS and any other site that supports 2 factor. I like the added security, I just hate reaching for my phone 30 times a day. In an effort t simplify my workflow, I threw this quick python script together to generate the code for me:

#!/usr/bin/env python
import pyotp
totp = pyotp.TOTP('YourReallyLongToken')
print totp.now()

You'll probably need to install pyotp with pip.

From there, I created a simple Alfred Workflow to paste it for me when

Continue reading