Skip to content

Instantly share code, notes, and snippets.

@kpe
kpe / MathJax based LaTeX plugin for TiddlyWiki 5.md
Last active March 29, 2021 21:36
MathJax based LaTeX plugin for TiddlyWiki 5

LaTeX plugin for TiddlyWiki 5 (based on MathJax)

(based on http://mathjax-tw5.kantorsite.net/)

To use with NodeJS create a plugins/mathjax/ directory in your wiki containing the two files (plugin.info and init.js), i.e.

plugins/
   mathjax/
      plugin.info
      init.js
tiddlers/
@kpe
kpe / How to decrypt an SMIME PKCS7 mail using a PKI key card.md
Last active February 1, 2021 10:59
How to decrypt an SMIME PKCS7 mail using a PKI key card

Make sure the openssl pkcs11 engine provided by OpenSC/libp11 can talk to your PKI card:

  $ openssl engine pkcs11 -t -c -pre MODULE_PATH:/path/to/your/opensc-pkcs11-plugin-module.so
  (pkcs11) pkcs11 engine
  [Success]: MODULE_PATH:/path/to/your/OpenSC-pkcs11-plugin-module.so
  [RSA]
 [ available ]
@kpe
kpe / diceware.py
Created May 19, 2021 16:14
bip39-diceware-helper
import os
import tempfile
import random
from typing import Tuple, List
WORDLIST_URL = "https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt"
WORDLIST_LOCAL = "/tmp/"
USE_RANDOM = False
@kpe
kpe / $OpenAI-Whisper-Demo.md
Last active June 20, 2023 10:05
OpenAI Whisper Demo

OpeanAI Whisper Demo

If you have docker, try this:

cat <<EOF > /tmp/docker-init.sh
apt update && apt install python3-pip ffmpeg git -y
git clone https://gist.github.com/kpe/6a70395ce171ffee43d927eaf90b81b6 /tmp/whisper
cd /tmp/whisper
pip3 install -r requirements.txt
python3 -m whisper_demo