Skip to content

Instantly share code, notes, and snippets.

Avatar

Raine Revere raineorshine

View GitHub Profile
@raineorshine
raineorshine / alias_completion.sh
Last active Mar 22, 2020 — forked from kopischke/alias_completion.sh
Automatically add completion functions for aliases
View alias_completion.sh
# https://superuser.com/questions/436314/how-can-i-get-bash-to-perform-tab-completion-for-my-aliases/437508#437508
# Usage:
# 1. Save alias_completion.sh to /usr/local/etc/ or wherever.
# 2. echo "source /usr/local/etc/alias_completion.sh" >> ~/.bash_profile
# 3. source ~/.bash_profile
# Automatically add completion for all aliases to commands having completion functions
function alias_completion {
local namespace="alias_completion"
@raineorshine
raineorshine / gpg-import-and-export-instructions.md
Last active Feb 27, 2019 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys
View gpg-import-and-export-instructions.md

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
gpg --export-ownertrust > raine-ownertrust-gpg.txt

NOTE The GPG manual suggests exporting the ownertrust instead of backing up the trustdb, although it doesn't explain why.

You can’t perform that action at this time.