From 2ece835fcffbd14f63ae0654d58713d4047c8a25 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 17 Feb 2014 12:46:49 +0100 Subject: whatweb: add firefox 25 user agent to whatweb --- Reaktor/commands/whatweb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Reaktor/commands') diff --git a/Reaktor/commands/whatweb b/Reaktor/commands/whatweb index afe20360..68f8aa38 100755 --- a/Reaktor/commands/whatweb +++ b/Reaktor/commands/whatweb @@ -4,4 +4,4 @@ here=$(dirname `readlink -f $0`) whatweb_bin="$here/../repos/whatweb/whatweb" [ ! -e "$whatweb_bin" ] && echo "!! Whatweb app does not exist" && exit 1 [ -z "${1:-}" ] && echo "!! no host given" && exit 1 -exec $whatweb_bin -a 3 "$1" 2>&1 +exec $whatweb_bin --user-agent="Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" -a 3 "$1" 2>&1 -- cgit v1.2.3 From c3b00da20b5b6fc1147052b1dff55c4f5f9e67e6 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Mar 2014 14:24:47 +0100 Subject: add visit page module for reaktor --- Reaktor/commands/visit-page | 1 + 1 file changed, 1 insertion(+) create mode 120000 Reaktor/commands/visit-page (limited to 'Reaktor/commands') diff --git a/Reaktor/commands/visit-page b/Reaktor/commands/visit-page new file mode 120000 index 00000000..be95ca4c --- /dev/null +++ b/Reaktor/commands/visit-page @@ -0,0 +1 @@ +../repos/visit-website/runner.sh \ No newline at end of file -- cgit v1.2.3 From c48ee1d169a77902442639f6bc48d0a7b291eafb Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Mar 2014 14:42:16 +0100 Subject: Reaktur: fix symlink to visit-page script --- Reaktor/commands/visit-page | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Reaktor/commands') diff --git a/Reaktor/commands/visit-page b/Reaktor/commands/visit-page index be95ca4c..8723336b 120000 --- a/Reaktor/commands/visit-page +++ b/Reaktor/commands/visit-page @@ -1 +1 @@ -../repos/visit-website/runner.sh \ No newline at end of file +../repos/view-website/runner.sh \ No newline at end of file -- cgit v1.2.3 From c5accb6ea72ac9612dddf37541661fa544d5b872 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 25 Mar 2014 15:35:52 +0100 Subject: add authentication to Reaktor using /query identify configuration contains commands and public_commands --- Reaktor/commands/caps | 3 ++- Reaktor/commands/identify | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 Reaktor/commands/identify (limited to 'Reaktor/commands') diff --git a/Reaktor/commands/caps b/Reaktor/commands/caps index c47319f5..d0245575 100755 --- a/Reaktor/commands/caps +++ b/Reaktor/commands/caps @@ -9,4 +9,5 @@ def load_config(filename): return imp.load_module(modname, file, pathname, description) config = load_config(os.environ['config_filename']) -print(' '.join(filter(None,[ x.get('capname',None) for x in config.commands]))) +print('Private: '+' '.join(filter(None,[ x.get('capname',None) for x in config.commands]))) +print('Public: '+' '.join(filter(None,[ x.get('capname',None) for x in config.public_commands]))) diff --git a/Reaktor/commands/identify b/Reaktor/commands/identify new file mode 100755 index 00000000..c2fb2c58 --- /dev/null +++ b/Reaktor/commands/identify @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import imp +import os,sys + +def load_config(filename): + dirname = os.path.dirname(filename) + modname, ext = os.path.splitext(os.path.basename(filename)) + file, pathname, description = imp.find_module(modname, [ dirname ]) + return imp.load_module(modname, file, pathname, description) + +config = load_config(os.environ['config_filename']) + +with open(config.admin_file) as f: + for line in f: + nick,secret = line.split() + if sys.argv[1] == secret: + print("identified you as %s!"%nick) + with open(config.auth_file,'a+') as g: + g.write(os.environ['_prefix'] +"\n") + sys.exit(0) + +print("unable to identify you, sorry") -- cgit v1.2.3 From 231c6e68078ea86f48d91ed065794fce52c25ac6 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Apr 2014 12:30:17 +0200 Subject: reaktor.py: add on_join hook: tell NICK MSG... --- Reaktor/commands/tell-on_join | 19 +++++++++++++++++++ Reaktor/commands/tell-on_privmsg | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 Reaktor/commands/tell-on_join create mode 100755 Reaktor/commands/tell-on_privmsg (limited to 'Reaktor/commands') diff --git a/Reaktor/commands/tell-on_join b/Reaktor/commands/tell-on_join new file mode 100755 index 00000000..2dbff41a --- /dev/null +++ b/Reaktor/commands/tell-on_join @@ -0,0 +1,19 @@ +#! /bin/sh +set -euf + +# require flock from util-linux +if test "${FLOCK-}" != "$state_file"; then + exec env FLOCK="$state_file" flock "$state_file" "$0" "$@" +fi + +to="$_from" + +# print messages +sed -n '/^'"$to"' /{ + s/^\([^ ]\+\) \([^ ]\+\) <\([^>]\+\)> \(.*\)/\1: \4 2-- \2, \3/p +}' "$state_file" + +# delete messages +sed -i '/^'"$to"' /{ + d +}' "$state_file" diff --git a/Reaktor/commands/tell-on_privmsg b/Reaktor/commands/tell-on_privmsg new file mode 100755 index 00000000..5d0aff41 --- /dev/null +++ b/Reaktor/commands/tell-on_privmsg @@ -0,0 +1,17 @@ +#! /bin/sh +set -euf + +# require flock from util-linux +if test "${FLOCK-}" != "$state_file"; then + exec env FLOCK="$state_file" flock "$state_file" "$0" "$@" +fi + +from="$_prefix" +to="$1"; shift +msg="$*" +date=$(date) + +# TODO tell now, if already joined +printf '%s %s <%s> %s\n' "$to" "$from" "$date" "$msg" >> "$state_file" + +echo 'Consider it noted.' # that's what lambdabot says... -- cgit v1.2.3 From 018441364e956c6128fe9e898f7176a324875ded Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 25 Apr 2014 13:49:11 +0200 Subject: reaktor commands caps: fix typo --- Reaktor/commands/caps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Reaktor/commands') diff --git a/Reaktor/commands/caps b/Reaktor/commands/caps index d0245575..b5d6642d 100755 --- a/Reaktor/commands/caps +++ b/Reaktor/commands/caps @@ -10,4 +10,4 @@ def load_config(filename): config = load_config(os.environ['config_filename']) print('Private: '+' '.join(filter(None,[ x.get('capname',None) for x in config.commands]))) -print('Public: '+' '.join(filter(None,[ x.get('capname',None) for x in config.public_commands]))) +print('Public: '+' '.join(filter(None,[ x.get('capname',None) for x in config.public_commands]))) -- cgit v1.2.3 From 92fe3350fe6e3da26fa1ad0522aabaa0f146d575 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 5 May 2014 09:53:32 +0200 Subject: Merge all the shits --- Reaktor/commands/caps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Reaktor/commands') diff --git a/Reaktor/commands/caps b/Reaktor/commands/caps index b5d6642d..ac8cc66d 100755 --- a/Reaktor/commands/caps +++ b/Reaktor/commands/caps @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 import imp import os -- cgit v1.2.3