Skip to content

Instantly share code, notes, and snippets.

View rgerganov's full-sized avatar

Radoslav Gerganov rgerganov

View GitHub Profile
@rgerganov
rgerganov / rfid.c
Created December 31, 2016 13:04
Arduino RFID reader
/* Arduino program for DIY FSK RFID Reader
* See description and circuit diagram at http://playground.arduino.cc/Main/DIYRFIDReader
* Tested on Arduino Nano and several FSK RFID tags
* Hardware/Software design is based on and derived from:
* Arduino/Timer1 library example
* June 2008 | jesse dot tane at gmail dot com
* AsherGlick: / AVRFID https://github.com/AsherGlick/AVRFID
* Micah Dowty:
* http://forums.parallax.com/showthread.php?105889-World-s-simplest-RFID-reader
*
@rgerganov
rgerganov / build.md
Last active December 20, 2023 08:33
Pixel 8 Pro results
➜  build-android2 git:(master) ✗ make -j
[  1%] Generating build details from Git
[  2%] Building C object CMakeFiles/ggml.dir/ggml.c.o
[  3%] Building C object CMakeFiles/ggml.dir/ggml-alloc.c.o
[  4%] Building C object CMakeFiles/ggml.dir/ggml-backend.c.o
[  5%] Building C object CMakeFiles/ggml.dir/ggml-quants.c.o
-- Found Git: /usr/bin/git (found version "2.25.1") 
Scanning dependencies of target build_info
[  6%] Building CXX object common/CMakeFiles/build_info.dir/build-info.cpp.o
@rgerganov
rgerganov / dump_signatures.py
Last active September 28, 2023 11:13
Get precomputed signatures from AirReceiver
#!/usr/bin/env python3
import os
import sys
import time
import subprocess
from datetime import date, timedelta
ADB_PATH = '/tmp/platform-tools/adb'
AUTH_CMD = '/tmp/auth'
IP_ADDR = '192.168.1.213'
@rgerganov
rgerganov / th100-howto-wg.md
Last active May 21, 2023 19:50
TH100 Wireguard HOWTO

Connecting TH-100 STBs to Wireguard VPN server

This guide shows how to connect TH-100 STBs to a Wireguard VPN server. On the server side you need a Linux box with Wireguard installed. For Debian/Ubuntu simply run:

$ sudo apt install wireguard
$ sudo sysctl -w net.ipv4.ip_forward=1

Your TH-100 STBs needs to run firmware version 286 or later.

@rgerganov
rgerganov / nss-db.sh
Last active March 14, 2023 06:37
Create NSS db for Firefox/Chrome/LibreOffice
# build and install libccid from source
# do not install opensc from packages, build it from source
sudo apt-get install libnss3-tools
cd $HOME
mkdir -p .pki/nssdb
modutil -dbdir sql:.pki/nssdb -add "stampit" -libfile /usr/local/lib/opensc-pkcs11.so
modutil -dbdir .pki/nssdb -add "stampit" -libfile /usr/local/lib/opensc-pkcs11.so
@rgerganov
rgerganov / SimpleHTTPServerWithUpload.py
Created May 12, 2022 14:53 — forked from smidgedy/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/env python3
########################################################################
#
# Simple HTTP server that supports file upload for moving data around
# between boxen on HTB. Based on a gist by bones7456, but mangled by me
# as I've tried (badly) to port it to Python 3, code golf it, and make
# It a little more robust. I was also able to strip out a lot of the
# code trivially because Python3 SimpleHTTPServer is a thing, and the
# cgi module handles multipart data nicely.
#
@rgerganov
rgerganov / vmrc_attach.sh
Created March 22, 2017 08:33
Virtual USB Drive
#!/usr/bin/env sh
if [ "$#" -ne 5 ]; then
echo "Usage: $0 <host> <user> <pwd> <vm-id> <dev-id>"
exit 1
fi
echo "attach $1 $2 $3 $4 $5" | nc localhost 9999
@rgerganov
rgerganov / passcode.py
Created July 30, 2021 12:01
APRS passcode generator
#!/usr/bin/env python3
import sys
if __name__ == '__main__':
callsign = sys.argv[1].upper()
print(callsign)
hash = 0x73e2
for i in range(0, len(callsign), 2):
hash ^= ord(callsign[i]) << 8
if i + 1 < len(callsign):
@rgerganov
rgerganov / softhsmv2.py
Last active April 13, 2021 07:27
SoftHSMv2
#!/usr/bin/env python3
# This script derives the masterKey and tokenKey from a SoftHSMv2 token.
# For more details: https://xakcop.com/post/softhsmv2/
import sys
from Cryptodome.Hash import SHA256
from Cryptodome.Cipher import AES
from Cryptodome.Util.Padding import unpad
PBE_ITERATION_BASE_COUNT = 1500
@rgerganov
rgerganov / create-vmdk.sh
Created August 26, 2020 08:44
Create VMDK disk suitable for syzkaller
#!/bin/bash
VMDK_FILE="syzkaller.vmdk"
VMDK_SIZE="3GB"
NBD_DEV="/dev/nbd0"
NBD_DEVP1="${NBD_DEV}p1"
MOUNT_DIR="/tmp/vmdk"
ROOTFS="${1:-stretch.img}"
echo "Using ROOTFS=$ROOTFS"