Skip to content

Commit c08f671

Browse files
update gpg aliases
Signed-off-by: ivan katliarchuk <[email protected]>
1 parent 4e4c876 commit c08f671

File tree

5 files changed

+34
-13
lines changed

5 files changed

+34
-13
lines changed

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"filename": "git/gitconfig",
119119
"hashed_secret": "6c3da9f3585d8c9e621eef55b6d6b808014e296d",
120120
"is_verified": false,
121-
"line_number": 140
121+
"line_number": 141
122122
}
123123
],
124124
"tools/mc.ini": [
@@ -131,5 +131,5 @@
131131
}
132132
]
133133
},
134-
"generated_at": "2025-01-12T23:08:52Z"
134+
"generated_at": "2025-03-13T10:01:35Z"
135135
}

git/gitconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
[commit]
5252
verbose = true
5353
template = ~/.config/gitcfg/message
54+
gpgsign = true
5455

5556
[color]
5657
# Use colors in Git commands that are capable of colored output when

shell/aliases

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,21 @@ alias sshmd5="ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub | awk '{print $2}'"
6363
alias sshl="ssh-add -l -E md5"
6464

6565
# GPG
66-
alias gpglist="gpg --list-keys" # list keys
67-
alias gpglist="gpg --list-secret-keys" # list secret keys
68-
alias gpgtest="echo 'test' | gpg --clearsign" # test if working
69-
alias gpgk="gpg -K --with-keygrip" # find the keygrip
70-
alias gpggen="gpg --full-generate-key" # full featured key pair generation
71-
alias gpgkill="gpgconf --kill gpg-agent" # kill a given component
72-
alias gpgstart="gpg-agent --daemon" # run in daemon mode (background)
73-
alias gpgfing="gpg --fingerprint" # list keys and fingerprints
74-
alias gpgcfg="gpg-connect-agent reloadagent /bye" # reload gpg configuration
75-
alias gpg!="gpgcfg" # reload gpg configuration
76-
alias gpgloc='cd ~/.gnupg'
66+
# how to gpg keys https://docs.github.com/en/authentication/managing-commit-signature-verification/checking-for-existing-gpg-keys
67+
# https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key
68+
alias gpg.list="gpg --list-keys --keyid-format=long" # list keys
69+
alias gpg.list.sec="gpg --list-secret-keys --keyid-format=long" # list secret keys
70+
alias gpg.test="echo 'test' | gpg --clearsign" # test if working
71+
alias gpg.k="gpg -K --with-keygrip" # find the keygrip
72+
alias gpg.gen="gpg --full-generate-key" # full featured key pair generation
73+
alias gpg.kill="gpgconf --kill gpg-agent" # kill a given component
74+
alias gpg.start="gpg-agent --daemon" # run in daemon mode (background)
75+
alias gpg.fing="gpg --fingerprint" # list keys and fingerprints
76+
alias gpg.cfg="gpg-connect-agent reloadagent /bye" # reload gpg configuration
77+
alias gpg!="gpgcfg" # reload gpg configuration
78+
alias gpg.export="gpg --armor --export" # key id in form 90C.. gpg.list.sec
79+
alias gpg.loc='cd ~/.gnupg'
80+
aliast gpg.safedir='gpg-safe-directory'
7781

7882
# Easier navigation Utilities
7983
alias ..="cd .."

shell/functions

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ gpg-restart() {
184184
eval "$(gpg-agent --daemon --enable-ssh-support)"
185185
}
186186

187+
# if gpg WARNING unsafe warning on homedir
188+
gpg-safe-directory() {
189+
# Make sure that the .gnupg directory and its contents is accessibile by your user.
190+
chown -R "$(whoami)" ~/.gnupg/
191+
192+
# Also correct the permissions and access rights on the directory
193+
chmod 600 ~/.gnupg/*
194+
chmod 700 ~/.gnupg
195+
}
196+
187197
# WWW
188198
grep-ip() {
189199
grep -Eo \

zsh/zshrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ set -x
88
fi
99

1010
if [[ $(uname -m) == 'arm64' ]]; then
11+
# make sure to link required things to path
12+
# find . -type l -ls
13+
# ln -s /opt/homebrew/bin/pinentry-mac /usr/local/bin/
14+
# ls -s /opt/homebrew/bin/gpg /usr/local/bin/
15+
# remove rm /usr/local/bin/bin
16+
# on new mac run 'gpg-restart' to make directory safe
1117
export PATH="/opt/homebrew/bin:$PATH"
1218
fi
1319

0 commit comments

Comments
 (0)