About Beckman

I'm a big geek, serial entrepreneur and idea guy. I've been called names, such as PHP Guru, MySQL DBA, BOFH, Security God, etc. That and Peter-Peter-Pumpkin-Eater.

The image in the header is © Peter Beckman.

Archives

01 Jan - 31 Jan 2003
01 Feb - 28 Feb 2003
01 Mar - 31 Mar 2003
01 Apr - 30 Apr 2003
01 May - 31 May 2003
01 Jun - 30 Jun 2003
01 Jul - 31 Jul 2003
01 Aug - 31 Aug 2003
01 Sep - 30 Sep 2003
01 Oct - 31 Oct 2003
01 Feb - 28 Feb 2004
01 Jul - 31 Jul 2004
01 Aug - 31 Aug 2004
01 Oct - 31 Oct 2004
01 Mar - 31 Mar 2005
01 Apr - 30 Apr 2005
01 May - 31 May 2005
01 Jun - 30 Jun 2005
01 Jan - 31 Jan 2006
01 Jun - 30 Jun 2006
01 Feb - 28 Feb 2007
01 Apr - 30 Apr 2007
01 Sep - 30 Sep 2007
01 Mar - 31 Mar 2008
01 May - 31 May 2008
01 Jul - 31 Jul 2013
01 Sep - 30 Sep 2013
01 Apr - 30 Apr 2014
01 Jul - 31 Jul 2014
01 Dec - 31 Dec 2014
01 Dec - 31 Dec 2015

Links

AngryOx.com
Tossable Digits - Cheap, Anonymous, Disposable Phone Numbers
The Internet License Plate Database
Love & Onions (Jen, my wife)
Roadie Speaks Blog
BananaForce
AdCritic.com
Slashdot
I Love Ben Brown

Search!

Last Comments

marshakaplan766 (Renaming your OSX…): Renaming your OSX Home Di…
GoaDarling (Wow, I'm fat.): Embark on an unforgettabl…
John smith (Centrum Silver Ad…): The Centrum Silver Ad has…
John smith (Centrum Silver Ad…): Centrum Silver ads often …
merryjhon (Centrum Silver Ad…): The Centrum Silver ad flo…
Hairmond (Wow, I'm fat.): Hairmond specializes in t…
MyCleanRServices (Wow, I'm fat.): MyCleanRServices is your …
RKCoatings (Wow, I'm fat.): RK Coatings brings life t…
TrustWorthy (Wow, I'm fat.): Trust Worthy offers the c…
GoaDarling (Wow, I'm fat.): Discover the magic of Goa…

Stuff

Powered by Pivot - 1.40.1: 'Dreadwind' 
XML: RSS Feed 
XML: Atom Feed 

« Renaming your OSX Hom… | Home | How to log cron jobs … »

Quicksilver and OTP: Together At Last

Monday 15 December 2014 at 11:57 pm

I’ve been using Two-Factor Authentication on most every site that supports it for a while now: Google, Evernote, Facebook and Dropbox to name a few. But I’ve always grumbled when I’m on my laptop and I need to log into one of these accounts and they are asking for my TFA token.

Now I’ve got it working where I can get the latest token for any of these services on my Mac in Quicksilver and copied to my clipboard in no time flat. You can have it working for yourself in just a few minutes.

First off, requirements:

Once you’ve installed everything, put this code in a file named “otp” in your ~/bin/ folder and make sure it is in your path.

#!/bin/bash
scriptname=`basename $0`
if [ -z $1 ]
then echo “$scriptname: Service Name Req’d” echo “” echo “Usage:” echo “ otp google” echo “” echo “Configuration: $HOME/.otpkeys” echo “Format: name=key” exit
fi
otpkey=` grep $1 $HOME/.otpkeys | cut -d”=” -f 2 | sed “s/ //g” `
if [ -z $otpkey ]
then echo “$scriptname: Bad Service Name” exit
fi
/usr/local/bin/oathtool —totp -b $otpkey

Now you need to put your special keys (you kept them handy and encrypted somewhere, right?) into a special, you-read-only file in your home dir named .otpkeys. Make sure you chmod 600 .otpkeys so nobody can snoop ‘em! Here’s what it should look like:

google=a743 mike k3b4 rm5k z8a9 q6f5 id1k bxk1 facebook=OWBV Q9LF POQ2 MKYU evernote=UKPPIDEALLKPYTT9 dropbox=iop4 xbox asia b0ss ninj a9

It isn’t the most secure implementation but it gets the job done. I considered putting the keys/config into a Keychain item and use /usr/bin/security to access them, maybe more securely.

Now run it!

Quicksilver OTP Command

And the result.

Quicksilver OTP Result

Enjoy!


ten comments

Watch the curly quotes in the code above. You need to get straight quote marks (watch the sed line) and also convert em-dashes into double – marks.
helpful-person - 07 10 15 - 11:47

I visit this blog first time and inspire by this good stuff work. Incredible post keeps up posting such great information. If you like to write essays then you can use custom essay writing service for a trust worthy service.
custom essay writing service (Email) (URL) - 21 01 17 - 04:55

Hi,

I saw your idea on SuperUser and liked it so much. I did a small improvement, added the GPG encryption:
https://github.com/apiraino/otp-cli-tool

Thank you for the cool idea!
Antonio - 10 08 17 - 09:40

This article is really contains lot more information about This Topic. We have read your all the information some points are good . Great post I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article.
webstagram (Email) - 22 03 19 - 05:44

Cover your face with the width of your palm and then you are just here to read all this non sense stuff
Live Gold, includes: Slime Rancher, Trails Fusion, Bayonetta and Red Faction: Armageddon, pro
Facepalm - 02 04 20 - 10:08

here are ways for students to basically skip their freshman and/or sophomore year of college by taking classes that count for credit. Another option students can do is go to a community college for 2 years or so before focusing on their bachelor’s or master’s degree
https://www.24hwritemyessay.com/ (Email) (URL) - 13 06 20 - 17:30

I was tired of racking my brains on how to do my assignment. Then I found this free paper base and used their templates to write my own. It helped me to get a high grade.
Nicolle Meyer (Email) - 03 07 20 - 04:35

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. I appreciate your effort of sharing this information and i also want to participate and sharing some information that i think you should know.
visit this to learn more
Technical information
naseem ijaz (Email) (URL) - 22 12 20 - 06:26

Hello! If you see that you have no time for writing papers then it’s better to use additional help. Such hep we can find at the page that is called essay writing service. That’s a place with all the necessary information for writing papers right.
discussion post (Email) (URL) - 22 06 21 - 16:02

We treat our clients like family so we ensure when you rely on us, like family, we will not let you down! We will help you at We are pleased to state that till date there is not a single customer who was left disappointed with our service.
cheap assignment writing service (Email) (URL) - 20 09 21 - 12:34


August 2017 Xbox Live Games with Gold: Slime Rancher, Trials Fusion, Bayonetta and Red Faction: Armageddon
Microsoft is now officially announced August’s 2017 Games with Xbox Live Gold, includes: Slime Rancher, Trails Fusion, Bayonetta and Red Faction: Armageddon, provides over $89 dollars in value and up to 4000 gamerscore. Both Bayonetta and Red Fac…
Sent on 27 07 17 - 02:37 , via PUPUWEB

Trackback link:

Please enable javascript to generate a trackback url

  
Remember personal info?

Emoticons / Textile

To prevent automated comment-spam, we require you to answer this silly question.
 

  (Register your username / Log in)

Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.