Skip to content

Instantly share code, notes, and snippets.

View sfan5's full-sized avatar

sfan5

  • Germany
  • 15:13 (UTC +02:00)
View GitHub Profile
@sfan5
sfan5 / nginx-libressl.sh
Last active August 27, 2026 15:31
Compiles nginx statically linked with LibreSSL
#!/bin/bash -e
LIBRESSL_VERSION=4.3.2
NGINX_VERSION=1.31.4
NGINX_CONFIG=(
--with-pcre-jit --with-threads
--with-http_ssl_module
--with-http_v2_module
--with-http_realip_module
--with-http_stub_status_module
--with-http_auth_request_module
@sfan5
sfan5 / mapblock-parse.py
Last active August 8, 2026 12:56
parses serialized Luanti MapBlock
#!/usr/bin/env python3
import sys
import struct
import binascii
import zlib
import getopt
try:
import zstandard
except ModuleNotFoundError:
zstandard = None
@sfan5
sfan5 / alpine-container.sh
Last active July 4, 2026 12:22
Create bootable systemd-nspawn containers with Alpine, Arch Linux or Ubuntu
#!/bin/bash -e
# Creates a systemd-nspawn container with Alpine
MIRROR=http://dl-cdn.alpinelinux.org/alpine
VERSION=${VERSION:-v3.24}
APKTOOLS_VERSION=3.0.6-r0
wget_or_curl () {
if command -v wget >/dev/null; then
@sfan5
sfan5 / init.lua
Last active March 26, 2026 13:41
Example Luanti mapgen
-- SPDX-License-Identifier: CC0-1.0
local DEMO_GENNOTIFY = false
assert(core.register_mapgen_script)
core.register_mapgen_script(core.get_modpath(core.get_current_modname()) .. "/inner.lua")
core.set_mapgen_setting("mg_name", "singlenode", true)
core.register_on_respawnplayer(function(player)
@sfan5
sfan5 / build.sh
Last active December 31, 2025 00:05
Compiles qbittorrent-nox as statically linked build (+ deb package)
#!/bin/bash -e
QT_VER=6.10.1
LIBTORRENT_VER=2.0.11
QBITTORRENT_VER=5.1.4
export LANG=C.UTF-8
export CXXFLAGS="-flto=auto"
export LDFLAGS="-flto=auto"
export MAKEFLAGS="-j12"
@sfan5
sfan5 / blacknode.py
Created November 2, 2016 22:10
Removes a single node from a whole Minetest world (SQLite3 backend only)
#!/usr/bin/env python3
import sys
import os.path
import struct
import zlib
import sqlite3
class BufferConsumer():
def __init__(self, buf):
assert(type(buf) == bytes)
@sfan5
sfan5 / makepkg.sh
Last active August 2, 2023 14:12
Reimplements functionality of makepkg to a small degree
#!/bin/bash -e
finalpath=/var/tmp/final
msg () {
echo ":: $1"
}
noextract=
bfile=PKGBUILD
@sfan5
sfan5 / build-waifu2x-cpp.sh
Last active June 18, 2023 14:30
Builds waifu2x-converter-cpp statically linked with a minimal OpenCV build
#!/bin/bash -e
OUTDIR=/tmp/waifu2x-cpp_install
OPENCV_VER=4.7.0
[ -d waifu2x-converter-cpp ] && (cd waifu2x-converter-cpp && git pull) || git clone https://github.com/DeadSix27/waifu2x-converter-cpp
[ -f opencv-$OPENCV_VER.tar.gz ] || wget https://github.com/opencv/opencv/archive/$OPENCV_VER.tar.gz -O opencv-$OPENCV_VER.tar.gz
[ -d opencv-$OPENCV_VER ] || tar -xaf opencv-$OPENCV_VER.tar.gz
cd opencv-$OPENCV_VER
@sfan5
sfan5 / build_qemu.sh
Last active April 19, 2023 17:27
Builds qemu
#!/bin/bash -e
prefix=/opt/qemu
qemuver=7.2.1
targets=('x86_64' 'i386')
# install dependencies
which apt-get &>/dev/null && apt-get install -y --no-install-recommends \
gcc make python3 pkg-config bison flex ninja-build \
lib{jpeg,png,aio,jemalloc,cap-ng,glib2.0,pixman-1}-dev
which pacman &>/dev/null && pacman -S --needed \
@sfan5
sfan5 / cutshit.vpy
Last active March 15, 2023 22:00
VapourSynth script for "simple" frame exact cutting of video & audio
import vapoursynth as vs
import csv
core = vs.get_core()
if "input" not in dir():
print("ERROR: Provide input file via --arg input=./spec.txt")
assert False
vsrc = None
asrc = None