Skip to content

Instantly share code, notes, and snippets.

@geekman
geekman / til311-tester.ino
Created September 14, 2016 13:41
Arduino sketch for testing TIL311 / DIS1417 displays
/*
* TIL311 / DIS1417 tester
*
* MSB_PIN -> input D
* input C
* input B
* LSB_PIN -> input A
*
* also hook up LATCH_PIN and BLANKING_PIN accordingly
*
@geekman
geekman / remove-onedrive-explorer.reg
Created September 16, 2016 09:51
remove OneDrive from Explorer sidebar
Windows Registry Editor Version 5.00
; see https://www.tekrevue.com/tip/remove-onedrive-file-explorer-sidebar-windows-10/
[HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
"System.IsPinnedToNameSpaceTree"=dword:00000000
@geekman
geekman / nat.sh
Last active November 29, 2016 02:46
quick-and-dirty NAT setup script
#!/bin/sh
#
# sets up NAT to allow $LOCAL_IF to get to the Internet via $EXT_IF
# don't run this twice as it keeps appending iptables rules
#
set -e
LOCAL_IF=${1:-usb0}
EXT_IF=${2:-eth0}
@geekman
geekman / parse_benc.py
Created January 16, 2017 15:54
Python implementation of bencoding (used in torrents)
#
# Python implementation of bencoding (used in torrents)
#
# 2017.01.16 darell tan
#
import sys
import re
from collections import OrderedDict
@geekman
geekman / myusbgadget
Created January 17, 2017 02:47
Pi Zero multiple USB gadgets minimal example
#!/bin/bash -e
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir g && cd g
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
@geekman
geekman / parse_keybag.py
Created March 3, 2017 17:58
extract & parse the BackupKeyBag from an iTunes Backup
#!/usr/bin/env python
#
# extracts and parse BackupKeyBag
#
# 2017.02.04 darell tan
#
from plist import *
import struct
import sys
@geekman
geekman / bintime.go
Created March 17, 2017 03:32
playing around with time.Time struct in golang
package main
import (
"fmt"
"time"
"encoding/binary"
)
type t struct {
tm time.Time
@geekman
geekman / regions.html
Created March 27, 2017 03:20
visualizing overlapping rectangular regions
<!-- overlapping region visualization -->
<html>
<style>
div {
background: #00f;
opacity: .5;
position: absolute;
color: #fff;
font-family: sans-serif;
text-align: center;
@geekman
geekman / bruteforce.go
Created April 4, 2017 15:32
flexible bruteforcer skeleton in Golang
package main
import "fmt"
type state struct {
digit [2]int
negative bool
}
const MAX_NUMBER = 16
@geekman
geekman / ihex_cksum.py
Last active July 17, 2017 18:30
computes/verifies the checksum for Intel HEX files
#
# computes/verifies the checksum for Intel HEX files
#
# 2017.07.16 darell tan
#
from binascii import unhexlify, hexlify
import struct
import sys