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 / cutshit.vpy
Last active Mar 17, 2017
VapourSynth script for "simple" frame exact cutting of video & audio
View cutshit.vpy
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 / 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 / 0001-Add-STouchInput-to-header-file.patch
Created Nov 5, 2016
touch input for irrlicht on windows (incomplete)
View 0001-Add-STouchInput-to-header-file.patch
From d61676afdfd10fcba779ceab8fa00779a9eb2ccd Mon Sep 17 00:00:00 2001
From: sfan5 <sfan5@live.de>
Date: Sat, 15 Oct 2016 15:13:07 +0200
Subject: [PATCH 1/3] Add STouchInput to header file
---
include/IEventReceiver.h | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/include/IEventReceiver.h b/include/IEventReceiver.h
@sfan5
sfan5 / blacknode.py
Created Nov 2, 2016
Removes a single node from a whole Minetest world (SQLite3 backend only)
View blacknode.py
#!/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 / 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 / remove_br_wrapper.sh
Created Sep 8, 2016
Removes toolchain-wrapper added by recent versions of Buildroot
View remove_br_wrapper.sh
#!/bin/bash
if [ ! -f toolchain-wrapper ]; then
echo "Not a bin folder or wrapper already removed"
exit 1
fi
echo ":: Replacing symlinks to toolchain-wrapper"
for file in *; do
@sfan5
sfan5 / mapblock-parse.py
Last active May 9, 2017
parses serialized MapBlock
View mapblock-parse.py
#!/usr/bin/env python3
import sys
import struct
import binascii
import zlib
import getopt
BS = 16 # MapBlock side length (not to be confused with the BS for visuals)
ENDIAN = "!"
@sfan5
sfan5 / brnboot_brute.py
Last active May 2, 2016
Bruteforces brnboot command mode password (required either broken firmware (unbootable) or manual resets)
View brnboot_brute.py
#!/usr/bin/env python2
import time
import serial
class PasswordGen(object):
def __init__(self):
self.charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
self.cur_pw = [0 for i in range(16)]
self.cur_i = 0
def restore(self, pw):
@sfan5
sfan5 / 2gateway.sh
Created Apr 8, 2016
Support multiple gateways on one machine
View 2gateway.sh
#!/bin/bash -e
IFACE=wlp0s18f2u1
TBLN=10
# TBLN needs to be different for each interface
IPADDR=`ip addr show dev $IFACE | grep "inet " | awk '{print $2}' | cut -d '/' -f1`
IPSUBNET=`ip route show | grep "dev $IFACE" | grep "src $IPADDR" | awk '{print $1}'`
IPGATEWAY=`ip route | grep "default via" | grep "dev $IFACE" | awk '{print $3}'`
@sfan5
sfan5 / ytdl_plus.lua
Last active Sep 9, 2017
More and better configuration for youtube-dl (mpv)
View ytdl_plus.lua
-- ytdl_plus: More and better configuration for youtube-dl!
-- The main feature is being able to choose the requested formats based on the URL you're playing,
-- other features include blacklisting youtube-dl for specific URLs.
-- Configuration guide:
--- 'match' controls which formats apply to which URLs,
--- it's a key-value mapping of patterns to IDs: <key>=<value>[,<key>=<value>...]
--- Patterns are strings that are searched for in the URL,
--- if you prefix a pattern with ^ it will only match at the beginning.
--- Patterns are matched from first to last, which means that
--- if you put an empty pattern first, all others won't be matched.
You can’t perform that action at this time.