Skip to content

Instantly share code, notes, and snippets.

View Fusl's full-sized avatar
🏳️‍🌈
🦊

Katie Holly Fusl

🏳️‍🌈
🦊
  • VRChat
  • Everywhere.
  • 14:26 (UTC)
View GitHub Profile
@Fusl
Fusl / config
Last active May 14, 2022 02:24
api.vrchat.cloud
We couldn’t find that file to show.
@Fusl
Fusl / ruststats.js
Last active December 1, 2018 07:24
Rust server stats to InfluxDB
#!/usr/bin/env node
'use strict';
const Websocket = require('ws');
const async = require('async');
const Influx = require('influx');
const once = require('once');
const toml = require('toml');
const fs = require('fs');
@Fusl
Fusl / gist:13b54ae1ca3bc144536bc59329fe84be
Created October 23, 2018 16:28
Set up Alpine Linux RAID1 over 4 disks with 16GB rootfs size
# set up basic alpine environment (networking, kbd layout, apk repo)
setup-alpine -q
# add some required packages
apk add e2fsprogs mdadm parted sgdisk gptfdisk
# create partition layout on the first disk
gdisk /dev/sda
> o
> y
@Fusl
Fusl / gist:64aaa1d9b2025067a1b54b273ce11771
Last active October 16, 2020 01:34
Compile if_re.ko driver for RTL8111/8168/8411 on pfSense
- # Install FreeBSD 11.3-RELEASE with `ports` and `src` components in a VM
- pkg install wget ca_root_nss
- wget -qO- http://xor.meo.ws/KmLFJaaLqaQmUtNk2PP64KOLSNVb9GCy/rtl_bsd_drv_v196.04.tgz | tar xzf /dev/stdin
- cd rtl_bsd_drv_v195.00/
- sed -i.bak 's|#include <dev/re/if_rereg.h>|#include "if_rereg.h"|' if_re.c
- make
- # You're done with compiling the kernel module, `if_re.ko` is the file you need
- # Copy the kernel module file from your FreeBSD instance to your pfSense instance into /boot/kernel/
- # Exec chmod 555 /boot/kernel/if_re.ko on your pfSense instance
- # Add if_re_load="YES" to your /boot/loader.conf file on your pfSense instance
@Fusl
Fusl / dockroot.sh
Last active March 9, 2022 00:36
spawn a docker container when a specific unix user connects via SSH
#!/usr/bin/env bash
set -e
### CONFIG START ###
homebasedir="/data/homes"
defaultimage="alpine"
### CONFIG END ###
# sudo up to root
cat docker-compose.tyml | perl -pe 's/^(\t+)/" " x length($1)/gei' > docker-compose.yml
@Fusl
Fusl / getBasicAuthArray.js
Created April 26, 2018 16:11
Node.js/Javascript function to extract HTTP Basic auth from Authorization header string
const getBasicAuthArray = data => {
data = data.split(' ');
if (data.length !== 2 || !data[0].length || !data[1].length || data[0].toLowerCase() !== 'basic') return [null, null];
let basicAuthData = Buffer.from(data[1], 'base64').toString('utf8').split(':');
return [basicAuthData.shift(), basicAuthData.join(':')];
};
@Fusl
Fusl / ip2asn2sqlite3.js
Last active April 25, 2019 19:42
ip2asn2sqlite3.js
#!/usr/bin/env node
// No kittens were harmed while writing this really ugly looking and badly written code, I promise.
'use strict';
/*
(
wget -O- https://iptoasn.com/data/ip2asn-v4.tsv.gz | gzip -d
wget -O- https://iptoasn.com/data/ip2asn-v6.tsv.gz | gzip -d
@Fusl
Fusl / gist:e54e5eeabc3196c7a63dec6f9ab2bfda
Created February 25, 2018 03:14 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
@Fusl
Fusl / umount.sh
Created February 5, 2018 06:24
recursive umount
findmnt -u -n -r -o TARGET -R /path/to/mountpoint/ | sort -r | tr '\n' '\0' | xargs -0 -r umount