this post was submitted on 12 Jun 2024
90 points (96.9% liked)

Linux

5800 readers
304 users here now

A community for everything relating to the linux operating system

Also check out [email protected]

Original icon base courtesy of [email protected] and The GIMP

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 11 points 7 months ago (4 children)

A script full of functions that I perform often, like:

  • Probe every 5min for internet connection. Play Black Sabbath when there is. (My internet goes down often.)
  • Create individual tarballs/zips/rars for each subdir.
  • Extract all tarballs/zips/rars from a dir. (It detects the format on its own)
  • Extract all files of a DwarFS file into a dir.
  • Re-encode all vids from a dir.
  • Delete all thumbnail pictures from my user.
  • Find and remove all desktop.ini and thumbs.db files in a dir, recursively.

My .bashrc then sources that script, so to use those functions I simply open a terminal. And if I ever need to delete my .bashrc and recreate it anew, they're safely stored in my scripts directory.

[–] redbr64 3 points 7 months ago (2 children)

The black Sabbath for Internet connection is hilarious. Did you get that from the Bitcoin mining trigger bit on Silicon Valley?

[–] [email protected] 7 points 7 months ago (1 children)

No, that's a coincidence. I wanted something that: started loud, was easy to recognise, I don't mind hearing, and my neighbours don't listen to. Wicked World it is.

Here's the code by the way, with the echo translated:

lvxInternetCheck () {
	while [[ $(ping -c 5 8.8.8.8 | grep -o "100% packet loss") == "100% packet loss" ]]
		do echo "No internet at $(date +%R)." ; sleep 300
		done
	echo "Internet came back at $(date +%R)."
	cvlc /[redacted]/08\ -\ Wicked\ World.mp3 
	}

It's dirty but it works. (My functions start with "lvx" to avoid the tiny chance that they might clash with system functions.)

[–] redbr64 2 points 7 months ago

Ha, very nice!

load more comments (1 replies)