Skip to content

Instantly share code, notes, and snippets.

View rfde's full-sized avatar

Till rfde

View GitHub Profile
@rfde
rfde / __init__.py
Created May 17, 2020 14:37
Anki addon to print all flashcards of the current deck in DIN A7 format, Anki 2.1 edition. (see https://gist.github.com/rfde/8aa6baac97e1ac8a9c8170c8c6d21ff8 for Anki < 2.1)
# -*- coding: utf-8 -*-
##############################################################################
#
# -Till Schlueter <mail@tschlueter.eu> 2020
# -GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
#
# -This add-on is a modified version of "Print as Flashcards" by Goal
# Oriented Academics LLC which is a modified version of the basic printing
# add-on by Damien Elmes.
#
@rfde
rfde / Print_as_flashcards_A7.py
Created October 19, 2018 12:12
Anki addon to print all flashcards of the current deck in DIN A7 format.
# -*- coding: utf-8 -*-
##############################################################################
#
# -Till Schlueter <mail@tschlueter.eu> 2018
# -GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
#
# -This add-on is a modified version of "Print as Flashcards" by Goal
# Oriented Academics LLC which is a modified version of the basic printing
# add-on by Damien Elmes.
#
@rfde
rfde / resetkde.sh
Created April 13, 2018 14:23
reset kde monitor setup
#!/bin/sh
rm ~/.config/plasma-org.kde.plasma.desktop-appletsrc
cp ~/.config/plasma-org.kde.plasma.desktop-appletsrc.orig ~/.config/plasma-org.kde.plasma.desktop-appletsrc
killall plasmashell && kstart plasmashell
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Illegal number of parameters"
echo "USAGE: karo file.pdf title"
exit 1
fi
KAROTEMPDIR=$(mktemp -d)
PDFBASENAME=$(basename "$1")
@rfde
rfde / stamp.py
Last active December 4, 2017 17:21
Proof of concept: python script to obtain a trusted time stamp from a public time stamp server (rfc3161, e.g. zeitstempel.dfn.de or tsa.safecreative.org)
#!/usr/bin/env python3
#### TODO: Flexibilität: https://docs.python.org/3.3/library/argparse.html#argparse.ArgumentParser.add_argument
import random
import hashlib
import urllib.request
import logging
from subprocess import call
@rfde
rfde / LaTeX-User.sublime-completions
Last active September 18, 2017 14:25
Linux: ~/.config/sublime-text-3/Packages/User
{
"scope": "text.tex.latex - (string.other.math, meta.environment.math)",
"completions":
[
{ "trigger": "pc", "contents": "\\parencite[vgl.][$1]$0"},
{ "trigger": "bits", "contents": "\\begin{itemize}[noitemsep]\n\t\\item $0\n\\end{itemize}\n"},
{ "trigger": "fm", "contents": "\\fm{$1}$0"},
{ "trigger": "zf", "contents": "\\zf{$1}$0"},
@rfde
rfde / pullall.sh
Last active December 20, 2017 12:56
Pull all git repositories located in subdirectories
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
for i in ${DIR}/*/.git
do
echo $i
cd $i/..
git pull
done
@rfde
rfde / create_fwd.sh
Created March 29, 2016 15:47
Technicolor TC7200/Unitymedia: Shell-Scripts, um IPv6-Portfreigaben zu erstellen/aktualisieren und zu löschen. Das create-Skript z.B. via cron regelmäßig ausführen, um einen evtl. Wechel des Präfix abzufangen. Ggf. einen Befehl zum DNS-Update ergänzen.
#!/bin/sh
OPENPORT="22"
NETDEVICE="eth0"
MYIPV6=$(ip addr show dev ${NETDEVICE} | grep -P 'inet6 (?!fe80)' | awk '{print $2}' | sed -e "s/\/64//" | sed -e "s/\:/\%3A/g")
CSRF=$(curl -s http://192.168.0.1/login.asp | grep -e "\"CSRFValue\"" | sed -e "s/.*value=\(.*\)>.*/\1/")
curl -s -d "CSRFValue=${CSRF}&loginUsername=admin&loginPassword=password&logoffUser=1" http://192.168.0.1/goform/login
CSRF=$(curl -s http://192.168.0.1/advanced/forwarding.asp | grep -e "\"CSRFValue\"" | sed -e "s/.*value=\(.*\)>.*/\1/")
curl -s -d "CSRFValue=${CSRF}&ForwardingPortRange1=${OPENPORT}&ForwardingTargetIp1=${MYIPV6}&ForwardingTargetPort1=${OPENPORT}&ForwardingProtocol1=2&ForwardingPortRange2=0-0&ForwardingTargetIp2=0.0.0.0&ForwardingTargetPort2=0-0&ForwardingProtocol2=0&ForwardingDelete2=1&ForwardingPortRange3=0-0&ForwardingTargetIp3=0.0.0.0&ForwardingTargetPort3=0-0&ForwardingProtocol3=0&ForwardingDelete3=1&ForwardingPortRange4=0-0&ForwardingTargetIp4=0.0.0.0&ForwardingTargetPort4=0-0&ForwardingProtocol4=0&ForwardingDelete4
@rfde
rfde / custom.css
Created August 17, 2015 16:00
Tiny Tiny RSS: Benutzerdefiniertes Stylesheet
@import url(http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic);
div.postContent {
text-align: justify;
font-family: "Droid Serif", serif;
font-size: 16px;
line-height: 24px;
}
div.cdmContentInner {
@rfde
rfde / qscr.tcl
Last active January 19, 2016 20:08
#!/usr/bin/wish
# ====== .i3/config ======
# # monitor setup
# for_window [title="^qscr$"] floating enable
# exec --no-startup-id wish /home/ts/.screenlayout/startup.tcl
# # XF86Display = Fn+F7 (@Lenovo T440p)
# bindsym XF86Display exec --no-startup-id wish /home/ts/.screenlayout/startup.tcl
# ========================
# Buttons