Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# copy all files used in a m3u playlist to a new subdirectory
# and prefix the filenames with a number nnnn00 in ascending order
# initial version 20200206
#
# based on ideas from https://forum.videolan.org/viewtopic.php?t=114141
import os.path, shutil, sys
def main():
from glob import glob
from pydub import AudioSegment
i = 0
for name in sorted(glob("*.mp3")):
i = i+1
print str(i)+" "+name
playlist_songs = [AudioSegment.from_mp3(mp3_file) for mp3_file in sorted(glob("*.mp3"))]
@Wikinaut
Wikinaut / jitsipatch.sh
Last active April 2, 2020 18:22
Patches for Jitsi
# Patches for jitsi
#
# see/filed as https://github.com/jitsi/jitsi-meet/pull/5264
# optionally fetch the nightly build:
apt update
apt upgrade
sed -e "s/LANG_DETECTION: false/LANG_DETECTION: true/" -i /usr/share/jitsi-meet/interface_config.js
@Wikinaut
Wikinaut / bkat.sh
Last active July 3, 2020 18:57
Commandline-Suche im Bundeseinheitlichen Bußgeldkatalog (BKAT)
# Aufruf: bkat.sh <needle>
if [ ! -f "bkat.txt" ] ; then
if [ ! -f "bkat.pdf" ] ; then
wget -O bkat.pdf "https://www.kba.de/DE/ZentraleRegister/FAER/BT_KAT_OWI/bkat_owi_28_04_2020_pdf.pdf?__blob=publicationFile&v=7"
fi
pdftotext -layout bkat.pdf bkat.txt
fi
egrep -A9 -i --color=always "$1" bkat.txt
Abfallartenkatalog
Abfallartenkataloge
Abfallartenkatalogen
Abfallartenkatalogs
Abfallkatalog
Abfallkataloge
Abfallkatalogen
Abfallkatalogs
Abgaskatalysator
Abgaskatalysatoren
@Wikinaut
Wikinaut / breaking-news.sh
Created January 18, 2021 17:20
Breaking-News image generator
#!/bin/bash
# Imagegenerator for "Breaking News"
# Init 20210112
if [[ $# -ne 3 ]] ; then
echo "Usage:"
echo "breaking-news \"headline-text\" \yellow-ribbon-text\" imagefile"
exit
fi
@Wikinaut
Wikinaut / getLangeNaechte.sh
Last active February 1, 2021 20:08
Erstellt lokal eine kompakte Webseite aller "Langen Nächte" von DLF/DLFKultur
#!/bin/bash
# Erstellt lokal eine kompakte Webseite aller "Langen Nächte" von DLF/DLFKultur
# Lizenz: WTFPL
rm "lange-naechte.html"
# get number of pages
maxpages=$(wget -q -O - "https://www.deutschlandfunkkultur.de/lange-nacht.1023.de.html" | \
grep -oE "paginationanzahl.*Seite ./[0-9]+" | \
@Wikinaut
Wikinaut / breaking-news.sh
Created February 1, 2021 19:51
Breaking-News-Generator
#!/bin/bash
# Imagegenerator for "Breaking News"
# Init 20210112
if [[ $# -ne 3 ]] ; then
echo "Usage:"
echo "breaking-news imagefile \"headline-text\" \"yellow-ribbon-text\""
exit
fi
@Wikinaut
Wikinaut / audio2video.sh
Last active May 6, 2021 00:16
Create a video for Twitter from an audio and a dummy image file - transcode audio into a video for twitter
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "audio2video: create a video for Twitter from audio and a dummy image."
echo "Usage:"
echo "audio2video audio.mp3 dummyimage.png"
echo
echo "Remark: width and height need to be divisible by 2."
exit
fi
@Wikinaut
Wikinaut / install-dependencies-and-build-kodi.sh
Last active February 7, 2021 10:09
install-dependencies-and-build-kodi.sh on Raspberry Pi
sudo apt update
sudo apt upgrade
sudo apt -y install build-essential
sudo apt -y install autoconf
sudo apt -y install automake
sudo apt -y install autopoint
sudo apt -y install gettext
sudo apt -y install autotools-dev
sudo apt -y install cmake