Check These Out
I used this to confirm an upgrade to an SSH daemon was successful
Tested in Linux and OSX
This will launch a listener on the machine that will wait for a connection on port 1234. When you connect from a remote machine with something like :
nc 192.168.0.1 1234
You will have console access to the machine through bash.
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Copies an entire hierarchy of mailboxes from the named POP3/IMAP/etc. source to the named destination. Mailboxes are created on the destination as needed. NOTE: The 'mailutil' is Washington's University 'mailutil' (apt-get install uw-mailutils). More examples
$ mailutil transfer {imap.gmail.com/ssl/user=you@gmail.com}INBOX Gmail/ ; mailutil check imap.gmail.com/ssl/user=you@gmail.com}\[Gmail\]/Spam
If you use the utility in the first, append -v|-d flag(s) to the end the commands above (man mailutil).
Not sure if it works the same on any shell.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
When running a long `diff -r` over folders, this simulates a "verbose" mode where you can see where diff is in the tree.
Replace $file with the first part of the path being compared.
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token.
This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use:
`awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'`
You must adapt the command line to include:
* $MFA_IDis ARN of the virtual MFA or serial number of the physical one
* TTL for the credentials
List the full path of some files.
You can add ".*" on the end if you want to display hidden files.