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

@l4u
l4u / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@l4u
l4u / elixir.rb
Created September 29, 2012 17:01 — forked from josevalim/elixir.rb
Elixir Homebrew recipe HEAD
# Install this recipe with:
# brew install --HEAD --env=std https://raw.github.com/gist/3804582/da937661db644879c41a8cb2b4b24a7d1e9f3b67/elixir.rb
require 'formula'
class ErlangInstalled < Requirement
def message; <<-EOS.undent
Erlang is required to install.
You can install this with:
@l4u
l4u / pastie.rb
Created March 5, 2012 03:45 — forked from rriemann/pastie.rb
Paste script to paste to pastie.org from command line. Written in ruby
#!/usr/bin/env ruby
# kate: remove-trailing-space on; replace-trailing-space-save on; indent-width 2; indent-mode ruby; syntax ruby;
require 'net/http'
require 'optparse'
require 'timeout'
require 'cgi'
require 'uri'
class Hash
options = {:q=>'Starbucks', :category=>'Coffee & Tea', :radius=>5}
SimpleGeo::Client.get_places(37.772445, -122.405913, options)
zh-TW:
errors:
messages:
not_found: "沒有找到"
already_confirmed: "已被確認過了"
not_locked: "被鎖定了"
not_saved:
one: "有一個錯誤導致%{resource}不能被儲存:"
other: "有 %{count} 個錯誤導致%{resource}不能被儲存:"
def shipping_country_name
shipping_address.try(:country).try(:name)
end