Skip to content

Instantly share code, notes, and snippets.

@pyr
Created November 1, 2013 07:52
Show Gist options
  • Save pyr/7262127 to your computer and use it in GitHub Desktop.
Save pyr/7262127 to your computer and use it in GitHub Desktop.
upon popular request, my pw* tools
function pwgrep() {
gpg --batch -q -d -r pyr@spootnik.org $HOME/.auth/pwdb.asc | grep $*
}
function pwcat() {
gpg --batch -q -d -r pyr@spootnik.org $HOME/.auth/pwdb.asc
}
function pwedit() {
[ -z $EDITOR ] && EDITOR=vi
file=`mktemp /tmp/pwedit.XXXXXX`
gpg -q -d --batch -r pyr@spootnik.org $HOME/.auth/pwdb.asc > $file && \
$EDITOR $file && \
gpg -q --batch -a -e -r pyr@spootnik.org $file && \
mv ${file}.asc $HOME/.auth/pwdb.asc
rm -f $file ${file}.asc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment