Check These Out
use '0' and '9' to increase/decrease volume. this is useful on laptops with low speaker volume.
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
you may as well use shutdown -h 18:32 to shutdown your machine at 18:32.
This command will log the output of your simple cronjobs to syslog, and syslog will take it from there. Works great for monitoring scripts which only produce simple output.
Advantages:
* This can be used by regular users, without modifying system files like /etc/syslog.conf
* Reduce cron spam to root@localhost (Please stop spaming the sysadmins)
* Uses common tools like syslog (and logrotate) so that you don't need to maintain yet another krufty logfile.
* Still ensures that the output is logged somewhere, for posterity. Perhaps it's stored the secure, central syslog server, for example.
* Seems to work fine on Ubuntu, CentOS, FreeBSD & MacOSX
See: http://imgur.com/JgjK2.png for example.
Do some serious benchmarking from the commandline. This will write to a file with the time it took to compress n bytes to the file (increasing by 1).
Run:
$ gnuplot -persist
for Mac OS X
Check the API. You shouldn't need sed. The print-newline at the end is to prevent zsh from inserting a % after the end-of-output.
Also works with http://v.gd
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