View check_iban.py
# Based on http://codereview.stackexchange.com/questions/135366/python-iban-validation | |
import string | |
def is_iban(unchecked_iban): | |
LETTERS = {ord(d): str(i) for i, d in enumerate(string.digits + string.ascii_uppercase)} | |
def _number_iban(iban): |
View parentHeight.js
var parentHeight = $.map($('.parent > *'), function (i) { | |
return ($(i).height()) | |
}).reduce(function (accumulator, currentValue) { | |
return accumulator + currentValue; | |
}, 0); | |
$('.parent').height(parentHeight); |
View ostseezeitung-plus.sh
function oz { | |
# bash> oz "https://www.ostsee-zeitung.de/Nachrichten/MV-aktuell/MV-plant-kompletten-Corona-Lockdown-in-wenigen-Tagen" | |
echo "{ $(curl -s "$1" | grep -o '\"description\":\".*')" | jq .articleBody | |
} |
View python_port_open.sh
python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',8000)) else False" |
View change_none_unique_minidlna_title.sh
for line in $(sqlite3 /root/minidlna/files.db "SELECT ID,PATH FROM DETAILS WHERE TITLE='HERE THE NONE UNIQUE TITLE';"); | |
do | |
id=$(echo $line | cut -d"|" -f1); | |
path=$(echo $line | cut -d"|" -f2); | |
echo $id; | |
echo $path; | |
sqlite3 /root/minidlna/files.db "UPDATE DETAILS SET TITLE='$(basename $path)' WHERE ID=$id;"; | |
done; | |
View Google Meet Focus And Toggle Mic
xdotool search --name 'Meet' | xargs xdotool windowactivate;sleep 0.2; xdotool key Ctrl+d |
View record_mp3_and_split.sh
# record from soundcard | |
parec -d 1 | lame -r -V0 - my.mp3 | |
# split file by silence | |
ffmpeg -i my.mp3 -af silencedetect=noise=-30dB:d=0.5 -f null - 2>&1 | grep silence_end | cut -d" " -f 5 | xargs -L 2 | nl | xargs -l bash -c 'ffmpeg -i my.mp3 -acodec copy -ss $1 -to $2 my$0.mp3' |
View pycheck.sh
function pycheck() { | |
echo | |
echo | |
echo | |
find . -name "*.py" | xargs mypy --ignore-missing-imports | |
echo | |
echo |
View imagediff.sh
#!/bin/bash | |
# TODO: Add Readme | |
# TODO: Add Example | |
# TODO: Check if imagemagick is installed | |
IMG_A="$1" | |
IMG_B="$2" | |
convert "$IMG_A" "$IMG_B" <(compare "$IMG_A" "$IMG_B" -) +append - | display |
View Abfall_LRO_iCal_Api.sh
curl 'https://www.abfall-lro.de/wp-content/themes/abfall_lro/ical.php?letters=B_K_D_P&year=2018&black=4w&green=&yellow=y&blue=y' |
NewerOlder