This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2K | |
Searching toots for bash 1 of 2266 [#>---------------------------] 0.04% | |
Found toot: #Linux #Bash Skript Da gibt man sich Mühe mit seiner ASCII-Kunst und wenn man das Werk in einer Webseite anzeigen lassen will, ist alles kaputt wegen dem falschen Zeichenfont. dort. Diese Skript macht einr PNG-Grafik und dann passt das immer. https://gist.github.com/dewomser/cea719bec695d36d9e083d46ba13257a Beispiel:Die Stadt Worms.de hat einen informativen Rss-Feed. Hier kommt der Link zum Bild:https://www.worms.de/neu-de/aktuelles/meldungen/2023-10-12-10-28-00.php | |
Date: 16 Oct 23 14:40 UTC | |
URL: https://social.tchncs.de/@dewomser/111245213231688902 | |
Found toot: #bash exifFoto Beschreibung als Text in *.txtFür eine #Fotoshow, soll für jedes Photo eine gleichlautende Datei aber mit Endung txt erstellt werden.Verwende zusätzlich "Keywords" aus dem Metatags Exif ! for i in {5..7} ;do photo=100_125$i; exif=$(exiftool -Keywords $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FYI, when a website erases your text that you just spent an hour writing, you can use this little trick to recover it 99% of the time: | |
1. find the firefox pid | |
$ pgrep -l firefox | |
2. attach gdb to firefox and dump its core | |
$ sudo gdb -p <pid> | |
gcore firefox.dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# xdotool is necessary | |
# Search for the visible Firefox window(s) and get its window ID | |
window_id=$(xdotool search --onlyvisible --class "firefox") | |
# Send the keyboard shortcut to open the URL bar, copy the URL to clipboard and then close the URL bar by sending the Escape key. | |
# The command is sent to the Firefox window with the specified ID using the --window option. | |
xdotool key --window $window_id --delay 20 --clearmodifiers ctrl+l ctrl+c Escape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmpeg -i porn.mp4 -ss 7 -t 01:26 porn_xxx.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#/usr/bin/shellcheck "${0##*/}" | |
#/var/lib/snapd/snap/bin/shellcheck "${0##*/}" | |
echo -e '\e[38mG\e[m' '\e[31mo\e[m' '\e[33mo\e[m' '\e[38mg\e[m' '\e[32ml\e[m' '\e[31me\e[m' | |
if [[ -z $1 ]] ; then | |
eingabe="read -p Suche: query" | |
else | |
query="$1" | |
eingabe=$(query=\"$query\") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ba=https://www.umweltbundesamt.de | |
readarray -td ";" lq <<< $(curl "$ba/api/air_data/v3/airquality/csv?date_from=$(date -d 'yesterday' +%F)&time_from=24&date_to=$(date +%F)&time_to=24&station=1460&lang=de" |grep -E x\|$(date -d '1 hours ago' +%H)) | |
echo ${lq[1]}:${lq[7]};echo ${lq[2]}:${lq[8]};echo ${lq[3]}:${lq[9]};echo ${lq[4]}:${lq[10]};echo ${lq[5]}:${lq[11]};echo ${lq[6]}:${lq[12]} | |
#Messtationen gibts hier: | |
#https://www.umweltbundesamt.de/daten/luft/luftdaten/stationen/ | |
#Messtationcode kopieren und in Zeile 3 ersetzen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
/usr/bin/import "$HOME"/bin/text_erkennen.png | |
wait | |
tesseract -l deu "$HOME"/bin/text_erkennen.png "$HOME"/bin/text_erkennen | |
#eng,deu,… | |
wait | |
cat "$HOME"/bin/text_erkennen.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mit http | |
# funktioniert sofort. | |
query="linux%20worms";lynx -dump -cookies="" --display_charset=utf-8 "http://google.com/search?q=$(echo $query | sed 's/ /+/g')"|grep '^[[:blank:]][[:blank:]].[[:digit:]][[:punct:]]'| grep http://www.google.com/url\?q=http | sed -e 's/http:\/\/www.google.com\/url?q=//g' |sed -e 's/&sa=.*$//g'|grep -v google | cut -c5- | sed -rn "=;p;"| sed -r "N;s/\n//" | sed -e "s/\<\([0-9]\{1,2\}\)\>/0000\1/; s/\<0*\([0-9]\{2\}\)\>/\1/" |sed -e "s/^/ /g"| sed -e "s/\./;/1" > googlequery.csv | |
# mit https und cookies. | |
# Damit die Zeile funktioniert: | |
# zuerst "lynx-cookies -accept_all_cookies https://www.google.com" | |
# dann das Zeugs bestätigen damit alle Cookies persistent gesetzt sind | |
# danach funktioniert diese Zeile solange die Cookies nicht gelöscht werden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Daten werden mit > 1h < 2h Zeitverzögerung angegben | |
# Hier gibts die URL https://www.umweltbundesamt.de/daten/luft/luftdaten/luftqualitaet/ -> Stadt auswählen -> die URL ist der Link unter "Als CSV herunterladen" | |
# -> Stationsnummer In die nächste Teile kopieren | |
readarray -td ";" lq <<< $(curl "https://www.umweltbundesamt.de/api/air_data/v3/airquality/csv?date_from=$(date -d 'yesterday' +%F)&time_from=24&date_to=$(date +%F)&time_to=24&station=1460&lang=de" |grep -E x\|$(date -d '1 hours ago' +%H)) | |
echo ${lq[1]}:${lq[7]};echo ${lq[2]}:${lq[8]};echo ${lq[3]}:${lq[9]};echo ${lq[4]}:${lq[10]};echo ${lq[5]}:${lq[11]};echo ${lq[6]}:${lq[12]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#crontab | |
#for crontab use always full path or EXPORT | |
#crontabline : */15 * * * * /full/path/toot_a_photostream.sh >/full/path/error.txt 2>&1 | |
toottext="Your text at $(date +%H:%M) . New snapshot every 15 minutes!" | |
tootid="$(cat /full/path/tootid.txt)" | |
sleep 120 | |
if [ -z "$tootid" ]; then | |
echo "still no ID" |