Check These Out
Using this command you can track a moment when usb device was attached.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
This takes a picture (with the web cam) every 5 minutes, and send the picture to your e-mail.
Some systems support
mail -a "References: "
so that all video surveillance emails are grouped in a single email thread.
To keep your inbox clean, it is still possible to filter and move to trash video surveillance emails (and restore these emails only if you really get robbed!)
For instance with Gmail, emails sent to me+trash@gmail.com can be filtered with "Matches: DeliveredTo:me+trash@gmail.com"
specially usefull for sql scripts with insert / update statements, to add a commit command after n statements executed.
Very useful for interactive scripts where you would like to return the terminal contents to its original state before the script was run. This would be similar to how vi exits and returns you to your original terminal screen.
Save and clear the terminal contents with:
$tput smcup
Execute some commands, then restore the saved terminal contents with:
$tput rmcup
$ wget -qO - "http://www.google.com/dictionary/json?callback=dict_api.callbacks.id100&q=steering+wheel&sl=en&tl=en&restrict=pr,de&client=te"
this does the actual google dictionary query, returns a JSON string encapsulated in some fancy tag
$ sed 's/dict_api\.callbacks.id100.//'
here we remove the tag beginning
$ sed 's/,200,null)//'
and here the tag end
There are also some special characters which could cause problems with some JSON parsers, so if you get some errors, this is probably the case (sed is your friend).
I laso like to trim the "webDefinitions" part, because it (sometimes) contains misleading information.
$ sed 's/\,\"webDefinitions.*//'
(but remember to append a "}" at the end, because the JSON string will be invalid)
The output also contains links to mp3 files with pronounciation.
As of now, this is only usable in the English language. If you choose other than English, you will only get webDefinitions (which are crap).
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
Awk replaces every instance of foo with bar in the 5th column only.
Prints the top 10 memory consuming processes (with children and instances aggregated) sorted by total RSS and calculates the percentage of total RAM each uses. Please note that since RSS can include shared libraries it is possible for the percentages to add up to more that the total amount of RAM, but this still gives you a pretty good idea. Also note that this does not work with the mawk version of awk, but it works fine with GNU Awk which is on most Linux systems. It also does not work on OS X.