brew install gnupg
brew install pinentry-mac
gpg --version
gpg (GnuPG) 2.1.20
Use Platypus to create org.codemedic.SSHHandler app, as an ssh
URL handler, making use of the applescript below.
Not sure, but I am told to run it once to get the URL handler registered.
Homebrew build logs for mpv on Ubuntu 16.04.7 LTS | |
Build date: 2021-01-19 13:00:56 |
#!/bin/bash | |
######################################################################### | |
# # | |
# # | |
# NATO String converter # | |
# # | |
# Description: converts string (first parameter given) # | |
# to NATO phonetics-alphabet # | |
# # |
void | |
blow_bubbles_till(bool& condition) | |
{ | |
static const char* sprite = ". o O @ *"; | |
unsigned frame = 0; | |
while (!condition) { | |
boost::this_thread::sleep_for(boost::chrono::milliseconds(250)); | |
std::cerr << "\r‗‗" << std::string(sprite + frame * 5, 5) << ' '; | |
frame = (frame + 1) % 5; | |
} |
Run pdflatex --shell-escape gpgbackup.tex
to produce a pdf that you can print and lock away.
In order to recover the key, you will have to scan extract individual QR Codes with names IMGa.png
, IMGb.png
, IMGc.png
and IMGd.png
, as given in the name of each figure, then run the recovery commands.
NOTE: The above command WILL leave some artefacts in /tmp
which should be removed using the command rm /tmp/IMG*png
PS: Original formula for this gist was from @costrouc.
# Heavily depends on: | |
# libqrencode (fukuchi.org/works/qrencode/) | |
# paperkey (jabberwocky.com/software/paperkey/) | |
# zbar (zbar.sourceforge.net) | |
# Producing the QR codes: | |
# Split over 4 codes to ensure the data per image is not too large. | |
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp | |
split temp -n 4 IMG | |
for f in IMG*; do cat $f | qrencode -o $f.png; done |
Caveat: This was done as a quick-fix to aleviate my pain; There could be a better way to do this. Please do leave comments and suggestions.
This script is meant to be used as .bashrc, in order to make the transition from Linux to MacOS less painful. It makes available GNU tools and utils in your PATH so that they can be invoked effortlessly. It also allows you to leave an untainted terminal setup for anything very native to MacOS.
# based on https://github.com/mathieu-aubin/c7repos/blob/master/functions/bash-colors | |
__print_color_row() { | |
local color | |
color=$(printf '%03d' "$1") | |
echo -ne "\\033[1;48;5;${color}m \\\\033[48;5;${color}m \\033[0m"; | |
echo -ne "\\033[1;7;38;5;${color}m\\\\033[7;38;5;${color}m \\033[0m"; | |
echo -ne " \\033[1;38;5;${color}m\\\\033[1;38;5;${color}m\\033[0m"; | |
echo -ne " \\033[38;5;${color}m\\\\033[38;5;${color}m\\033[0m"; | |
echo -ne " \\033[2;38;5;${color}m\\\\033[2;38;5;${color}m\\033[0m"; |
#!/usr/bin/env bash | |
if ! aws_bin="$(which aws)" 2>/dev/null; then | |
echo "aws cli is missing; you can get it from https://aws.amazon.com/cli/" | |
exit 1 | |
fi | |
if ! jq_bin="$(which jq)" 2>/dev/null; then | |
echo "jq is missing; you can get it from https://stedolan.github.io/jq/" | |
exit 1 |