Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
def _rot90(num):
counter = 0
bits = "{:09b}".format(num)
tmp = list(bits)
for idx in [6,3,0,7,4,1,8,5,2]:
tmp[idx] = bits[counter]
counter += 1
atoponce /
Last active Nov 26, 2020
Three password generators in ZSH

Each generator yields 128-bit security passwords. Each generator can take an optional numeric password to generate that many passwords. They should be placed in your ~/.zshrc. They are not portable across other shells.

gen-monkey-pass generates visually unambiguous random meaningless strings using Crockford's base32. Requires only ZSH:

% gen-monkey-pass 
% gen-monkey-pass 3
atoponce / dbus-uuidgen.txt
Created Nov 14, 2020
D-bus UUID generator
View dbus-uuidgen.txt
$ for i in {1..50}; do printf "%02d: " $i; dbus-uuidgen; done
01: f7ce22e1c3ec82343e11a8035faf4860
02: 5973bebcc026a65797ed89a75faf4860
03: a3df92986e08d099b11924ab5faf4860
04: 5fa5585b4808fc2a2286a28b5faf4860
05: d2fda8ca45322051fecc8a685faf4860
06: 0ba63db9be3cee781275bd805faf4860
07: fb108d510955ba08f8c6bdd45faf4860
08: 60f97e492e5339f39a0783fd5faf4860
09: 55d7e5721db10bf2389156f55faf4860
atoponce /
Last active Dec 2, 2020
Convert any binary to an image

Convert any binary to PNG

This walk through comes from @GalacticFurball who tweeted two images representing the youtube_dl source code as of 2020-09-20. They mentioned later in the thread that they struggled converting the gzip-compressed tarball of the source code with Imagemagick to a PNG, so they ended up using a 3rd party website to do the work. This Gist will show you how to do it cleanly and exactly.


If you would like to convert any non-image binary into PNG, Imagemagick makes this trivial. I will be executing the commands on a Debian Linux system, so you may need to adjust the commands for BSD, macOS, or Windows as necessary.

atoponce /
Last active Sep 4, 2020
Tutorial for generating Bitcoin wallet mnemonic seeds by hand (almost)

Creating a BIP39 mnemonic 100% by hand (almost)

This document shows how we can create Bitcoin wallet mnemonic seeds by hand in a provably secure way. It follows the BIP-39 specification. The steps are straight forward, and we'll go into each of them in detail with this doc.

The steps are as follows:

  • Generate cryptographically secure bits
    • Divide into 11-bit bytes
atoponce / dicekey-wordlist-14400.txt
Last active Oct 15, 2020
14,400 word list for the DiceKey
View dicekey-wordlist-14400.txt
AB1N a
AB1E aah
AB1S abacus
AB1W abide
AB2N able
AB2E abroad
AB2S absurd
AB2W acadia
AB3N ace
AB3E aced
atoponce / index.html
Last active Aug 29, 2020
Clean room DiceKey web generator
View index.html
<!doctype html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Secure DiceKey Generator</title>
function secureRandGen(count) {
let min = (-count >>> 0) % count;
let randBytes = new Uint32Array(1);
const crypto = window.crypto || window.msCrypto;
atoponce /
Last active Jun 17, 2020
World AeroPress Championship winning recipes

World AreoPress Championship Winning Recipes


Just a basic table. See the full instructions at the WAC winners page.

World AeroPress Competition recipes are typically concentrate-then-dilute. This leads to higher losses of brewed coffee in the discarded puck. The coffee is generally coarser and brewed at lower temperatures to produce high acidity, but it also brews underextracted. Higher quantities of coffee are used (30+ grams)

atoponce / hash.vb
Created Jun 9, 2020
15-bit Pearson hash function for LibreOffice Calc
View hash.vb
' REM 15-bit Pearson Hash, because I can't figure out 32-bits for FNV-1a
Function Hash(strText as String) as Long
Dim h As Long
Dim nextChar As String
Dim temp As Long
Dim table(0 To 32767) as Long
Dim seed as Long
seed = 1
h = len(strText) MOD 32768
atoponce /
Last active May 26, 2020
Alternate EFF long list in Deseret and Shavian alphabet characters

Alternate EFF long list in Deseret and Shavian alphabet characters

An Idea for Passphrases

Knowing the growing support for Unicode support on the web, including HTML forms, such as usernames and passwords, I decided to create two English spelling reform Diceware word lists in the Deseret Alphabet and the Shavian Alphabet.

You can’t perform that action at this time.