Skip to content

Instantly share code, notes, and snippets.

@l4u
l4u / gpg-import-and-export-instructions.md
Created September 11, 2020 09:10 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

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...

package main
import (
"fmt"
)
type Foo struct {
}
func (f Foo) foo() {
active environment : base
active env location : /usr/local/Caskroom/miniconda/base
shell level : 1
user config file : /Users/leo/.condarc
populated config files :
conda version : 4.7.12
conda-build version : 3.18.11
python version : 3.6.9.final.0
virtual packages :
base environment : /usr/local/Caskroom/miniconda/base (writable)
raceback (most recent call last):
File "/usr/local/Caskroom/miniconda/base/bin/cq-editor", line 11, in <module>
load_entry_point('CQ-editor==0.1.0.dev0', 'gui_scripts', 'cq-editor')()
File "/usr/local/Caskroom/miniconda/base/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/Caskroom/miniconda/base/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
return ep.load()
File "/usr/local/Caskroom/miniconda/base/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2443, in load
return self.resolve()
File "/usr/local/Caskroom/miniconda/base/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2449, in resolve
@l4u
l4u / gist:fdef530e9705b3b9bd1facb81dc53e2c
Created August 5, 2018 07:12
TIL brew cask upgrade --greedy
brew cask upgrade --greedy
@l4u
l4u / gen.rb
Created July 21, 2018 09:49
Golang JSON camel case
require 'active_support/core_ext/string/inflections'
ARGF.each do |line|
name = line.split(' ').first
puts "#{line.strip} `json:\"#{name.camelize(:lower)}\"`"
end
@l4u
l4u / autojump_fzf.fish
Created December 13, 2017 03:10
autojump(macOS) + fzf for fish shell
alias j="cd (cat ~/Library/autojump/autojump.txt | sort -nr | awk '{print \$2}' | fzf +s)"
@l4u
l4u / gist:4babc68a6c875b78bafc
Created August 1, 2015 09:13
spot instance pricing history ec2
aws ec2 describe-spot-price-history --instance-types g2.8xlarge --region us-east-1 --product-descriptions 'Linux/UNIX (Amazon VPC)' --start-time $(date +"%Y-%m-%dT%H:%M:%SZ") | jq '.SpotPriceHistory[] | {price: .SpotPrice, zone: .AvailabilityZone}'
@l4u
l4u / keybase.md
Created July 15, 2015 08:17
keybase.md

Keybase proof

I hereby claim:

  • I am l4u on github.
  • I am l4u (https://keybase.io/l4u) on keybase.
  • I have a public key whose fingerprint is 0BBE 8C5E 9F1A 5AD1 95D0 70A2 D9E8 3B46 B9DF 559E

To claim this, I am signing this object:

@l4u
l4u / Dockerfile
Created June 22, 2015 11:03
Rails Docker docker-compose cached gems
FROM ruby:2.2.2
RUN apt-get update -qq && apt-get install -y build-essential
# for postgres
RUN apt-get install -y libpq-dev
# for nokogiri
RUN apt-get install -y libxml2-dev libxslt1-dev