Check These Out
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
Only from a remote machine:
Only access to the server will be logged, but not the command.
The same way, you can run any command without loggin it to history.
ssh user@localhost will be registered in the history as well, and it's not usable.
Uses ImageMagick and potrace to vectorize the input image, with parameters optimized for xkcd-like pictures.
If you don't want to commit files to subversion, and don't want those file to show up when doing an "svn stat", this command is what you need
./* is for copying files starting with -
.[!.]* is for copying hidden files and avoiding copying files from the parent directory.
..?* is for copying files starting with .. (avoids the directory ..)
/path/to/dir the path to the directory where the files should be copied
Can also be used as a script. Input argument is /path/to/dir
in tcsh, replace .[!.]* with .[^.]*
Shows all block devices in a tree with descruptions of what they are.
This is an on-line algorithm for calculating the mean value for numbers in a column. Also known as "running average" or "moving average".
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
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"
}