Skip to content

Instantly share code, notes, and snippets.

View disable_highlited_paste_in_term.txt
echo "set enable-bracketed-paste off" >> ~/.inputrc
View fm-radio-both-rds-and-audio.txt
{ rtl_fm -M fm -l 0 -A std -p 0 -s 171k -g 40 -F 9 -f 106.2M | redsea -e 2>&1 1>&3 3>&- | jq -c . ; } 3>&1 1>&2 | aplay -r 171k -f S16_LE
View wget-curl-redirect-real-filename.txt
Correct download filename when redirected with wget and curl
$ wget --content-disposition
$ curl -J -O
View x-clipboard-from-cli.txt
$ sudo apt-get install xclip
$ man xclip
specify which X selection to use, options are "primary" to use XA_PRIMARY (default), "secondary" for XA_SECONDARY or "clipboard" for XA_CLIPBOARD
$ xclip -i log.txt
View wget-ignore-robots.txt
$ wget -e robots=off --wait 1
View abuse-prepaid-quota.txt
# while true; do qp g+ && timeout 10 apt-get -y install elinks; qp g-; sleep 1; done
# time while true; do date +"%F %T"; ./3g-connect && echo "ip address: $(ip addr show dev gprs0 | grep inet | awk '{print $2}')"; timeout 5 wget --progress=dot -c && break; echo; ./3g-disconnect; sleep 1; echo; done
View chromium.desktop-fix.txt
$ sudo sed -i 's@bin/chromium@bin/chromium -incognito@' /usr/share/applications/chromium.desktop
View rdesktop.txt
$ rdesktop -g 90% -r clipboard:CLIPBOARD
View preserve_date_in_replace.txt
Preserve file timestamp in multifile string replace
-I to grep ignores binary files,
@ in sed works as separator for strings with /
-r in touch uses existing file timestap as a reference
$ grep -IR aaaa /somepath/ | awk -F: '{print $1}' | while read line; do touch -r $line /tmp/timeref; sed -i 's@aaaa@bbbb@' $line; touch -r /tmp/timeref $line; done
View wallabag-pdf-utf8-fix.txt
$ dpkg -L php-tcpdf | grep fonts
$ cp /usr/share/php/tcpdf/fonts/dejavusans* ./inc/3rdparty/libraries/tcpdf/fonts/
$ cp ./inc/poche/WallabagEBooks.class.php ./inc/poche/WallabagEBooks.class.php.dist
$ vi ./inc/poche/WallabagEBooks.class.php