From 2a58f1af8074963ccbeec13a10811fefe2ceb113 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 Jun 2011 21:06:16 +0200 Subject: added evan script evan: espeak sublimal messages, -d for daemonization (in while loop with random delay) evan-startup: startup script for init.d (does the totally right thing on debian satz-liste: contains the list of things to be espeaked Makefile: do make infest for the right thing --- evan/Makefile | 8 ++++++ evan/evan | 27 ++++++++++++++++++++ evan/evan-startup | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ evan/satz-liste | 9 +++++++ 4 files changed, 117 insertions(+) create mode 100644 evan/Makefile create mode 100755 evan/evan create mode 100755 evan/evan-startup create mode 100644 evan/satz-liste diff --git a/evan/Makefile b/evan/Makefile new file mode 100644 index 00000000..366e86ee --- /dev/null +++ b/evan/Makefile @@ -0,0 +1,8 @@ +.PHONY: infect +INSTALL_DIR = /root/bin +infect: + mkdir -p ${INSTALL_DIR} + cp evan ${INSTALL_DIR} + cp evan-startup /etc/init.d/evan + update-rc.d evan start + diff --git a/evan/evan b/evan/evan new file mode 100755 index 00000000..83443fe2 --- /dev/null +++ b/evan/evan @@ -0,0 +1,27 @@ +#!/bin/bash +SATZ_LISTE=/root/evan/satz-liste +p="${noise_pitch-10}" +v="${noise_lang-de}" +k="${noise_capital-0}" +a="${noise_amplitude-100}" +g="${noise_gap-1}" +RND_DELAY=10000 +#set -x +function helpme () +{ + cat << EOF + $0 [-d] + -d -- daemonize + -h -- this help file +EOF + exit 0 +} + +[ "${1:-}" = "-h" ] && helpme + +while true +do + espeak -v $v -p $p -k $k -a $a -g $g "`shuf \"$SATZ_LISTE\" | tail -1`" + [ ! "${1:-}" = "-d" ] && exit 0 # break if not daemonized + sleep $((${RANDOM}%${RND_DELAY})) +done diff --git a/evan/evan-startup b/evan/evan-startup new file mode 100755 index 00000000..a3370bd1 --- /dev/null +++ b/evan/evan-startup @@ -0,0 +1,73 @@ +#! /bin/sh +# +### BEGIN INIT INFO +# Provides: evan +# Required-Start: $remote_fs $network +# Required-Stop: $remote_fs $network +# Should-Start: $syslog $named +# Should-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start evan daemons +# Description: + +### END INIT INFO +# +# Based on Lubomir Bulej's Redhat init script. + +DAEMON="/root/bin/evan" +PIDFILE="/var/lock/evan" +NAME="evan" +DESC="evan daemons" +TCONF="/etc/evan" + +test -f $DAEMON || exit 0 + +[ -r /etc/default/evan ] && . /etc/default/evan + + +start() { + [ -e $PIDFILE ] && echo "$PIDFILE already exists" && return + $DAEMON $EXTRA -d "$@" & + echo $(($$+1)) > $PIDFILE #TODO fix this ugly hack! +} +stop() { + [ ! -e $PIDFILE ] && echo "$PIDFILE does not exist" && return + kill `cat $PIDFILE` + rm $PIDFILE +} + +reload() { + echo "do nothing" + # do nothing +} + +restart() { + stop "$@" + start "$@" +} + +case "$1" in + start) + echo -n "Starting $DESC:" + start + ;; + stop) + echo -n "Stopping $DESC:" + stop + ;; + reload|force-reload) + echo -n "Reloading $DESC configuration:" + reload + ;; + restart) + echo -n "Restarting $DESC:" + restart + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}" + exit 1 + ;; +esac +echo "done" +exit 0 diff --git a/evan/satz-liste b/evan/satz-liste new file mode 100644 index 00000000..3c28f38f --- /dev/null +++ b/evan/satz-liste @@ -0,0 +1,9 @@ +wenn ich meinen erzeugten abfall vor dem nach hause gehen beseitige steigt mein soziales ansehen +bringe eine pflanze mit +ein sauberer scheck ist ein guter scheck +auch du weißt wie man den geschirrspüler einräumt +wer die toilette putzt kommt in den himmel +der große bruder sieht es gerne wenn die genossen die vereinsräume in stand halten +henry der staubsauger saugt für dich +muelltrennung bringt gutes karma +saubere mitglieder sind glückliche mitglieder -- cgit v1.2.3 From 12a72e1e32810ea5e89d2d8731817fd283fc2c26 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Jun 2011 01:03:39 +0200 Subject: updated evan fixed Makefil fixed everything else --- evan/Makefile | 1 + evan/evan | 6 +++--- evan/evan-startup | 1 + evan/satz-liste | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/evan/Makefile b/evan/Makefile index 366e86ee..f87e8505 100644 --- a/evan/Makefile +++ b/evan/Makefile @@ -3,6 +3,7 @@ INSTALL_DIR = /root/bin infect: mkdir -p ${INSTALL_DIR} cp evan ${INSTALL_DIR} + cp satz-liste ${INSTALL_DIR} cp evan-startup /etc/init.d/evan update-rc.d evan start diff --git a/evan/evan b/evan/evan index 83443fe2..608ac6b8 100755 --- a/evan/evan +++ b/evan/evan @@ -1,11 +1,11 @@ #!/bin/bash -SATZ_LISTE=/root/evan/satz-liste +SATZ_LISTE=/krebs/evan/satz-liste p="${noise_pitch-10}" v="${noise_lang-de}" k="${noise_capital-0}" -a="${noise_amplitude-100}" +a="${noise_amplitude-600}" g="${noise_gap-1}" -RND_DELAY=10000 +RND_DELAY=3600 #set -x function helpme () { diff --git a/evan/evan-startup b/evan/evan-startup index a3370bd1..8a7f8daa 100755 --- a/evan/evan-startup +++ b/evan/evan-startup @@ -34,6 +34,7 @@ start() { stop() { [ ! -e $PIDFILE ] && echo "$PIDFILE does not exist" && return kill `cat $PIDFILE` + #killall evan rm $PIDFILE } diff --git a/evan/satz-liste b/evan/satz-liste index 3c28f38f..7586ea3b 100644 --- a/evan/satz-liste +++ b/evan/satz-liste @@ -7,3 +7,4 @@ der große bruder sieht es gerne wenn die genossen die vereinsräume in stand ha henry der staubsauger saugt für dich muelltrennung bringt gutes karma saubere mitglieder sind glückliche mitglieder +fnord -- cgit v1.2.3 From d303e6041410abb7282ccfc26017d9d32bd2908d Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Jun 2011 01:05:00 +0200 Subject: updated people script mac_names updated with more names --- people/arping_users.py | 6 ++---- people/mac_names.lst | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/people/arping_users.py b/people/arping_users.py index c576e4f3..008fe337 100755 --- a/people/arping_users.py +++ b/people/arping_users.py @@ -21,7 +21,7 @@ def load_names(MAC_NAMES): names = {} f = open(MAC_NAMES) for l in f: - mac,name = l.split() + mac,name = l.split(' ',1) names[mac] = name.replace('\n','') f.close() return names @@ -29,7 +29,7 @@ def load_names(MAC_NAMES): def arping_helper(dic): return arpingy(**dic) -for first in range(4): +for first in range(1,3): for second in range(255): data.append({'iprange':'10.42.'+str(first)+'.'+str(second),'iface':DEV}) @@ -50,5 +50,3 @@ for p in ret: print p[0] + " => " + p[1] if p[1] in names: print names[p[1]]+ " is online" - - diff --git a/people/mac_names.lst b/people/mac_names.lst index dcd3c2b0..ae58b539 100644 --- a/people/mac_names.lst +++ b/people/mac_names.lst @@ -1 +1,7 @@ 00:40:63:c8:b5:a0 krebs +00:23:54:29:1d:3e hadez +00:26:c7:bd:a7:1a Martin +04:1e:64:05:39:28 Stephan +5c:59:48:22:2d:d2 Phil +00:21:00:fb:5c:b6 Kah Hah +00:1e:64:27:3b:72 Felix -- cgit v1.2.3