Skip to content

Instantly share code, notes, and snippets.

@lynaghk
lynaghk / taxes.smt2
Created August 1, 2022 18:34
S-Corp tax optimization with the Z3 Theorem Prover
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Solo freelancer's S-Corp tax optimization
;;
;; Assumes an unmarried single-shareholder and tons of other stuff.
;; I'm not a tax professional, no guarantees here, probably typos, etc. Come on!
;; Run with https://github.com/Z3Prover/z3
;;
;; See also my notes at https://kevinlynagh.com/financial-plan/
@justanotherdot
justanotherdot / box.txt
Last active March 28, 2022 11:41
Box unicode characters for diagrams in documentation, terminals, etc.
─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ╌ ╍ ╎ ╏
┌ ┍ ┎ ┏ ┐ ┑ ┒ ┓
└ ┕ ┖ ┗ ┘ ┙ ┚ ┛
├ ┝ ┞ ┟ ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫
┬ ┭ ┮ ┯ ┰ ┱ ┲ ┳
@diondokter
diondokter / lib.rs
Created July 18, 2020 09:34
Final rust code for Oxidize talk of Dion Dokter: How can we write the best device driver?
use std::marker::PhantomData;
// -------------------- HARDWARE INTERFACE --------------------
pub trait Interface {
fn enable_cs(&mut self);
fn disable_cs(&mut self);
fn transfer(&mut self, value: u8) -> u8;
}
// -------------------- LOW LEVEL DEVICE INTERFACE --------------------
@arkadiyt
arkadiyt / cryptopals_set_8.md
Last active April 11, 2025 22:48
Cryptopals Set 8

Cryptopals is a set of cryptographic challenges, originally published here: https://cryptopals.com

Set 8 of the challenges was never published publicly, until late March 2018. However the cryptopals website was not updated to include the challenges. This gist compiles the 8th set of the Cryptopals challenges.

title link
57. Diffie-Hellman Revisited: Small Subgroup Confinement https://toadstyle.org/cryptopals/513b590b41d19eff3a0aa028023349fd.txt
58. Pollard's Method for Catching Kangaroos https://toadstyle.org/cryptopals/3e17c7b35fcf491d08c989081ed18c9a.txt
59. Elliptic Curve Diffie-Hellman and Invalid-Curve Attacks https://toadstyle.org/cryptopals/a0833e607878a80fdc0808f889c721b1.txt
@seanjensengrey
seanjensengrey / octal_x86.txt
Last active December 4, 2025 23:58
x86 is an octal machine
# source:http://geocities.com/SiliconValley/heights/7052/opcode.txt
From: mark@omnifest.uwm.edu (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86
@geohot
geohot / get_vin.py
Created September 13, 2017 08:39
Gets VIN from Prius
#!/usr/bin/env python
def msg(x):
print "S:",x.encode("hex")
if len(x) <= 7:
ret = chr(len(x)) + x
else:
assert False
return ret.ljust(8, "\x00")
def isotp_send(panda, x, addr, bus=0):
@withzombies
withzombies / bnil_graph.py
Last active June 3, 2019 14:08
BinaryNInja plugin to graph BNIL Instructions (they're tree form)
#!/usr/bin/env python
# Copyright 2017 Ryan Stortz (@withzombies)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@ancat
ancat / notes.md
Created March 3, 2014 01:23
z3 for ctf