Skip to content

Instantly share code, notes, and snippets.

tastytea

Block or report user

Report or block tastytea

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
@tastytea
tastytea / addfromyoutube.sh
Last active May 21, 2018
Adds an Youtube video to MPD
View addfromyoutube.sh
#!/bin/zsh
# Adds an Youtube video to MPD
if [ -z "${1}" ]; then
echo "usage: ${0} <URL>" >&2
exit 1
fi
# Split by newline
oldIFS=${IFS}
@tastytea
tastytea / feiertag_cron
Last active May 10, 2018
Prüft, ob heute oder morgen ein feiertag ist.
View feiertag_cron
#!/bin/sh
today="$(date +'%d.%m.%Y')"
tomorrow="$(date -d tomorrow +'%d.%m.%Y')"
for holiday in $(feiertage -region Niedersachsen $(date +'%Y') | awk '{print $1}'); do
if [[ "${holiday}" != "Niedersachsen" ]]; then
if [[ "${holiday}" == "${today}" ]]; then
echo "Heute ($(date +'%A')) ist ein feiertag."
fi
@tastytea
tastytea / tabname.html
Last active Dec 24, 2017
Rename title, show folder icon. For tab tree browser-extensions.
View tabname.html
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAQVSURBVFiF7Zc9bxxFGMd/M7t3e6/2OZEwCQVWlMIfAAkFIVNulYIaiQJaOj5AJD5ASoREhWihQ0inQBfJigKK0kXCxsQoFsb3unfel5mdGYp7yTp3jhNyUij4S492dnb3eX7zPDOzuyIMQ16n5GuN/l8A8AFu3LjhK6V+Nsa8d9EDQojcWvv5w4cPv1wZQJqmW5VK5Z2bN2/6SZLgnAPAWgswP5+2/Tt37tze3t7+/tGjR8crAVBKZdVq1R0dHdHpdHDOLTUAIQSbm5v5wcHBR8DtlQBordMsy8SlSxsYY7DWnglczIQQgmq1Wj88PPxie3v71qx/mZxz2lr78d7e3o/PBQCyLMu8TqdLp9OZA8yOsyDFQFtbW/VGo0Gz2UQIgRACACnlvB1FEffu3bsFPB/g8uXLab/f9zY2WmitFwCWlWKmOI4B5hBFi+MYY0ztvOBzgN3dXXXt2jXZ6/XmGQCWgsyyUdRsxMXgUsoZQOVCAABjjG0212SaZtw/tNz
@tastytea
tastytea / urlhandler
Last active Nov 15, 2017
Open URLs based on regular expressions
View urlhandler
#!/bin/zsh
# Open URLs based on regular expressions
if [ -z "${1}" ]; then
print "usage: $(basename ${0}) URL [URL] ..." >&2
exit 1
fi
zmodload zsh/regex
@tastytea
tastytea / srtadrm
Last active Oct 24, 2017
Remove ads from SRT files
View srtadrm
#!/bin/zsh
# Remove ads from SRT files with a list of POSIX extended regular expressions
zmodload zsh/regex
file="${1}"
newfile="${1}.tmp"
ad_re=(
"Advertise your product or brand here"
"OpenSubtitles.org"
@tastytea
tastytea / fetch_gaidao.sh
Last active Sep 19, 2017
Auf neue Ausgaben von der Gai Dao prüfen, herunterladen
View fetch_gaidao.sh
#!/bin/sh
# Auf neue Ausgaben von der Gai Dao prüfen, herunterladen
cd ~/Documents/Zeitungen/Gaidao
ausgaben="$(curl -s https://fda-ifa.org/gaidao/ausgaben/ \
| grep -Eo 'https://fda-ifa.org/gai-?dao-(nr-)?[0-9]+-[^/]*/')"
for ausgabe in ${ausgaben}; do
url="$(curl -s ${ausgabe} \
| grep -Eo 'https://fda-ifa.org/wp-content/uploads/[0-9]{4}/[0-9]{2}/[^ ]*\.epub')"
@tastytea
tastytea / 40-joystick.conf
Last active Sep 11, 2017
Use XBOX controller as mouse
View 40-joystick.conf
# Use an XBOX controller as mouse in X.Org
Section "InputClass"
Identifier "Joystick"
MatchIsJoystick "on"
MatchDevicePath "/dev/input/event*"
Driver "joystick"
Option "StartKeysEnabled" "True"
Option "StartMouseEnabled" "True"
Option "MapButton1" "key=36" # A – Return
@tastytea
tastytea / wintime
Last active Sep 11, 2017
Display time in window title
View wintime
#!/bin/sh
if [ -z "${1}" ]; then
echo "usage: ${0} <Window Title>" >&2
exit 1
fi
WINTITLE="${1}"
WINID=$(wmctrl -l | grep ${WINTITLE} | cut -d' ' -f1)
if [ -z "${WINID}" ]; then
@tastytea
tastytea / .gpg-mime-end
Last active Sep 11, 2017
procmail auto-encrypt
View .gpg-mime-end
--MfFXiAuoTsnnDAfX
@tastytea
tastytea / gettemp.sh
Last active Sep 11, 2017
Get temperature and store in file, openweathermap
View gettemp.sh
#!/bin/sh
API_KEY=""
CITY="Hamburg,de"
OUTPUT_FILE="/run/user/$(id -u)/gettemp.temperature"
RESULT=""
RETRY=0
if [ "${1}" != "" ]; then
CITY="${1}"
You can’t perform that action at this time.