Check These Out
The vaule is expressed in megabytes
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"
}
remotely connects to an https site, fetches the ssl certificate and displays the valid dates for the cert
i sorta stole this from
http://www.shell-fu.org/lister.php?id=878#MTC_form
but it didn't work, so here it is, fixed.
---
updated to work with jpegs, and to use a fancy positive look behind assertion.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
For instance, if people have signed your key, this will fetch the signers' keys.
Shows a file without comments (at least those starting by #)
- removes empty lines
- removes lines starting by # or "some spaces/tabs then #'"
Useful when you want to quickly see what you have to customize on a freshly installed application without reading the comments that sometimes are a full 1000 lines documentation :)
While posting, I saw this http://www.commandlinefu.com/commands/view/1041/display-contents-of-a-file-wo-any-comments-or-blank-lines
But it's dirty and incomplete, to my mind
My original goal was to remove lines like "\t*#" but I can't figure out how to do a egrep '\t' on a command-line. Two workarounds if needed:
$egrep -v 'press control + V then TAB then #' /your/file
or
$egrep -v -f some_file /your/file #where some_file contains what you want to exclude, example a really inserted TAB
Cycles continuously through a string printing each character with a random delay less than 1 second. First parameter is min, 2nd is max. Example: 1 3 means sleep random .1 to .3. Experiment with different values. The 3rd parameter is the string. The sleep will help with battery life/power consumption.
$ cycle 1 3 $(openssl rand 100 | xxd -p)
Fans of "The Shining" might get a kick out of this:
$ cycle 1 4 ' All work and no play makes Jack a dull boy.'