Check These Out
This command is useful for renaming a clipart, pic gallery or your photo collection. It will only change the big caps to small ones (on the extension).
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22)
(all files & folders on destination server/folder will be deleted)
Using the 'time' command, running this with 'tr' took 28 seconds (and change) each time but using base64 only took 8 seconds (and change). If the file doesn't have to be viewable, pulling straight from urandom with head only took 6 seconds (and change)
Sometimes, you don't really care about all the other information that ifconfig spits at you (however useful it may otherwise be). You just want an IP. This strips out all the crap and gives you exactly what you want.
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
Based on http://stackoverflow.com/questions/13127352/checking-alternative-names-for-a-san-ssl-cert
Replace "facebook.com" with the desired hostname.
Very nice command when you want to download a site locally to your machine, including images, css and javascript