Check These Out
Example above will recursively find files in current directory created/modified in 2010.
I've seen a lot of overly complicated attempts at figuring out "where am I?"
I think this is a part of the problem:
type -a pwd
force the use of the binary version of `pwd` instead of the built-in with "/bin/pwd -P"
-P option provides an absolute path to the present working directory
for the overly cautious type:
$(which pwd) -P
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
in case you run some command in CLI and would like to take read strerr little bit better, you can use the following command. It's also possible to grep it if necessary....
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
create the function then run 'yt-chanrip username' to download that user's entire channel.
uses youtube-dl and the GData API. similar to http://www.commandlinefu.com/commands/view/3154/download-youtube-playlist
explanation:
grep -- displays process ids
-v -- negates the matching, displays all but what is specified in the other options
-u -- specifies the user to display, or in this case negate
The process loops through all PIDs that are found by pgrep, then orders a forced kill to the processes in numerical order, effectively killing the parent processes first including the shells in use which will force the users to logout.
Tested on Slackware Linux 12.2 and Slackware-current
This gets you your default route programatically, useful for scripts