diff options
author | root <root@monitoring.shack> | 2012-09-13 23:39:58 +0000 |
---|---|---|
committer | root <root@monitoring.shack> | 2012-09-13 23:39:58 +0000 |
commit | db849a18e1659ff28433384d2cdca2989a6d5df0 (patch) | |
tree | d600fb3f3e5f0a54b6254c85ee8a3b836ef3d90d /util/bin | |
parent | d5d39fc3d56b021b642ee6e1d5625524ebbc4d99 (diff) | |
parent | 88d4bdc29eb9ce5f62099f2be1488ae927aa09d5 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'util/bin')
-rwxr-xr-x | util/bin/naturalvoices2.sh | 6 | ||||
-rwxr-xr-x | util/bin/statsc | 4 | ||||
-rwxr-xr-x | util/bin/timer | 14 |
3 files changed, 24 insertions, 0 deletions
diff --git a/util/bin/naturalvoices2.sh b/util/bin/naturalvoices2.sh new file mode 100755 index 00000000..4d8015aa --- /dev/null +++ b/util/bin/naturalvoices2.sh @@ -0,0 +1,6 @@ +text=$(echo $* | sed 's/ /+/g') +voice="klara" +base_url="http://192.20.225.36" + +mplayer $base_url$( curl -Ss -A "Mozilla" -d "voice=$voice" -d "txt=$text" -d "speakButton=SPEAK" $base_url/tts/cgi-bin/nph-nvdemo |grep HREF|sed 's/.*\(".*"\).*/\1/' |sed -e 's/"//g') + diff --git a/util/bin/statsc b/util/bin/statsc new file mode 100755 index 00000000..ff86ccb8 --- /dev/null +++ b/util/bin/statsc @@ -0,0 +1,4 @@ +#!/bin/sh +# see https://github.com/etsy/statsd for syntax +[ $# -eq 0 ] && echo "usage: $0 MESSAGE" +echo "$1" | nc -w 1 -u 127.0.0.1 8125 diff --git a/util/bin/timer b/util/bin/timer new file mode 100755 index 00000000..0ccf514a --- /dev/null +++ b/util/bin/timer @@ -0,0 +1,14 @@ +#!/bin/bash +curr=$(date '+%s%N') +etime=${curr:0:${#curr}-6} +if [[ $# -eq 0 ]];then + echo $etime +else + [ "$1" == "-h" -o "$1" == "--help" ] && \ + echo "usage: $0 [start_ms]" && \ + echo " if no start_ms is given, return the currentime" && \ + echo " if start_ms is given, return the difference" && exit 0 + stime=$1 + [[ -z "$stime" ]] && stime=$etime + echo $((etime - stime)) +fi |