This file contains 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
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
function annotate { | |
declare -A PEER_COMMENTS |
This file contains 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 python3 | |
""" | |
run this to keep the watchdog happy | |
curl localhost:8080 | |
or from js | |
setInterval(function(){ fetch("localhost:8080"); }, 3000); |
This file contains 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 python3 | |
## Try all of the passwords for gpg openpgp key | |
from subprocess import run | |
p = open("/tmp/passwords.csv") | |
passwords = set() | |
for line in p.readlines(): | |
passwords.add(line.split(",")[2].strip().replace('"','')) | |
for password in passwords: | |
print(password) |
This file contains 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 python3 | |
from pprint import pprint | |
from subprocess import run | |
passwords = set() | |
with open("/tmp/passwords.csv") as f: | |
for line in f.readlines(): | |
passwords.add(line.split(',')[2].strip().strip('"')) | |
for password in passwords: |
This file contains 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
void __attribute__ ((noinline)) print_semihosting(const void *buf, uint32_t size) | |
{ | |
uint32_t args[3]; | |
args[0] = 1; | |
args[1] = (uint32_t)buf; | |
args[2] = size; | |
asm( "mov r0, #5\n" | |
"mov r1, %0\n" | |
"bkpt 0x00AB" : : "r"(args) : "r0", "r1", "memory"); | |
} |
This file contains 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
def _slow_crc(data, seed=0xFFFF_FFFF, polynomial=0x04C11DB7): | |
""" | |
STM32 CRC that is actually CRC-32/MPEG2 but input data is read as litle-endian (not big-endian like MPEG) | |
""" | |
crc = seed | |
# Pad data if needed | |
pad_len = len(data) % 4 | |
if pad_len > 0: | |
words = array.array('I', data[:-pad_len]) |
This file contains 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 python3 | |
""" XInput Game Controller APIs | |
Pure Python implementation for reading Xbox controller inputs without extra libs | |
Copyright (C) 2020 by Arti Zirk <[email protected]> | |
Permission to use, copy, modify, and/or distribute this software for any purpose | |
with or without fee is hereby granted. |
This file contains 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
/dts-v1/; | |
/plugin/; | |
/* Based on https://github.com/wens/linux/commits/sun4i-drm-tve-vga-wip */ | |
/* Tested with Cubetruck */ | |
/* save it somewhere and run sudo armbian-add-overlay vga.dts */ | |
/ { | |
compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5"; |
This file contains 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 python3 | |
""" | |
This script implements systemd-nspawn MAC aadress generation algorithm | |
""" | |
import sys | |
import struct | |
from subprocess import run | |
import siphashc # https://pypi.org/project/siphashc/ |