Check These Out
This dumps serial numbers of all the drives but HP warranty check does not say they are valid ...
locating packages held back, such as with "aptitude hold "
Ever wanted to get the directory content with 'ls' or 'find' and had to wait minutes until something was printed? Perl to the rescue. The one-liner above(redirected to a file) took less than five seconds to run in a directory with more man 2 million files. One can adapt it to e.g. delete files that match a certain pattern.
You have a script where =ALL= STDERR should be redirected to STDIN and you don't want to add "2>&1" at the end of each command...
E.G.:
$ ls -al /foo/bar 2>&1
Than just add this piece of code at the beginning of your script!
I hope this can help someone. :)
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
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
outputs a history of logins on the server (top 10, when piped to 'head'); optional flags: '-a' put the hostname at the end of the line (good for long hostnames), '-i' post the IP instead of the hostname, '-F' put the full login and logout times, rather than short times.
Plays the mp3 stream of The Current as a background job. When you are done run:
$ fg %1
then to exit
Quite possible with Growl for mac I'd guess, although have not tried.
Libnotify needed for notification, stream will still work otherwise