Check These Out
uses tar to dump files from /orignl/path to /dst/dir. i find tar's out more readable than cp, and it doesn't mess with modified dates.
If your `date` command has `-r` option, you don't need `stat`
This uses Perl's rename utility (you may have to call it as prename on your box) and won't choke on spaces or other characters in filenames. It will also zero pad a number even in filenames like "vacation-4.jpg".
Removes all directories on given path, working from right to left, and stops when reaching a non-empty directory
Counterpart of
$ mkdir -p new/directory/path
Shortcut (must be issues as next command immediately after mkdir):
$ ^mk^rm
( see http://www.commandlinefu.com/commands/view/19/runs-previous-command-but-replacing )
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
Lists all installed RPM packages with name and architecture, which is useful to check for compability packages (+ required i386 packages) on a 64bit system.
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"
}
this command extends your logical volume. then it does a resize2fs on it as well. added the -r switch to make it launch resize.
This is based on __unixmonkey73469__ answer. You will need to supply `--multiline 1` option to JSON importer if your .json is multiline (i.e. it was prettyfied)
And you still need catmandu installed via `cpanm Catmandu`