Skip to content

Instantly share code, notes, and snippets.

View velnias75's full-sized avatar
🏠
Working from home

Heiko Schäfer velnias75

🏠
Working from home
View GitHub Profile
@velnias75
velnias75 / mcverswitch.sh
Last active January 31, 2023 06:57
Transparent fabric mod folder version switcher for Minecraft
#!/bin/bash
export DRI_PRIME=1
export vblank_mode=0
$DROPCACHES="$HOME/bin/drop_caches.sh"
if [ -x $DROPCACHES ];
then
sync
sudo $DROPCACHES
@velnias75
velnias75 / 70-keyboard.hwdb
Created November 22, 2020 07:15
systemd hwdb for Hauppauge PT# R-005 IR control
evdev:input:b0003v2040pF900e0200*
KEYBOARD_KEY_3736=stopcd
@velnias75
velnias75 / isdaymail.py
Created January 31, 2020 01:50
Time range script for use in KMail filters
#!/usr/bin/python3
#
# Copyright 2020 by Heiko Schäfer <[email protected]>
#
#
# Checks if a email date is *NOT* within a range of hours
#
# For usage in kmail filter, ex.:
#
# /path/to/isdaymail.py "%{date}" 18 4 && echo "Youtube announcement: %{subject}" | sed 's/Subject: //' | /usr/bin/espeak -s140 -a25 -b1 -k20 --stdin &
@velnias75
velnias75 / lubuntu-emergency-usb-manual-packlist.txt
Last active March 16, 2019 13:12
Paketliste meines Lubuntu-Notsystem-USB-Sticks
alsa-base
alsa-utils
anacron
at-spi2-core
avahi-daemon
bc
bleachbit
blueman
bluez
bsd-mailx
@velnias75
velnias75 / dynv6.sh
Created July 27, 2018 05:47 — forked from corny/dynv6.sh
Update script for dynv6.com to set your IPv4 address and IPv6 prefix
#!/bin/sh -e
hostname=$1
device=$2
file=$HOME/.dynv6.addr6
[ -e $file ] && old=`cat $file`
if [ -z "$hostname" -o -z "$token" ]; then
echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]"
exit 1
fi
@velnias75
velnias75 / omdb.user.js
Last active October 21, 2018 09:42
Userscript um Filme von omdb in der Datenbank https://rangun.de/index.php zu suchen
// ==UserScript==
// @name OMDB - Suche in der DB
// @version 0.15
// @description Userscript um Filme von omdb in der Datenbank https://rangun.de/index.php zu suchen
// @author Heiko Schäfer
// @homepage https://gist.github.com/velnias75/2eb5a3625640ada0007d3d2c0de09eb5
// @updateURL https://gist.github.com/velnias75/2eb5a3625640ada0007d3d2c0de09eb5/raw/omdb.user.js
// @downloadURL https://gist.github.com/velnias75/2eb5a3625640ada0007d3d2c0de09eb5/raw/omdb.user.js
// @namespace https://rangun.de/db/
// @match http://www.omdb.org/person/*/filmography
@velnias75
velnias75 / ilog.S
Created April 18, 2018 11:09
Assembler integer logarithm
# unsigned int ilog(unsigned int value, unsigned int base);
# (c) 2018 by Heiko Schaefer
.section .text
.globl ilog
.type ilog, @function
ilog:
pushl %ebp
movl %esp, %ebp
@velnias75
velnias75 / bicot.cpp
Created November 5, 2017 09:09
Binominal coefficient constant template
/*
* binominal coefficient constant template
*
* g++ --std=c++11 -g0 -O3 -s bicot.cpp -o bicot
*
* (c) 2017 by Heiko Schaefer <[email protected]>
*
*/
#include <iostream>
@velnias75
velnias75 / bico.c
Last active November 5, 2017 09:10
Calculate binominal coefficient
/*
* calculate binominal coefficient
*
* gcc -std=c99 -g0 -O3 -s bico.c -o bico -lm
*
* (c) 2017 by Heiko Schaefer <[email protected]>
*
*/
#include <math.h>
@velnias75
velnias75 / log2.py
Last active October 14, 2017 02:08
Recursive/iterative/native integer log2 algorithm comparison in Python
#
# Recursive/iterative/native integer log2 algorithm comparison in Python
#
# (c) 2017 Heiko Schaefer <[email protected]>
#
import sys, time, math
# recursive
def log2r(a, b = 0):