Check These Out
No need for a colon, and one less semicolon too. Also untested.
Outputs a quick summary of the svn commits for a user over a date range with the detail revision logs including comments and files affected.
Useful for searching for a particular change or reporting by user.
use to execute a block of code only if $var is numeric
Allow to read password in a script without showing the password inserted by the user
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
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
Like command 10870, but no need for sed
This function runs a program in the background, and logs all output to an automatically created logfile. That way, you can still get at the output without it clogging up your terminal.
Tip:
Throw fork() and this:
$for prog in firefox kate konqueror ;do alias $prog="fork $prog";done
into your bashrc, so that they'll automatically run out of the way.
This command remove a file from your filesystem like the normal rm command
but instead of deleting only the inode information this also delete the data that was stored on blocks
/!\ warning this may be long for large files
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"
}