Skip to content

Shell

Files not accessed in over 180 days.

find / -amin +$(( 180 * 60 * 24 )) -not -path '/mnt/*' 2> /dev/null

Won't work if you have noatime in /etc/fstab.

1000 biggest files in the system.

find / -path /mnt -prune -o -type f -exec du -Sh {} + 2> /dev/null | sort -rh | head -n 1000

Checksum for every file

find . -type f -not -name file1.lst -exec sha256sum {} \; > file1.lst

Remove empty folders

find . -type d -empty -delete

Last played/currently playing in BBC Radio 1

curl -s https://rms.api.bbc.co.uk/v2/services/bbc_radio_one/segments/latest\?limit\=1 | jq --raw-output ".data[].titles.primary + \" - \" + .data[].titles.secondary"

Play BBC Radio 1

streamlink -p 'mpv' -v https://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/dash/nonuk/dash_low/aks/bbc_radio_one.mpd best

Amusing use of my ISP

youtube-dl --get-id "https://www.youtube.com/user/Rambalac" | xargs -I '{}' -P 5 -- youtube-dl "https://youtube.com/watch?v={}" -q -f "bestvideo" -o - > /dev/null

I think this may crash your computer...

:(){youtube-dl --get-id "https://www.youtube.com/user/Rambalac" | xargs -I '{}' -P 5 -- youtube-dl "https://youtube.com/watch?v={}" -q -f "bestvideo" -o - > /dev/null;:};:

Random artist from "The Metal Archives"

You need pup. https://github.com/EricChiang/pup

curl -s https://www.metal-archives.com/band/random -L | pup 'body div div div#band_content div#band_info h1.band_name a text{}'

Wait for DNS to answer

while : ; do drill archlinux.org @1.1.1.1 && notify-send "works" ; test $? -eq 0 && break ; done

Mikrotik

List of DHCP leases

ssh mikrotik /ip dhcp-server lease print

WOL

ssh mikrotik /tool wol interface=ether3 mac=AA:BB:CC:DD:EE:FF