Skip to content

Instantly share code, notes, and snippets.

@ProducerMatt
ProducerMatt / threads.js
Last active May 29, 2022 19:08
Scripts in various languages to create a massive number of threads. Abandon all hope ye who enter here
// Threads: 501
// real: 2293668 KiB
// 10k threads would be 43.66 GiB
// virt: 106113460 KiB
// 10k threads would be 1.973 TiB
const { Worker, isMainThread } = require('worker_threads');
function freeze(time) { //https://stackoverflow.com/a/46937705
const stop = new Date().getTime() + time;
while(new Date().getTime() < stop);
@ProducerMatt
ProducerMatt / wg_quick.rc
Last active May 31, 2023 03:58
OpenBSD rc service script for the wg-quick WireGuard framework
#!/bin/ksh
# rc script for wg-quick. one network only.
# if you have /etc/wireguard/wg0.conf,
# enable like this:
# pkg_scripts=wg_quick
# wg_quick_flags=wg0
daemon="/usr/local/bin/wg-quick"
@ProducerMatt
ProducerMatt / Config.md
Last active May 10, 2022 02:10
notes on code-server + iPad + C and Makefiles

Notes on Configuring for C Development

These notes are fairly surface-level as I'm finding this solution inadequate for my use case. But I'll leave up what little I have learned so hopefully it'll save the reader some time.

Way Back Home

First thing to note: you can open a terminal at any time, so you're not handcuffed to the GUI. One way is to right click on a folder and click "open in

@ProducerMatt
ProducerMatt / cosmo.fish
Last active April 19, 2022 22:57
hacky fish-shell script for Justine Tunney's cosmopolitan C compiler
#!/usr/bin/env fish
set help "Take one .c file and compile it with cosmo.
Outputs to a .com and .com.dbg file in the current directory.
flags:
--help / -h : print this text
--release : compile without debug options.
@ProducerMatt
ProducerMatt / malware_block.ksh
Last active March 14, 2021 00:04 — forked from jgoettsch/malware_block.ksh
Block malware with unbound on OpenBSD
#!/bin/ksh
#set -x #DEBUG
# Call with -d to leave a diff between the old and new files
[ `id -u` == 0 ] || { echo "Please run as root!" && exit 3 ; }
URL="https://urlhaus.abuse.ch/downloads/hostfile"
TMPDIR="/tmp"
HOSTFILE="$TMPDIR/hostfile"
@ProducerMatt
ProducerMatt / keybase.md
Created November 22, 2019 00:22
keybase.md

Keybase proof

I hereby claim:

  • I am producermatt on github.
  • I am producermatt (https://keybase.io/producermatt) on keybase.
  • I have a public key ASDcHcSKFJkPuI3oBGrdH2CW-qahGXwp7SjM6dcHGpFTMAo

To claim this, I am signing this object: