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
If script.sh contains only these two lines:
$ uname -a
$ whoami
I just found another use for the builtin ':' bash command. It increments counters for me in a loop if a certain condition is met...
: [arguments]
No effect; the command does nothing beyond expanding arguments and performing any specified redirections. A zero exit code is returned.
This is an alternative to another command using two xargs. If it's a command you know there's only one of, you can just use:
$ ls -l /proc/$(pgrep COMMAND)/cwd
Same as the other rtfm's, but using the more correct xdg-open instead of $BROWSER.
I can't find a way to open info only if the term exists, so it stays out of my version.
Using this command you can track a moment when usb device was attached.
Here is a command line to run on your server if you think your server is under attack. It prints our a list of open connections to your server and sorts them by amount.
BSD Version:
$ netstat -na |awk '{print $5}' |cut -d "." -f1,2,3,4 |sort |uniq -c |sort -nr
Lists out all classes used in all *.html files in the currect directory. usefull for checking if you have left out any style definitions, or accidentally given a different name than you intended. ( I have an ugly habit of accidentally substituting camelCase instead of using under_scores: i would name soemthing counterBox instead of counter_box)
WARNING: assumes you give classnames in between double quotes, and that you apply only one class per element.
Replace 'csv_file.csv' with your filename.