Check These Out
The title is optional.
Options:
-t: expire time in milliseconds.
-u: urgency (low, normal, critical).
-i: icon path.
On Debian-based systems you may need to install the 'libnotify-bin' package.
Useful to advise when a wget download or a simulation ends. Example:
$ wget URL ; notify-send "Done"
This appends (-A) a new rule to the INPUT chain, which specifies to drop all packets from a source (-s) IP address.
Brightness indicator to be used in scripts that adjust brightness [especially sys that doesn't support automatically]
This loop will finish if a file hasn't changed in the last 10 seconds.
.
It checks the file's modification timestamp against the clock.
If 10 seconds have elapsed without any change to the file, then the loop ends.
.
This script will give a false positive if there's a 10 second delay between updates,
e.g. due to network congestion
.
How does it work?
'date +%s' gives the current time in seconds
'stat -c %Y' gives the file's last modification time in seconds
'$(( ))' is bash's way of doing maths
'[ X -lt 10 ]' tests the result is Less Than 10
otherwise sleep for 1 second and repeat
.
Note: Clever as this script is, inotify is smarter.
Creates a quick backup with tar to a remote host over ssh.
Run netstat as root (via sudo) to get the ID of the process listening on the desired socket.
Use awk to 1) match the entry that is the listening socket, 2) matching the exact port (bounded by leading colon and end of column), 3) remove the trailing slash and process name from the last column, and finally 4) use the system(…) command to call kill to terminate the process.
Two direct commands, netstat & awk, and one forked call to kill.
This does kill the specific port instead of any port that starts with 50. I consider this to be safer.
see the TIME_WAIT and ESTABLISHED nums of the network
curl -sLkIv --stderr - https://t.co/2rQjHfptZ8
-s: silences the output when piped to a different command
-L: follow every redirect
-k: ignores certificate errors
-I: just request the headers
-v: be verbose
--stderr - : redirect stderr to stdout
https://t.co/2rQjHfptZ8: URL to check for redirects
piped to
grep -i location:
-i: grep target text ignoring case
location: : greps every string containing "location:"
piped to
awk {'print $3'}
prints the third column in every string
piped to
sed '/^$/d'
removes blank lines