Skip to content

Instantly share code, notes, and snippets.

View whitequark's full-sized avatar
🐈‍⬛

Catherine whitequark

🐈‍⬛
View GitHub Profile
@raggi
raggi / eventmachine_is_web_scale.rb
Created September 1, 2010 01:34
the secrets of the web scale sauce
require 'eventmachine'
EM.run do
SEKRET_SAUCE = EM.attach(
open(RUBY_PLATFORM =~ /mswin|mingw/ ? 'NUL:' : '/dev/null', 'w')
)
EM.start_server('0.0.0.0', 80, Module.new do
def post_init; proxy_incoming_to(SEKRET_SAUCE); end
end)
end
@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
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;
@kachayev
kachayev / concurrency-in-go.md
Last active January 6, 2025 22:43
Channels Are Not Enough or Why Pipelining Is Not That Easy
@essen
essen / http_specs.md
Last active January 10, 2022 02:01
HTTP and related specifications
@pdn4kd
pdn4kd / topics.md
Last active March 9, 2023 22:45 — forked from eggrobin/topics.md
#kspacademia topicquotes

The conversation that led to the creation of the channel:

<ferram4|afk> So, I continue following references on supersonic wing stuff,
and I find a paper that tries to tweak linear supersonic flow to work for
high AoA, hypersonic flight.
<KinglyRedLion> the FUCK
<ferram4|afk> I love technical papers. ^_^
<KinglyRedLion> Why would you do high AOA hypersonic?
<egg|zzz|egg> KinglyRedLion: to publish
@merryhime
merryhime / text.md
Last active April 11, 2025 01:16
Playing with segment registers fs and gs on x64

GSBASE and FSBASE

When you're running out of registers while writing a JIT, you might resort to more unconventional methods for memory access. You might choose to resort to segment registers if you need a fixed register for memory offsets.

Instructions such as:

lea    rax,gs:[rcx+rdx*8]
mov    rax,gs:[rcx+rdx*8]

would then be available for your use.

@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" <[email protected]>
# 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
*/