Skip to content

Instantly share code, notes, and snippets.

View ryancdotorg's full-sized avatar

Ryan Castellucci ryancdotorg

View GitHub Profile
@ryancdotorg
ryancdotorg / dnaas.c
Created October 30, 2013 23:20
Wrapper library to use /dev/null as a service on Linux via LD_PRELOAD
/* This is a wrapper library that will give your server the power of
* /dev/null as a service, as seen at http://devnull-as-a-service.com/
*
* Compile:
* gcc -ggdb -shared -fPIC dnaas.c -ldl -lcurl -o libdnaas.so
*
* Try:
* LD_PRELOAD=./libdnaas.so dd if=/dev/sda of=/dev/null bs=8192 count=16
*
* Install:
@ryancdotorg
ryancdotorg / web-crypto-scrypt.js
Last active December 10, 2025 16:55
An async JavaScript Scrypt implementation using Web Cryptography APIs for PBKDF2.
// SPDX-License-Identifier: MIT
//
// An async JavaScript Scrypt implementation using Web Cryptography APIs for PBKDF2
//
// Copyright © 2014-2018 cryptocoinjs (original implementation)
// Copyright © 2016 Richard Moore (asyncronous version)
// Copyright © 2019-2022 Ryan Castellucci (WebCrypto version)
//
// See also:
// https://github.com/cryptocoinjs/scryptsy
@ryancdotorg
ryancdotorg / rsabd.py
Last active November 24, 2025 22:41
backdoored rsa key generation
#!/usr/bin/env python
import sys
import gmpy
import curve25519
from struct import pack
from hashlib import sha256
from binascii import hexlify, unhexlify
@ryancdotorg
ryancdotorg / builder.sh
Last active October 14, 2025 19:40
Script to statically cross compile various useful binaries (dropbear, socat, rsync, rpcapd, tcpdump, openssl, zstd) using musl-libc via musl.cc toolchains,
#!/bin/bash
# From https://gist.github.com/ryancdotorg/84275935f0b82578d8c222e2e915fc78
# built binaries at https://ryanc-musl-bins.s3.amazonaws.com/SHA256SUMS.html
set -eo pipefail
set -x
export BUILD_SCRIPT_DATE="$(date -r "$0" -Iseconds)"
PV_VERSION=1.8.14
let s:colornames = {'aliceblue':'f0f8ff','antiquewhite':'faebd7','aqua':'00ffff','aquamarine':
\'7fffd4','azure':'f0ffff','beige':'f5f5dc','bisque':'ffe4c4','black':'000000','blanchedalmond':
\'ffebcd','blue':'0000ff','blueviolet':'8a2be2','brown':'a52a2a','burlywood':'deb887','cadetblue':
\'5f9ea0','chartreuse':'7fff00','chocolate':'d2691e','coral':'ff7f50','cornflowerblue':'6495ed',
\'cornsilk':'fff8dc','crimson':'dc143c','cyan':'00ffff','darkblue':'00008b','darkcyan':'008b8b',
\'darkgoldenrod':'b8860b','darkgray':'a9a9a9','darkgreen':'006400','darkgrey':'a9a9a9','darkkhaki':
\'bdb76b','darkmagenta':'8b008b','darkolivegreen':'556b2f','darkorange':'ff8c00','darkorchid':
\'9932cc','darkred':'8b0000','darksalmon':'e9967a','darkseagreen':'8fbc8f','darkslateblue':'483d8b'
\,'darkslategray':'2f4f4f','darkslategrey':'2f4f4f','darkturquoise':'00ced1','darkviolet':'9400d3',
\'deeppink':'ff1493','deepskyblue':'00bfff','dimgray':'696969','dimgrey':'696969','dodgerblue':
#!/usr/bin/env python3
from sys import argv, exit, stdin, stdout, stderr, version_info
from functools import partial, lru_cache
eprint = partial(print, file=stderr)
import io
import os
import re
import types
[buildPlans.iosevka-hex]
family = "Iosevka Hex"
spacing = "normal"
serifs = "sans"
noCvSs = true
noLigation = true
[buildPlans.iosevka-hex.variants.design]
capital-a = "curly-serifless"
capital-b = "more-asymmetric-serifless"
#!/usr/bin/env python3
from sys import argv, exit, stdin, stdout, stderr, version_info
from functools import partial
eprint = partial(print, file=stderr)
# Python standard library imports
import os
from io import BytesIO, TextIOWrapper
# Third party library imports
#!/usr/bin/env python
import os
import sys
import gzip
import itertools
from struct import pack, pack_into, unpack, unpack_from, calcsize
from binascii import hexlify, unhexlify
from subprocess import Popen, PIPE
#!/bin/bash
# SPDX-License-Identifier: 0BSD OR MIT-0 OR CC0-1.0+
# Copyright © 2025 Ryan Castellucci <code@ryanc.org>
#
# vim_pack_update.sh
#
# A script to update all vim plugins managed by the native package manager.
# It handles plugins on a branch (fast-forward pull) and plugins on a tag
# (checks out the latest tag).
#