Skip to content

Instantly share code, notes, and snippets.



  • Cyberspace
View GitHub Profile
mbarkhau /
Last active May 5, 2022
Snippet to create electrum seed from rolls of a six sided dice and a secret passphrase.
#!/usr/bin/env python
"""Electrum Wallet Seed Generator (use at own risk).
-h --help
-s --seed-bits=<bits> Size of the wallet seed in bits
[default: 256]
-i --iterations=<iterations> Number of pbkdf2 iterations
[default: 500000]
mbarkhau / wordlist_256.txt
Last active May 5, 2022
View wordlist_256.txt
# The goal behind this wordlist is to make
# a 1:1 encoding between words/symbols and bytes. It should
# be possible to memorize data encoded with these words.
# - Each word has a unique two letter prefix.
# - Each word has high number of syllables, to enable
# reliable verbal communication (like nato code words).
# - Each word has a levenshtein distance >= 3 to any other word
# in the wordlist.
#!/usr/bin/env python3
# Based on this
# I created this boilerplate which I think is a bit nicer to use.
import sys
class AttrDict(dict):
mbarkhau /
Last active Apr 1, 2022
mimimal arg parsing
import sys
def getarg(argname, args=sys.argv[1:]):
long_arg = '--' + argname
short_arg = '-' + argname[:1]
for idx, arg in enumerate(args):
if arg.startswith(long_arg):
if arg == long_arg:
# check for parameter
mbarkhau / placepaintbot4.js
Last active Nov 12, 2021
View placepaintbot4.js
// ==UserScript==
// @name PlacePaintBot
// @namespace
// @version 0.4
// @description Domination of Place!
// @author mbarkhau
// @match
// @grant none
// ==/UserScript==
mbarkhau /
Last active Sep 7, 2021 — forked from krisrak/
Python script to download urls in a csv file
import os
import sys
import csv
import urllib
filename = sys.argv[1]
url_name = sys.argv[2]

MAD Bitcoin Energy Savings

Imagine you're a bitcoin miner. You have a huge power bill, you have your capital that is depreciating like a glass of milk in the sunshine, but as long as the price per bitcoin is high and the local government isn't driving you out of the country, things are pretty good. I mean, figuratively speaking, you're printing money.

But think about this for a minute. It's not as if the bitcoin network would work any worse if you and 99% of the mining capacity would turn

# sudo apt-get install xml-twig-tools
rm -rf "$_dest"
mkdir -p "$_dest"
mbarkhau /
Last active Jun 22, 2021
#!/usr/bin/env python3
"""A sublime-text build script, to do the right thing?.
This script takes the currently open file as a
reference point and uses it to determine which commands
to run. This means that you don't have to select a build
commands when switching between projects, the fact that
you have a different file open is enough to indicate
which build you want to run.
mbarkhau / .bashrc
Last active Apr 15, 2021
sublime helpers
View .bashrc
alias tiga='tig --all'
alias gs='git status --untracked-files=no'
alias gss='git status --short'
alias gsss='git status'
alias gls="git for-each-ref --count=15 --sort=-committerdate --format='%(objectname:short) %(committerdate:iso) %(authorname) %(refname:short)' refs/heads/"
alias gd="git diff --color-words"
alias gds="git diff --stat"
alias gap="git add --patch"
alias gaf="git add" # add file