This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/cabo/stlink | |
# https://blog.danman.eu/2-usb-crypto-token-for-use-with-gpg-and-ssh/ | |
sudo ./upgrade_by_passwd.py -f ../regnual/regnual.bin ../src/build/gnuk-vidpid.bin | |
sudo st-flash erase && st-flash --reset write ~/src/gnuk/src/build/gnuk-vidpid.bin 0x08000000 | |
-- or -- | |
~/src/stlink/build/Debug/st-flash reset && \ | |
~/src/stlink/build/Debug/st-flash erase && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks https://lists.gnupg.org/pipermail/gnupg-users/2016-May/055985.html | |
# | |
# To specify the passphrase on the command line: | |
# | |
# gpg --pinentry-mode loopback --passphrase "secret" --batch --generate-key x25519-gen.gpgbatch | |
%echo Generating ed25519 primary and cv25519 subkey | |
Key-Type: eddsa | |
Key-Curve: Ed25519 | |
Key-Usage: sign |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// some of this was adapted from https://gist.github.com/eliquious/9e96017f47d9bd43cdf9 | |
func (sg SecretGenerator) GetPGPKey(passphrase string) string { | |
var config packet.Config | |
config.Time = func() time.Time { | |
return time.Date(2017, 1, 1, 0, 0, 0, 0, time.UTC) | |
} | |
uid := packet.NewUserId(sg.GetFriendlyName("main"), "", "") | |
if uid == nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess | |
SOURCES = [ | |
('npth', 'npth-1.5'), | |
('ntbtls', 'ntbtls-0.1.2'), | |
('libgpg-error', 'libgpg-error-1.27'), | |
('libassuan', 'libassuan-2.5.1'), | |
('libgcrypt', 'libgcrypt-1.8.2'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// For Wemos Lolin ESP32 OLED Module For Arduino ESP32 OLED WiFi + Bluetooth | |
// | |
// All of these are available in Arduino Library Manager | |
#include <ArduinoJson.h> | |
#include <HTTPClient.h> | |
#include <SSD1306.h> | |
#include <WiFiMulti.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: | |
# | |
# auto_download_microbit.py dir_to_watch dir_of_microbit | |
import os.path, shutil, sys, time | |
from watchdog.observers import Observer | |
from watchdog.events import PatternMatchingEventHandler | |
src = sys.argv[1] if len(sys.argv) > 1 else '.' | |
dst = sys.argv[2] if len(sys.argv) > 2 else '/Volumes/MICROBIT/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# sudo pip install --upgrade google-api-python-client | |
from apiclient.discovery import build | |
from oauth2client import client, GOOGLE_TOKEN_URI | |
import argparse | |
import httplib2 | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Generates refresh token for Google API.""" | |
# This is adapted from generate_refresh_token.py in | |
# https://github.com/googleads/googleads-python-lib | |
import argparse | |
import sys | |
from oauth2client import client, GOOGLE_TOKEN_URI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat /dev/urandom | base64 | tr -cd [:alnum:] | tr -d [0OIl] | head -c 22 | |
# same but emit QR code | |
$ cat /dev/urandom | base64 | tr -cd [:alnum:] | tr -d [0OIl] | head -c 22 | qr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All the code from http://billauer.co.il/blog/2010/10/encrypted-iso-dvd-luks-dm-crypt-fedora-linux/ | |
MB_COUNT=100 | |
VOL_NAME=MyVolName | |
DIR_TO_COPY=/tmp/mydir | |
# Make a 100MB disk image | |
dd if=/dev/zero of=disk.img bs=1M count=$MB_COUNT | |
# become root |