Check These Out
Very useful for rerunning a long command changing some arguments globally.
As opposed to ^foo^bar, which only replaces the first occurrence of foo, this one changes every occurrence.
Get your colorized grep output in less(1). This involves two things: forcing grep to output colors even though it's not going to a terminal and telling less to handle those properly.
1. find file greater than 10 MB
2. direct it to xargs
3. xargs pass them as argument to ls
Find C/C++ source files and headers in the current directory.
This command allows you to see a preview of a picture via the terminal. It can be usefull when you are ssh'ing your server without X-forwarding.
To have en example of the output you can get with this command see http://www.vimeo.com/3721117
Download at http://inouire.net/image-couleur.html
Sources here: http://inouire.net/archives/image-couleur_source.tar.gz
rsync'ing an empty directory over a directory to be deleted recursively is much faster than using rm -rf, for various reasons. Relevant only for directories with really a lot of files.
Shows all block devices in a tree with descruptions of what they are.
In this case, linux- is the prefix; simply running
$apt-cache pkgnames
would list every package APT knows about.
The default APT config assumes -g, --generate; to use the cache as/is, you could similarly run:
$apt-cache --no-generate pkgnames [prefix]
Adding --all-names, like so:
$apt-cache --no-generate --all-names pkgnames [prefix]
would print all the packages APT knows about, using the cache as/is, including virtual packages and missing dependencies.
This command was shamelessly stolen from the apt-cache(8) man-page.
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