Check These Out
Returns your external IP address to the command line using only wget
Maybe this will help you to monitor your load balancers or reverse proxies if you happen to use them. This is useful to discover TIME OUTS and this will let you know if one or more of your application servers is not connected by checking.
Work out last months value
I've been using linux for almost a decade and only recently discovered that most terminals like putty, xterm, xfree86, vt100, etc., support hundreds of shades of colors, backgrounds and text/terminal effects.
This simply prints out a ton of them, the output is pretty amazing.
If you use non-x terminals all the time like I do, it can really be helpful to know how to tweak colors and terminal capabilities. Like:
$ echo $'\33[H\33[2J'
Using this command you can track a moment when usb device was attached.
If you can install rpl it's simpler to use and faster than combinations of find, grep and sed.
See man rpl for various options.
time on above operation: real 0m0.862s, user 0m0.548s, sys 0m0.180s
using find + sed: real 0m3.546s, user 0m1.752s, sys 0m1.580s
Replace 'csv_file.csv' with your filename.
If you're a moron like me, sometimes your fingers get away from you and you, for example, enter your password when you're already authenticated to ssh-agent, sudo, etc., and your password ends up in shell history. Here's how to get it out.
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.