Skip to content

Instantly share code, notes, and snippets.

@delvison
delvison / cron-docker-compose.yml
Created November 30, 2023 00:04
An example of running a cron job in docker compose
---
version: "3"
services:
cron:
container_name: cron
image: alpine:3.6
entrypoint:
- sh
- -euc
- |
@delvison
delvison / minimal-zsh-prompt.md
Created September 6, 2023 11:34
minimal zsh prompt

A minimal zsh prompt.

Add to .zshrc

# prompt
autoload -Uz vcs_info # enable vcs_info
precmd () { vcs_info } # always load before displaying the prompt
zstyle ':vcs_info:*' formats ' %s(%b)' # git(main)
PS1='%n@%F{magenta}%m %F{green}%/%f$vcs_info_msg_0_ $ '
#!/bin/bash
readonly bip39_list="bip-39-eng-wordlist.txt"
check_wordlist() {
if [ ! -f "${bip39_list}" ]; then
curl -s \
https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt \
> "${bip39_list}"
fi
@delvison
delvison / tapsigner-decrypt-backup.md
Last active January 14, 2025 14:11
How to decrypt Tapsigner backup

Tapsigner is an inexpensive Bitcoin signing device that holds your private keys on an NFC card. As of writing this, nunchuck is the only mobile wallet to support it.

Backups of the private key are done so in a AES-128-CTR encryption using a key printed on the back of the card.

To decrypt this key and obtain its xprv value with openssl in cli run the following:

openssl aes-128-ctr -iv 0 -K "<BACKUP_KEY_ON_CARD>" -in backup.aes
#!/bin/bash
# decrypt an encrypted QR code
zbarimg "${1}" --raw -q | gpg -d | base64 -d
#!/bin/bash
# create an encrypted QR code
echo -n "$@" | base64 | gpg -c --armor -o - | qrencode -o encrypted_qr.png
apiVersion: v1
kind: Pod
metadata:
name: $(USER)-test
namespace: default
spec:
containers:
- name: $(USER)-test
imagePullPolicy: Always
image: ubuntu