Skip to content

Instantly share code, notes, and snippets.

sfan5

  • Germany
Block or report user

Report or block sfan5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sfan5
sfan5 / alpine-container.sh
Last active Nov 17, 2019
systemd-nspawn containers with various Linux distributions: Alpine, Arch Linux, Ubuntu
View alpine-container.sh
#!/bin/bash -e
# Creates a systemd-nspawn container with Alpine
MIRROR=http://nl.alpinelinux.org/alpine
ARCH=x86_64
VERSION=v3.10
APKTOOLS_VERSION=2.10.4-r2
if [ $UID -ne 0 ]; then
@sfan5
sfan5 / rtorrent-git.sh
Last active Sep 25, 2019
Compiles rtorrent & libtorrent from git statically linked together
View rtorrent-git.sh
#!/bin/bash -e
LIBTORRENT_BRANCH=master
LIBTORRENT_CONFIG="--disable-debug"
RTORRENT_BRANCH=master
RTORRENT_CONFIG="--disable-debug --enable-ipv6"
# Dependencies on Debian/Ubuntu:
#sudo apt install \
# g++ autoconf libtool pkg-config \
# zlib1g-dev libssl-dev libcurl4-openssl-dev \
@sfan5
sfan5 / ttml2ass.py
Last active Sep 4, 2019
Converts TTML (XML) subtitles to SSA/ASS format
View ttml2ass.py
#!/usr/bin/env python3
import sys
from xml.dom.minidom import parseString
COLORS = { # TODO more colors
"white" : "FFFFFF",
"black" : "000000",
"yellow" : "FFFF00",
"green" : "00FF00",
"cyan" : "00FFFF",
View build_qemu.sh
#!/bin/bash -e
prefix=/opt/qemu
qemuver=4.0.0
targets=('x86_64' 'i386')
# install dependencies
apt-get install -y --no-install-recommends \
gcc make python pkg-config \
lib{gnutls28,jpeg,png,aio,jemalloc,cap-ng,glib2.0,pixman-1}-dev
@sfan5
sfan5 / common.sh
Last active Jul 23, 2019
Build system & recipes for cross-compiling various libraries/programs for Windows (32-bit & 64-bit)
View common.sh
#!/bin/bash -eu
strip_pkg=0
_CUSTOMOPTS_E=__this_is_empty_dont_bother__
CUSTOMOPTS=($_CUSTOMOPTS_E)
common_init () {
CURRENT_PACKAGE_NAME=$(basename "$0")
FETCHCACHE="$PWD/dl"
@sfan5
sfan5 / cpbitmap2image.py
Created Jan 6, 2014
Tools to work with .cpbitmap files
View cpbitmap2image.py
#!/usr/bin/env python2
from PIL import Image
import sys
import struct
def r8(f):
return ord(f.read(1))
if len(sys.argv) <= 2:
print("Usage: %s <input> <output>" % sys.argv[0])
@sfan5
sfan5 / image2xterm.py
Last active May 16, 2019
Converts images into color sequences (xterm-256color)
View image2xterm.py
#!/usr/bin/env python3
import sys
import getopt
from PIL import Image
xterm256colors = [ # http://pln.jonas.me/xterm-colors
(0, (0x00, 0x00, 0x00)), # SYSTEM
(1, (0x80, 0x00, 0x00)), # SYSTEM
(2, (0x00, 0x80, 0x00)), # SYSTEM
(3, (0x80, 0x80, 0x00)), # SYSTEM
@sfan5
sfan5 / makepkg.sh
Last active May 2, 2019
Reimplements functionality of makepkg to a small degree
View makepkg.sh
#!/bin/bash -e
finalpath=/var/tmp/final
msg () {
echo ":: $1"
}
bfile=PKGBUILD
[ -n "$1" ] && bfile="$1"
@sfan5
sfan5 / build-static-ocserv.sh
Last active Mar 17, 2019
Builds OpenConnect server (http://www.infradead.org/ocserv/) into a portable, static Linux binary
View build-static-ocserv.sh
#!/bin/bash -e
triple=x86_64-unknown-linux-musl
CC=/tmp/tc/bin/x86_64-unknown-linux-musl-gcc
v_nettle=3.4.1
v_gnutls=3.6.6
v_libev=4.25
v_ocserv=0.12.3
@sfan5
sfan5 / nginx-libressl.sh
Last active Dec 26, 2018
Compiles nginx statically linked with libressl
View nginx-libressl.sh
#!/bin/bash -e
LIBRESSL_VERSION=2.8.3
NGINX_VERSION=1.15.8
NGINX_CONFIG="--with-pcre-jit --with-threads --with-http_ssl_module --with-http_v2_module"
[ -f libressl.tar.gz ] || \
wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$LIBRESSL_VERSION.tar.gz \
-O libressl.tar.gz
You can’t perform that action at this time.