Skip to content

Instantly share code, notes, and snippets.

@geekman
geekman / foxit_hist.py
Created August 31, 2015 10:25
dumps Foxit Reader history from registry
#
# lists Foxit Reader last opened files from registry
# 2015.08.31 darell tan
#
from _winreg import *
from ctypes import windll, create_unicode_buffer
def GetLongPathName(path):
@geekman
geekman / jffs2.py
Created October 26, 2015 16:30
JFFS2 scripts
#!/usr/bin/env python
#
# tool to parse JFFS2 images
# and more importantly, guess the erase block size
#
# 2015.10.19 darell tan
#
from struct import unpack
from argparse import ArgumentParser
@geekman
geekman / eject.py
Created December 23, 2015 15:55
ejects the DVD-ROM drive (using Python)
#!/usr/bin/env python
#
# ejects the cdrom drive
#
# kernel references:
# - Documentation/ioctl/cdrom.txt
# - include/uapi/linux/cdrom.h
#
from fcntl import ioctl
@geekman
geekman / bruteforce-cfg1.go
Created December 30, 2015 08:35
32c3CTF 2015 bruteforce tool for "config.bin"
/*
* bruteforce-cfg1.go
* to bruteforce CFG1 encryption passwords for 32c3CTF "config.bin"
*
* @zxcvgm
*/
package main
import (
brutedict "github.com/dieyushi/golang-brutedict"
@geekman
geekman / max6675_test.ino
Created May 12, 2016 15:16
MAX6675 thermocouple converter Arduino code sample
//
// MAX6675 thermocouple converter Arduino code sample
//
// 2016.05.12 darell tan
//
#include <SPI.h>
static const int CS_PIN = 13;
@geekman
geekman / massflash.py
Created June 21, 2016 08:03
automated ESP8266 programming station to mass flash large quantity of devices quickly
#!/usr/bin/env python
#
# automated ESP8266 programming station
# monitors for inserted serial devices and calls esptool to flash them
# written to mass flash entire batches of ESP8266 devices quickly
# $ pip install esptool pyudev
#
# 2016.06.16 darell tan
#
@geekman
geekman / ethtool-noautoneg@.service
Created July 4, 2016 16:29
systemd unit to disable auto-negotiation for Ethernet ports
[Unit]
Description=Disable auto-negotiation for %i
Requires=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
ExecStart=/usr/bin/ethtool -s %i duplex full speed 100 autoneg off
Type=oneshot
[Install]
@geekman
geekman / ipkg_deps.py
Created July 6, 2016 08:25
shows unsatisfied dependencies for a set of ipkg files
#!/usr/bin/python
#
# show unsatisfied depedencies for a set of ipkg files
# useful when creating a self-sufficient set of packages offline
#
# 2016.07.05 darell tan
#
import tarfile
import sys
@geekman
geekman / i2c-detect.ino
Created July 23, 2016 12:55
Arduino sketch to scan for I2C addresses
/*
* i2c-detect.ino
* just like the Linux utility
*
* 2016.01.09 darell tan
*/
#include <Wire.h>
int led_pin = 13;
@geekman
geekman / Tracer.pm
Created August 17, 2016 02:30
LabyREnth 2016 bowie.pl Solver
#
# Perl debugger module to deal with bowie.pl (LabyREnth CTF)
# save this under ./Devel/Tracer.pm,
# then run `perl -d:Tracer bowie.pl < /dev/null`
#
# 2016.07.22 @zxcvgm
#
package DB;