summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot/tor.sh80
-rw-r--r--god/ivan/announce.wavbin0 -> 691244 bytes
-rwxr-xr-xgod/ivan/ivan1
-rw-r--r--god/ivan/satz-liste1
m---------minikrebs0
-rwxr-xr-xutil/bin/naturalvoices.att2
6 files changed, 83 insertions, 1 deletions
diff --git a/boot/tor.sh b/boot/tor.sh
new file mode 100755
index 00000000..d257e955
--- /dev/null
+++ b/boot/tor.sh
@@ -0,0 +1,80 @@
+#!/bin/sh
+set -efu
+msg() { printf "$@\n" >&2 ;}
+info() { msg "** $@" ;}
+error() { msg "!! $@" ;}
+exists(){ type "$1" >/dev/null 2>/dev/null; }
+get_hostname(){
+ # finds the current hostname
+ # if ENV HOSTN is set echo $HOSTN
+
+ if [ -n "${HOSTN:-}" ] ; then printf "${HOSTN:-}"
+ elif exists hostname ; then printf "${HOSTNAME:-$(hostname)}"
+ elif exists uci ; then printf "$(uci get system.@system[0].hostname)"
+ elif [ -e /etc/hostname ] ;then printf "$(cat /etc/hostname)"
+ else printf "unknown"
+ fi
+}
+
+anytelnet(){
+ # find Telnet or similar
+ # requires exist
+ # if env TELNET is set, will be trying to run this
+ if [ -e "${TELNET:-does_not_exist}" ]; then
+ info"Will be using $TELNET as Telnet Client"
+ elif exists telnet >/dev/null;then
+ TELNET="`command -v telnet`"
+ elif exists nc >/dev/null;then
+ TELNET="`command -v nc`"
+ elif exists netcat >/dev/null;then
+ TELNET="`command -v netcat`"
+ elif exists busybox >/dev/null;then
+ TELNET="`command -v busybox` telnet"
+ else
+ error "Cannot find telnet binary, please install either telnet-client or busybox or netcat or provided TELNET environment.\nbailing out!"
+ return 1
+ fi
+ $TELNET $@
+}
+
+send_irc(){
+ to_dots(){ while read line; do printf .; done;}
+ ## reads from stdin, writes to IRC
+ ##
+ ## requires func: exists() anytelnet()
+ if [ -z "${HOSTN:-}" ]; then
+ HOSTN="$(get_hostname)"
+ info "no HOSTN given, using $HOSTN instead"
+ fi
+ IRCCHANNEL=${IRCCHANNEL:-"#krebs_incoming"}
+ IRCSERVER=${IRCSERVER:-"irc.freenode.net"}
+ IRCPORT=${IRCPORT:-6667}
+ NICK="${HOSTN}_$(head /dev/urandom | tr -dc "0123456789" | head -c3)"
+ info "starting irc connect as $NICK"
+ ( echo "NICK $NICK";
+ echo "USER $NICK $IRCSERVER bla : $NICK";
+ echo "JOIN $IRCCHANNEL";
+ sleep 23;
+ while read line; do echo "PRIVMSG $IRCCHANNEL :$line";sleep 1;done
+ sleep 5; ) | anytelnet $IRCSERVER $IRCPORT 2>/dev/null | to_dots
+}
+
+# can be set via env:
+# torrc - path to torrc (default: /etc/tor/torrc )
+# hidden_service_dir - path to hidden service (default: /var/lib/tor/hidden_service/ )
+
+torrc=${torrc:-/etc/tor/torrc}
+hidden_service_dir=${hidden_service_dir:-/var/lib/tor/hidden_service/}
+
+test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 )
+if ! grep -q '^HiddenService' "$torrc" ;then
+ info "adding hidden service to $torrc"
+ cat >> "$torrc" << EOF
+HiddenServiceDir ${hidden_service_dir}
+HiddenServicePort 22 127.0.0.1:22
+EOF
+else
+ info "HiddenServiceDir or Port already in $torrc, skipping!"
+fi
+
+cat $hidden_service_dir/hostname | send_irc
diff --git a/god/ivan/announce.wav b/god/ivan/announce.wav
new file mode 100644
index 00000000..54ec73cf
--- /dev/null
+++ b/god/ivan/announce.wav
Binary files differ
diff --git a/god/ivan/ivan b/god/ivan/ivan
index 136527f4..f8cbcb8b 100755
--- a/god/ivan/ivan
+++ b/god/ivan/ivan
@@ -28,6 +28,7 @@ EOF
while true
do
+ aplay announce.wav
if [ -n "${USING_ESPEAK:-}" ];then
espeak -v $v -p $p -k $k -a $a -g $g "`shuf \"$SATZ_LISTE\" | tail -1`"
else
diff --git a/god/ivan/satz-liste b/god/ivan/satz-liste
index 048943ee..880bba45 100644
--- a/god/ivan/satz-liste
+++ b/god/ivan/satz-liste
@@ -37,3 +37,4 @@ mache dich mit den standorten der feuerlöscher vertraut
Steuerung Alt Entfernen
Leute die Nubsies von Netzwerk kabeln abbrechen, werden geschlagen
Setz dich, nimm dir nen Keks, machs dir Schön bequem
+warum liegt denn hier stroh rum
diff --git a/minikrebs b/minikrebs
-Subproject d44469e4fa51171c12fff95b1a3170eb8532869
+Subproject fa0c14a2c221da6e1f2f04c75fe8ed6bff858a6
diff --git a/util/bin/naturalvoices.att b/util/bin/naturalvoices.att
index 4590d913..ea893fc0 100755
--- a/util/bin/naturalvoices.att
+++ b/util/bin/naturalvoices.att
@@ -6,7 +6,7 @@ cd $(dirname $(readlink -f $0))
: ${1?please provide \$1 as text}
text=$(echo $* | sed 's/ /+/g')
-voice="reiner"
+voice="${voice:-reiner}"
OUTFILE="`mktemp /tmp/voice.XXXXXXXX`"
trap "rm $OUTFILE" TERM INT EXIT