Check These Out
Use GNU Parallel: short, easy to read, and will run one job per core.
This is like ping -a, but it does the opposite. It alerts you if the network is down, not up. Note that the beep will be from the speaker on the server, not from your terminal.
Once a second, this script checks if the Internet is accessible and beeps if it is not. I define the Net as being "UP", if I can ping Google's public DNS server (8.8.8.8), but of course you could pick a different static IP address. I redirect the beep to /dev/console so that I can run this in the background from /etc/rc.local. Of course, doing that requires that the script is run by a UID or GID that has write permissions to /dev/console (usually only root).
Question: I am not sure if the -W1 flag works under BSD. I have only tested this under GNU/Linux using ping from iputils. If anybody knows how portable -W is, please post a comment.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Since systemd-resolved was implemented, add a DNS server have become weirder and harder than before. With this command, you can add a DNS server on-the-fly tied to an specific interface
Outputs the number of different pixels.
2 params to increase tolerance:
* thumbnails size
* fuzz, the color distance tolerance
See http://en.positon.org/post/Compare-/-diff-between-two-images for more details.
Stores the certificate expiration date on the variable A
List all open files of all processes.
.
$ find /proc/*/fd
Look through the /proc file descriptors
.
$ -xtype f
list only symlinks to file
.
$ -printf "%l\n"
print the symlink target
.
$ grep -P '^/(?!dev|proc|sys)'
ignore files from /dev /proc or /sys
.
$ sort | uniq -c | sort -n
count the results
.
Many processes will create and immediately delete temporary files.
These can the filtered out by adding:
$ ... | grep -v " (deleted)$" | ...
apart from not being generalisable to all shells, `Y <<< X` seems nicer to me than `echo X | Y`, e.g.
$ <<< lol cat;
it reads easier, you type less, and it also looks cool