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
gives u each configured IP in a seperate line.
Use `zless` to read the content of your *rss.gz file:
$ zless commandlinefu-contribs-backup-2009-08-10-07.40.39.rss.gz
Each shell function has its own summary line, as a comment. If there are multiple shell functions with the same name, the function with the highest number of votes is put into the file.
Note: added 'grep -v' to the end of the pipeline, to eliminate extraneous lines containing only '--'. Thanks to matthewbauer for pointing this out.
This is a better version, as it does no command piping, uses for instead of while loops, which allows for a list of files in the current working directory to be natively processed. It also uses the -v/verbose option with mv to let you know what the command is doing.
While the command does exactly the same in a better way, I would modify the sed option to replace spaces with underscores instead, or dashes.
Please note that you'll receive errors with this command as it tries to rename files that don't even have spaces.
This is an alternative to: http://www.commandlinefu.com/commands/view/8761/renames-all-files-in-the-current-directory-such-that-the-new-file-contains-no-space-characters.
Best to try first with -n flag, to preview
Reads stdin, and outputs each line only once - without sorting ahead of time. This does use more memory than your system's sort utility.
If archive has leading directory level same as archive name and you want to strip it, this command is for you.