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
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 / 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 / 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"
View ilbot_log_line2.sql
DELIMITER //
CREATE PROCEDURE `ilbot_log_line2`(IN p_time TIMESTAMP, IN p_channel VARCHAR(30), IN p_nick VARCHAR(40), IN p_line mediumtext)
LANGUAGE SQL
NOT DETERMINISTIC
SQL SECURITY INVOKER
COMMENT 'Log a line from IRC with custom timestamp'
BEGIN
DECLARE channel_id, day_id INT(11);
DECLARE today CHAR(10);
START TRANSACTION;
@sfan5
sfan5 / 01readme.md
Last active Apr 8, 2017
Raspberry Pi support for Minetest
View 01readme.md

I'm not actually sure in how far this works other than that it compiles cleanly.

Also note that Minetest will need lots of changes where #ifdef __ANDROID__ appears to include the rpi too.

one patch is for Irrlicht (ogl-es)

other is for Minetest

@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",
@sfan5
sfan5 / convert.sh
Last active Jul 21, 2018
Converting .xm/.mod files to .wav in batch using MilkyTracker
View convert.sh
#!/bin/bash -e
# adjust as needed, leave encode_ext empty to keep the wav files
encode_ext="opus"
function encode_func() {
# $1: source file (wav)
# $2: destination file
opusenc --quiet --bitrate 64 "$1" "$2"
}
@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
@sfan5
sfan5 / alpine-container.sh
Last active Oct 23, 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 / webm_twopass.txt
Last active Apr 28, 2017
script for twopass encoding of webms
View webm_twopass.txt
#!/bin/bash -e
src="2QO90IaN_UM.mkv"
dst="a.webm"
opts="-vf scale=1280:720 -threads 10"
aopts="-c:a libopus -b:a 128k"
vopts="-c:v libvpx-vp9 -b:v 1024k -tile-columns 6 -frame-parallel 1 -row-mt 1"
vopts_final="-auto-alt-ref 1 -lag-in-frames 25"
ffmpeg -i "$src" $opts \
You can’t perform that action at this time.