Check These Out
compgen -c finds everything in your path.
Compute the md5 checksums for the contents of two mirrored directories, then sort and diff the results. If everything matches, nothing is returned. Otherwise, any checksums which do not match, or which exist in one tree but not the other, are returned. As you might imagine, the output is useful only if no errors are found, because only the checksums, not filenames, are returned. I hope to address this, or that someone else will!
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 one liner is to kill all google chrome tabs. This works similar to $ killall firefox command which is to kill all firefox processes.
This command uses the debugger to attach to a running process, and reassign a filehandle to a file.
The two commands executed in gdb are
p close(1) which closes STDOUT
and
p creat("/tmp/filename",0600)
which creates a file and opens it for output. Since file handles are assigned
sequentially, this command opens the file in place of STDOUT and once the process continues, new output to STDOUT will instead be written to our capture file.
This is handy for making screenshots of all your videos for referring to in your flv player.
need pv (pipe view) :
http://www.ivarch.com/programs/pv.shtml
With this command you can convert a tab separate file (TSV) into a JSON file with jq.
For example, this input.tsv
i-0b9adca882e5e6326 172.16.0.188
i-088dd69e5c3624888 172.16.0.102
i-0e70eac180537d4aa 172.16.0.85
will produce the showed output.