Skip to content

Instantly share code, notes, and snippets.

1: 1776 = 1 * 1492 + 284
2: 1492 = 5 * 284 + 72
3: 284 = 3 * 72 + 68
4: 72 = 1 * 68 + 4
5: 68 = 17 * 4 + 0
-----------------------------------------------
6: 4 = 72 - 1(68) # start from line 4, solved for the gcd
7: 4 = 72 - 68
8: 4 = 72 - (284-3(72)) # substitute from line 3, solved for 68
9: 4 = (1492 - 5(284)) - (284-3((1492 - 5(284)))) # substitute from line 2, solved for 72
@not-inept
not-inept / usbToKey.py
Created November 13, 2018 16:41
Python script for converting usb keyboard HID data to a string (Python 2.7)
#!/usr/bin/python
# Based off a script originally found here: https://teamrocketist.github.io/2017/08/29/Forensics-Hackit-2017-USB-ducker/
# Additions include: More keys, deletion
KEY_CODES = {
0x04:['a', 'A'],
0x05:['b', 'B'],
0x06:['c', 'C'],
0x07:['d', 'D'],
0x08:['e', 'E'],
@not-inept
not-inept / per_process_cpu_usage.py
Last active March 28, 2019 20:47
Produces a CSV with
import subprocess
import signal
import time
import sys
import csv
# This is set in the first call to run_top()
headers = []
def get_column_starts(headerStr):
global headers