Check These Out
Useful to identify the field number in big CSV files with large number of fields. The index is the reference to use in processing with commands like 'cut' or 'awk' involved.
If the dir | wc -l Command not working.
This command will first add an alias known only to git, which will allow you to pull a remote and first-forward the current branch. However, if the remote/branch and your branch have diverged, it will stop before actually trying to merge the two, so you can back out the changes.
http://www.kernel.org/pub/software/scm/git/docs/git-pull.html
Tested on git 1.5.6.1, msysgit (Windows port)
Actually this is not really the way I want it. I want it to attempt a fast-foward, but not attempt to merge or change my working copy. Unfortunately git pull doesn't have that functionality (yet?).
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
imagemagick is required
This is useful for keeping an eye on an error log while developing. The !^ pulls the first arg from the previous command (which needs to be run in a sub-shell for this shortcut to work).
each number in a file name gets expanded to the number of digets provided as arg_1 of the arguments in rjust_file_nums. Put the funciton in the .bashrc file. Be sure to $ source ~/.bashrc so that the function will be accessible from bash.
Here's a version that uses perl. If you'd like a trailing newline:
$ perl -pe 's/(.)/sprintf("\\x%x", ord($1))/eg; END {print "\n"}'