Skip to content

Instantly share code, notes, and snippets.

@gphilipp
Last active July 26, 2020 15:48
Show Gist options
  • Save gphilipp/3e6b20da112ffb0db6fd to your computer and use it in GitHub Desktop.
Save gphilipp/3e6b20da112ffb0db6fd to your computer and use it in GitHub Desktop.
GPG commands for Datomic

See technomancy/leiningen#1349 and technomancy/leiningen#615

add use-agent at then end of ~/.gnupg/gpg.conf

start the gpg-agent

gpg-agent --daemon

Then copy paste the output eg.

GPG_AGENT_INFO=/tmp/gpg-gobqoD/S.gpg-agent:10545:1; export GPG_AGENT_INFO;

Decrypt eagerly to type the passphrase and store it in the agent

gpg --quiet --batch --decrypt ~/.lein/credentials.clj.gpg

Starting gpg-agent manually

eval $(gpg-agent --daemon)

Starting gpg-agent automatically from console machine Shell agnostic

Add the lines below to ~/.profile. Any POSIX-confirming shell should include this file.

# Invoke GnuPG-Agent the first time we login.
    # Does `~/.gpg-agent-info' exist and points to gpg-agent process accepting signals?
if test -f $HOME/.gpg-agent-info && \
    kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then
    GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info | cut -c 16-`
else
    # No, gpg-agent not available; start gpg-agent
    eval `gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info`
fi
export GPG_TTY=`tty`
export GPG_AGENT_INFO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment