Check These Out
This will change all files ending in .JPG to .jpg and will work with any file extension
makes more sense to customers XD
Convert some decimal numbers to binary numbers. You could also build a general base-converter:
$ function convBase { echo "ibase=$1; obase=$2; $3" | bc; }
then you could write
$ function decToBun { convBase 10 2 $1; }
Alternative to the ping check if your firewall blocks ping. Uses curl to get the landing page silently, or fail with an error code. You can probably do this with wget as well.
This command attempts to attach to existing irssi session, if one exists, otherwise creates one.
I use "irc" because I use different irc clients depending on what system I am working on. Consistency is queen.
I learned a few things reading this command. But I did run into a few issues:
1. On systems that don't use GNU echo (e.g. macOS 10.14.5 Mojave), the e option may not be supported. In this case ANSI escape codes will echoed as text and the terminal will not flash, like this:
\e[?5h\e[38;5;1m A L E R T Thu Jun 20 16:31:29 PDT 2019
2. Since the read command strips\ignores leading backslashes, if a user types the backslash character once in the loop, it will not break. Typing backslash twice in a loop will break as expected.
3. The foreground color is set to red (\e[38;5;1m) on every loop. This could be set once before we call while, and then reset once when the loop breaks.
4. Instead of resetting the foreground color when it breaks, the video mode is set back to normal (\e[?5l). This has the effect of leaving the terminal text red until it is manually reset.
The alternative I'm proposing here addresses these issues. I tested it on macOS and Arch Linux.
from: http://www.unix.com/shell-programming-and-scripting/28047-split-print-path.html
Use the following variation for FreeBSD:
$ openssl rand 6 | xxd -p | sed 's/\(..\)/\1:/g; s/:$//'
Somewhat shorter version.