Skip to content

Instantly share code, notes, and snippets.

@jcamenisch
Last active August 29, 2015 13:56
Show Gist options
  • Save jcamenisch/8941463 to your computer and use it in GitHub Desktop.
Save jcamenisch/8941463 to your computer and use it in GitHub Desktop.
With latest (master) version of dotenv, you can load in sensitive information straight from the Mac OS X keychain.
AWS_ACCESS_KEY_ID=$(keychain_account s3.amazonaws.com)
AWS_SECRET_ACCESS_KEY=$(keychain_password s3.amazonaws.com $AWS_ACCESS_KEY_ID)
#!/bin/sh
security 2>&1 find-internet-password -s $1 | ruby -ne 'puts $1 if $_ =~ /^\s*"acct"<blob>="(.+)"$/'
#!/bin/sh
security 2>&1 find-internet-password -s $1 -ga $2 | ruby -ne 'puts $1 if $_ =~ /^password: "(.+)"$/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment