Skip to content

Instantly share code, notes, and snippets.

View whitequark's full-sized avatar
🐈‍⬛

Catherine whitequark

🐈‍⬛
View GitHub Profile
static OSStatus
SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams,
uint8_t *signature, UInt16 signatureLen)
{
OSStatus err;
SSLBuffer hashOut, hashCtx, clientRandom, serverRandom;
uint8_t hashes[SSL_SHA1_DIGEST_LEN + SSL_MD5_DIGEST_LEN];
SSLBuffer signedHashes;
uint8_t *dataToSign;
size_t dataToSignLen;
@maethor
maethor / ldap.in
Created October 8, 2013 14:46
Backupninja LDAP handler for Debian (without using slapd.conf)
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# openldap backup handler script for backupninja
#
getconf backupdir /var/backups/ldap
getconf suffixes all
getconf compress yes
getconf ldif yes
@gasche
gasche / ty_enum_to_int.ml
Created November 20, 2013 21:41
A type-conv syntax extension to convert constant constructors into consecutive integers.
(*pp camlp4orf *)
(* ty_enum_to_int : Camlp4 (3.10) Syntax extension
type test = | A | B | C | D with to_int
translates to :
type test = | A | B | C | D
let test_to_int = function | A -> 0 | B -> 1 | C -> 2 | D -> 3
let test_of_int = function | 0 -> A | 1 -> B | 2 -> C | 3 -> D
Compilation command :
@jvns
jvns / blogs.md
Last active April 16, 2020 09:34
Tech blogs I subscribe to
@smunaut
smunaut / ice40_global.md
Last active May 5, 2020 14:18
iCE40 Global Networks

UP5k SG48:

ID Use SB_IO_GB SB_GB Special
x/y/z (pin) x/y x/y type
0 Clk / Reset 19/ 0/1 (20) 13/ 0
1 Clk / CE 6/ 0/1 (44) 13/31
2 Clk / Reset 13/31/0 (37) 19/31 12/31 PLL_B
3 Clk / CE 6/31
#!/usr/bin/env python3
with open("vbmeta.img", "rb+") as vbmeta:
# Get current flags
vbmeta.seek(123)
flags = int.from_bytes(vbmeta.read(1), byteorder='big')
# Disable verity
flags |= 0x01
# Disable verification
flags |= 0x02
@marcan
marcan / ghettohci.c
Created April 24, 2018 16:48
GhettOHCI - perhaps the world's smallest and stupidest OHCI stack.
/*
mini - a Free Software replacement for the Nintendo/BroadOn IOS.
ghettohci - debug over FT232 over OHCI
Copyright (C) 2012 Hector Martin "marcan" <marcan@marcansoft.com>
# This code is licensed to you under the terms of the GNU GPL, version 2;
# see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/
@essen
essen / http_specs.md
Last active January 10, 2022 02:01
HTTP and related specifications
@porglezomp
porglezomp / twitter-alt-to-title.user.js
Last active March 16, 2022 15:43
Copy the alt text in tweets into the title text, so that you can see it on hover.
// ==UserScript==
// @name Twitter Alt-Text to Title-Text
// @description Copy the alt attribute of twitter images into the title attribute, so that I can see the alt text on hover.
// @version 1
// @grant none
// @include https://twitter.com/*
// ==/UserScript==
const SELECTORS = `.tweet .AdaptiveMedia-photoContainer img
, .Gallery-media img
#!/usr/bin/env python3
import sys
import textwrap
# Very basic bitstream to SVF converter, tested with the ULX3S WiFi interface
flash_page_size = 256
erase_block_size = 64*1024