View firefox_text_wieder_herstellen.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
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 |
View firefox_copy_url.sh
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 |
View videocut.sh
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 |
View google_search.sh
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##*/}" | |
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 | |
read -p "Suche: " query ;lynx -dump --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" | |
else | |
query="$1";lynx -dump --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 |
View luftqualitaet.sh
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 |
View text_erkennen.sh
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 | |
wait | |
text=$(cat "$HOME/bin/text_erkennen.txt") | |
dbus-send --type=method_call --dest=org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents string:"$text" |
View google_query_csv.sh
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. |
View umweltdaten.sh
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]} |
View toot_a_photostream.sh
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" |
View mastodon_user.sh
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
# userlist only address : | |
toot search bash | grep ^* |awk '{print $2}' | |
# userlist and profile advanced : | |
readarray -t tooter_array <<<"$(toot search bash | grep ^* |awk '{print $2}')" && for i in "${tooter_array[@]}"; do echo -e "$(toot whois $i) \n ------------------\n";done |
NewerOlder