Check These Out
This one liner; combines all sequentially numbered files; in this example IMG_0001.png to IMG_1121.png by generating the shell script, making the shell script executable and then running the shell script to combine the 1121 png into a single png file named _final.png
tested on Mac OS X 10.6.3 with ImageMagick 6.5.8-0 2009-11-22 Q16 http://www.imagemagick.org
$ sudo apt-get install sl
$ man sl
Whatever store or brand you are interested in, there’s a good chance we’ve got a great Offer for it. Every Day LetSaveBig. LetSaveBig.com features thousands of new LetSaveBig from today’s leading online stores and brands every day.visit us at:
letsavebig.com
Same as `sudo !!`. If you do not have permission to be sudo or sudo does not installed on your system, you can use this.
lists all files that are opened by processess named $processname
egrep 'w.+REG' is to filter out non file listings in lsof, awk to get the filenames, and sort | uniq to remove duplciation
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
Example of zsh globing, glob qualifier, and substitution:
-Q state that the parameter will contain a glob qualifier.
(**/)(*) is recursive
(.) is our glob qualifier, with states the match is a file "."
The first parameter $1, is then substituted with $2 but with lowercasing '(L)' ... a (U) would of course be from lower to upper.
allows simple C shell access to the power of bc - never could figure out how to do the same thing with Bash - that's why I use tcsh most of the time.