Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
leisure at work

Stefan Höhn dewomser

😎
leisure at work
View GitHub Profile
@dewomser
dewomser / yt-dlp Musik
Created Aug 29, 2022
Musik-yt download mit Metadata
View yt-dlp Musik
yt-dlp --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output "%(title)s.%(ext)s" --yes-playlist --embed-metadata '%u'
@dewomser
dewomser / ibims.sh
Created Jun 16, 2022
ich bins im Foto/Bild
View ibims.sh
convert $lolo1 -gravity south -background YellowGreen -splice 0x18 -annotate +0+2 'Die Tweet_Music-App ist vom @dewomser' cover.jpg
@dewomser
dewomser / tweet_vlc_music.sh
Created May 26, 2022
tweet_music mit vlc
View tweet_vlc_music.sh
#!/bin/bash
#//config
#Path twurlis not EXPORT
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
twurlp="/usr/bin/ruby /home/karl/.local/share/gem/ruby/3.0.0/bin/twurl"
#twurlp="twurl"
#twurl-user
user="dewomser"
View Wettervorhersage Worms
wetterdienst values --provider=dwd --network=mosmix --resolution=large --parameter=large --station=K2635 | jq -r '.[] | [.date,.temperature_air_mean_200 - 273.15, .pressure_air_site_reduced/100] | @csv' > test.csv
@dewomser
dewomser / greensnow2ufw.sh
Last active May 9, 2022
greensnow and ufw a bashscript
View greensnow2ufw.sh
#!/bin/bash
ufwpath="/home/foo/bin/greesnow-test"
rm "greensnow.txt"
wget https://blocklist.greensnow.co/greensnow.txt -O greensnow1.txt
tail -n 30 greensnow1.txt > greensnow.txt
head -n -16 $ufwpath"user.rules.gut" > "user.rules.gut1"
while read -r line; do
echo "### tuple ### deny any any 0.0.0.0/0 any $line in" >> user.rules.gut1
echo "-A ufw-user-input -s $line -j DROP" >> user.rules.gut1
echo " " >> user.rules.gut1
@dewomser
dewomser / screen_twit.sh
Created May 6, 2022
Screenshot Twittern mit Kommentar
View screen_twit.sh
!/bin/bash
cd $HOME/bin
import tweet.png
wait
# byte="$(du -b tweet.png | cut -b -5)"
byte="$(du -b tweet.png | tr -d -c 0-9)"
user="twitter_user"
@dewomser
dewomser / twitpix2.sh
Last active May 3, 2022
Höre gerade und twittere mit Cover-Bildchen. Bashscript für KDE + Clementine Audioplayer
View twitpix2.sh
#!/bin/bash
#//config
user="twitteruser"
#//Musikinfo von Clementie Audioplayer holen
readarray a <<< "$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep -E 'artUrl|genre|artist|album:|title:'| sed -e 's/xesam://g'| sed -e 's/mpris:artUrl: file:\/\///g')"
#//Bild kopieren
cp ${a[0]} $HOME/bin/twitter-pic/cover.jpg
# Daten an den Twitterclient
text="Ich höre gerade:${a[1]}${a[2]}${a[4]}"
#// Bildgröße in Byte ermitteln
@dewomser
dewomser / twitpix.sh
Created Apr 27, 2022
Bashscript. Mit Hilfe von Twurl können Medien (kleine Bilder) auf Twitter hoch geladen +Text
View twitpix.sh
#!/bin/bash
byte="$(du -b test.png | cut -b -5)"
user="twitteruser"
## // initialisieren mit genauer Byte größe
mis=$(twurl -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=INIT&media_type=image/jpg&total_bytes=$byte" | jq .media_id_string)
mis="${mis:1: -1}"
#//hochladen
twurl -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$mis&segment_index=0" --file test.png --file-field "media" | jq
#//finalisieren
twurl -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=FINALIZE&media_id=$mis" | jq
@dewomser
dewomser / horch_und_toot.desktop
Last active Apr 26, 2022
Desktop Button für KDE/Linux vertootet abgespielte Musik mit Clementine
View horch_und_toot.desktop
[Desktop Entry]
Comment[de_DE]=
Comment=
Exec=readarray a <<< "$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep -E 'artUrl|genre|artist|album:|title:'| sed -e 's/xesam://g'| sed -e 's/mpris:artUrl: file:\\/\\///g')"; toot post "${a[1]} ${a[2]} ${a[3]} ${a[4]}" --media ${a[0]} --debug\n
GenericName[de_DE]=Funktioniert nur wenn in Clementine Musik apielt
GenericName=Funktioniert nur wenn in Clementine Musik apielt
Icon=clementine
MimeType=
Name[de_DE]=Höre und Toote
Name=Höre und Toote
@dewomser
dewomser / listen_to.txt
Last active May 3, 2022
Mastodon "Ich höre gerade"
View listen_to.txt
readarray a <<< "$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep -E 'artUrl|genre|artist|album:|title:'| sed -e 's/xesam://g'| sed -e 's/mpris:artUrl: file:\/\///g')"; toot post "${a[1]} ${a[2]} ${a[3]} ${a[4]}" --media ${a[0]} --debug