Check These Out
Run this command when you are physically at the computer you wish to send pop-up messages to. Then when you ssh in to it, you can do this: echo "guess who?" > commander
guess who? will then pop up on the screen for a few moments, then disappear. You will need to create the commander file first. I mess with my wife all the time with this. i.e. echo "You have given the computer a virus. Computer will be rendered useless in 10 seconds." > commander
lol
Terminal Color tester using python, works with py2 and 3
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
Character: "?" is the Byte Order Mark (BOM) of the Unicode Standard.
Specifically it is the hex bytes EF BB BF, which form the UTF-8 representation of the BOM,
misinterpreted as ISO 8859/1 text instead of UTF-8.
for example if you did a:
$ ls -la /bin/ls
then
$ ls !$
is equivalent to doing a
$ ls /bin/ls
Put the positive clauses after the '-o' option.
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22)
(all files & folders on destination server/folder will be deleted)
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"
}
Checks for PC samba name and workgroup. Works fine for Windows hosts and Linux/UNIX PCs running Samba.