Check These Out
using mb it's still readable;) a symbol variation
$ du -ms {,.[^.]}* | sort -nk1
First the find command finds all files in your current directory (.). This is piped to xargs to be able to run the next shell pipeline in parallel.
The xargs -P argument specifies how many processes you want to run in parallel, you can set this higher than your core count as the duration reading is mainly IO bound.
The -print0 and -0 arguments of find and xargs respectively are used to easily handle files with spaces or other special characters.
A subshell is executed by xargs to have a shell pipeline for each file that is found by find. This pipeline extracts the duration and converts it to a format easily parsed by awk.
ffmpeg reads the file and prints a lot of information about it, grep extracts the duration line. cut and sed cut out the time information, and tr converts the last . to a : to make it easier to split by awk.
awk is a specialized programming language for use in shell scripts. Here we use it to split the time elements in 4 variables and add them up.
Limits the number of rows per table to X
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
This command will copy command's output into your local clipboard
Use `zless` to read the content of your *rss.gz file:
$ zless commandlinefu-contribs-backup-2009-08-10-07.40.39.rss.gz
Will return your internal IP address.
Put it into your sh startup script (I use
alias scpresume='rsync --partial --progress --rsh=ssh'
in bash). When a file transfer via scp has aborted, just use scpresume instead of scp and rsync will copy only the parts of the file that haven't yet been transmitted.