Skip to content

Instantly share code, notes, and snippets.

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

; Quick miniKanren-like code
;
; written at the meeting of a Functional Programming Group
; (Toukyou/Shibuya, Apr 29, 2006), as a quick illustration of logic
; programming. The code is really quite trivial and unsophisticated:
; it was written without any preparation whatsoever. The present file
; adds comments and makes minor adjustments.
;
; $Id: sokuza-kanren.scm,v 1.1 2006/05/10 23:12:41 oleg Exp oleg $
#!/usr/local/Gambit-C/bin/gsi
; Copyright (C) 2004 by Marc Feeley, All Rights Reserved.
; This is the "90 minute Scheme to C compiler" presented at the
; Montreal Scheme/Lisp User Group on October 20, 2004.
; Usage with Gambit-C 4.0:
;
; % ./90-min-scc.scm test.scm
@m00nlight
m00nlight / DFA.hs
Last active August 29, 2015 14:18 — forked from romac/DFA.hs
{-# LANGUAGE ExistentialQuantification #-}
module DFA (
DFA,
runDFA,
scanDFA,
isAccepting,
) where
import Data.Set (Set)
@m00nlight
m00nlight / banan.bmp
Last active September 14, 2016 19:28 — forked from skuro/nonograms-dojo.clj
(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1)
(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1)
(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1)
(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1)
(1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 0)
(0 0 0 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1)
(1 1 1 1 1 1 0 0 0 0 0 1 0 1 1 1 1 1 1 1)
(1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1)
(0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1)
(1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0)