summaryrefslogtreecommitdiffstats
path: root/Reaktor/commands
diff options
context:
space:
mode:
Diffstat (limited to 'Reaktor/commands')
-rwxr-xr-xReaktor/commands/caps4
-rwxr-xr-xReaktor/commands/hello2
-rwxr-xr-xReaktor/commands/licht_resolver37
-rwxr-xr-xReaktor/commands/reload2
-rwxr-xr-xReaktor/commands/retard1
-rwxr-xr-xReaktor/commands/rev2
l---------Reaktor/commands/revip1
l---------Reaktor/commands/subdomains1
-rwxr-xr-xReaktor/commands/uptime8
-rwxr-xr-xReaktor/commands/whatweb7
10 files changed, 65 insertions, 0 deletions
diff --git a/Reaktor/commands/caps b/Reaktor/commands/caps
new file mode 100755
index 00000000..bc3d7ba2
--- /dev/null
+++ b/Reaktor/commands/caps
@@ -0,0 +1,4 @@
+#! /bin/sh
+set -euf
+cd public_commands
+echo `ls`
diff --git a/Reaktor/commands/hello b/Reaktor/commands/hello
new file mode 100755
index 00000000..df3b6bb9
--- /dev/null
+++ b/Reaktor/commands/hello
@@ -0,0 +1,2 @@
+#! /bin/sh
+echo "Hello${argument+, $argument}!"
diff --git a/Reaktor/commands/licht_resolver b/Reaktor/commands/licht_resolver
new file mode 100755
index 00000000..5bdb6510
--- /dev/null
+++ b/Reaktor/commands/licht_resolver
@@ -0,0 +1,37 @@
+#! /usr/bin/python
+# -*- coding: utf-8 -*-
+
+map = {
+ 'shackspace': {
+ 'device': {
+ 0: 'Licht0, Zickenzone; Fenster',
+ 1: 'Licht1, Sofaecke; Fenster',
+ 2: 'Licht2, Zickenzone; Ghetto',
+ 3: 'Licht3, Sofaecke; Ghetto',
+ 4: 'Licht4, Richtung Getränkelager',
+ 5: 'Licht5, Porschekonsole',
+ 6: 'Licht6, Tomatenecke',
+ 7: 'Licht7, Ghetto',
+ 10: 'Hauptschalter'
+ },
+ 'state': {
+ 0: 'aus',
+ 1: 'an',
+ 2: 'aus in T-10s'
+ },
+ '->': 'ist'
+ }
+}
+
+from struct import unpack
+import json
+from os import environ as env
+
+location = "shackspace"
+
+map = map[location]
+print (env["payload"]+"")
+did, sid= unpack('BB', json.loads(env['payload']))
+device,state = map['device'][did], map['state'][sid]
+arrow = map['->']
+print ' '.join([device, arrow, state])
diff --git a/Reaktor/commands/reload b/Reaktor/commands/reload
new file mode 100755
index 00000000..bfa1f041
--- /dev/null
+++ b/Reaktor/commands/reload
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec pkill -U reaktor
diff --git a/Reaktor/commands/retard b/Reaktor/commands/retard
new file mode 100755
index 00000000..c59b4d1c
--- /dev/null
+++ b/Reaktor/commands/retard
@@ -0,0 +1 @@
+#? //retard
diff --git a/Reaktor/commands/rev b/Reaktor/commands/rev
new file mode 100755
index 00000000..a8681ab9
--- /dev/null
+++ b/Reaktor/commands/rev
@@ -0,0 +1,2 @@
+#! /bin/sh
+git log -1 --format="%h by %an, %ar"
diff --git a/Reaktor/commands/revip b/Reaktor/commands/revip
new file mode 120000
index 00000000..e2c3b7ab
--- /dev/null
+++ b/Reaktor/commands/revip
@@ -0,0 +1 @@
+../repos/revip/revip \ No newline at end of file
diff --git a/Reaktor/commands/subdomains b/Reaktor/commands/subdomains
new file mode 120000
index 00000000..0489555f
--- /dev/null
+++ b/Reaktor/commands/subdomains
@@ -0,0 +1 @@
+../repos/consolidate_dns/index \ No newline at end of file
diff --git a/Reaktor/commands/uptime b/Reaktor/commands/uptime
new file mode 100755
index 00000000..7ff64168
--- /dev/null
+++ b/Reaktor/commands/uptime
@@ -0,0 +1,8 @@
+#! /bin/sh
+#
+# //Reactor/commands/uptime - IRC-optimized uptime output
+#
+uptime | sed '
+ s/^\(.*\) up \(.*\) days\?, *\(.*\), *\(.*\) users\?, *load average: \(.*\)$/\1; \2d \3; \4u; \5/;t
+ s/^\(.*\) up *\(.*\), *\(.*\) users\?, *load average: \(.*\)$/\1; 0d \2; \3u; \4/;t
+'
diff --git a/Reaktor/commands/whatweb b/Reaktor/commands/whatweb
new file mode 100755
index 00000000..afe20360
--- /dev/null
+++ b/Reaktor/commands/whatweb
@@ -0,0 +1,7 @@
+#!/bin/sh
+#wrapper for WhatWeb
+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