Skip to content

Instantly share code, notes, and snippets.

View sfan5's full-sized avatar

sfan5

  • Germany
  • 19:35 (UTC +01:00)
View GitHub Profile
@sfan5
sfan5 / nginx-libressl.sh
Last active November 21, 2025 21:16
Compiles nginx statically linked with LibreSSL
#!/bin/bash -e
LIBRESSL_VERSION=4.2.1
NGINX_VERSION=1.29.3
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 / init.lua
Last active November 21, 2025 21:15
Example Luanti mapgen
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)
player:set_pos(vector.new(0, 1.5, 0))
@sfan5
sfan5 / alpine-container.sh
Last active October 25, 2025 02:41
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.22}
APKTOOLS_VERSION=2.14.9-r3
wget_or_curl () {
if command -v wget >/dev/null; then
@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 / build.sh
Last active May 11, 2024 21:07
Compiles qbittorrent-nox as statically linked build (+ deb package)
CMAKE_VER=3.29.3
QT_VER=6.7.0
LIBTORRENT_VER=2.0.10
QBITTORRENT_VER=4.6.4
export LANG=C.UTF-8
export CXXFLAGS="-std=c++17 -flto=auto"
export LDFLAGS="-flto=auto"
export MAKEFLAGS="-j12"
@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
@sfan5
sfan5 / 000readme.md
Last active November 30, 2022 16:45
More and better configuration for youtube-dl (mpv)

DO NOT USE THIS. It is unmaintained and will not work with newer versions of mpv, youtube-dl, yt-dlp or at all.