Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 779 Bytes

notes.md

File metadata and controls

18 lines (15 loc) · 779 Bytes
title permalink layout excerpt comments
Some, easy to forget, things to remember
/notes/
page
Cheatsheet
false

Accessing MacOSX Keychain from Terminal

MacOSX has a built-in command called security, it lets you manage your Keychain. Kudos to this blog post from Kramidnarg that helped in my research. Since I use Keychain's notes to store some keys I've created an alias to retrive a key and copy to clipboard. It can be easily improved to a function passing attributes...

security find-generic-password -C note -s "NameOfMyNote" -w | perl -lne 'print pack "H*", $_' | awk -F "[><]" '/string/{print $3}'| pbcopy

Not the most beautiful command, but it's a nice start.