GithubHelp home page GithubHelp logo

derrickmeyer / keychain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mogensen/keychain

0.0 2.0 0.0 120 KB

Bash script to access the osx keychain, for use in shell scripts.

Home Page: mogensen.github.com/keychain

keychain's Introduction

Keychain Access

================================

I got annoyed that:

  • I had to write my passwords in cleartext in my scripts, or
  • I had to write my password all the time when using my own scrips, when i have this amazing osx keychain.
  • The security(1) - Command line interface to the keychain is very hard to use in scripts.

So, I wrote this bash script to allow for easy access to the osx keychain.

Example usage:

First add the username and password to the osx keychain

security add-generic-password -s google -a mogensen -w PaSSW0rd

Then use the keychain script to get the username and password

gmail () {
    USER=`keychain -u -s google`
    PASS=`keychain -p -s google`

     curl -u $USER:$PASS --silent "https://mail.google.com/mail/feed/atom" |  \
  	     perl -ne 'print "\t" if /<name>/; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'
	}

Se the man page security(1) Mac OS X Manual Page

keychain's People

Contributors

mogensen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.