Skip to content

Instantly share code, notes, and snippets.

View xandkar's full-sized avatar
🤔
quis custodiet ipsos custodes?

Siraaj Khandkar xandkar

🤔
quis custodiet ipsos custodes?
View GitHub Profile
@pervognsen
pervognsen / vex.c
Last active October 23, 2022 11:02
// The stack is 8-byte aligned.
#define ALIGN(p) ((uint64_t *)(((uintptr_t)(p) + 7) & ~7))
#define STACK(stack, size) uint64_t *_stack = ALIGN(stack), *_stack_end = (uint64_t *)((char *)(stack) + size)
#define PUSH(x) do { memcpy(_stack, &x, sizeof(x)); _stack += (sizeof(x) + 7) / 8; } while (0)
#define POP(x) do { _stack -= (sizeof(x) + 7) / 8; memcpy(&x, _stack, sizeof(x)); } while (0)
#if __GNUC__
// Use computed gotos on GCC-compatible compilers (including Clang).
#define JOIN(x, y) x##y
#define LABEL(name) JOIN(label, name)
@aphyr
aphyr / pdf-sign
Created June 10, 2016 15:40
Script to sign the final page of a PDF using inkscape and pdfseparate/pdfunite.
#!/bin/bash
DIR=`mktemp -dt pdf-sign.XXXXXXXX` || exit 1
cd "$DIR"
pdfseparate "$1" "$DIR/page%d.pdf"
inkscape `ls | tail -1`
pdfunite page*.pdf "$1 signed.pdf"
rm -rf "$DIR"
@bishboria
bishboria / springer-free-maths-books.md
Last active May 10, 2025 04:28
Springer made a bunch of books available for free, these were the direct links
@jasobrown
jasobrown / failure detector papers
Created August 28, 2015 01:21
failure detector papers
A Gossip-Style Failure Detection Service - http://www.cs.cornell.edu/Info/People/rvr/papers/GossipFD.pdf
The Failure Dectector Abstraction - http://perso.telecom-paristech.fr/~kuznetso/pubs/fdsurvey.pdf
The phi-accrual Failure Detector - http://www.jaist.ac.jp/~defago/files/pdf/IS_RR_2004_010.pdf
@lestoni
lestoni / gist:8c74da455cce3d36eb68
Last active May 3, 2025 20:15
vim folding cheatsheet

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@omnibs
omnibs / phoenix showdown rackspace onmetal io.md
Last active June 10, 2024 17:47
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
@trusche
trusche / statsd.md
Last active May 2, 2019 13:05
Installing graphite and statsd on OS X Yosemite

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Graphite

Install Cairo

There's an issue with cairo 14.x that results in the axis fonts on the graphs being HUUUUUGE. Downgrading to 12.6 helps:

@efcasado
efcasado / eqc.md
Last active January 16, 2025 16:22
A gentle introduction to (Erlang) QuickCheck

Erlang QuickCheck

What is QuickCheck?

QuickCheck is a language for stating properties of programs.

?FORALL(X, nat(), X*X >= 0)
@adamjakab
adamjakab / l2chroot.sh
Last active February 6, 2024 21:34
Chroot - copy binaries and their shared dynamic libraries to chrooted envirnoment
#!/bin/bash
# Use this script to copy shared (libs) files to Apache/Lighttpd chrooted
# jail server.
# ----------------------------------------------------------------------------
# Written by nixCraft <http://www.cyberciti.biz/tips/>
# (c) 2006 nixCraft under GNU GPL v2.0+
# + Added ld-linux support
# + Added error checking support
# ------------------------------------------------------------------------------
# See url for usage:
@jlouis
jlouis / QC_feedback.md
Created October 2, 2014 13:11
Some feedback for Chris Meiklejohn (and others)

Feedback on the QuickCheck model

So, we have a QuickCheck model at

https://github.com/cmeiklejohn/derflow/blob/master/test/derflow_ets_eqc.erl

and Chris is asking for feedback, so here goes the things I've seen in this model. This is just haphazardly written, so don't expect there to be much flow in the thing.