From 84b10fc1b458e8e9cc6f7a5146a8ebd665e8ec78 Mon Sep 17 00:00:00 2001 From: euer Date: Sun, 23 Dec 2012 23:05:23 +0100 Subject: //tts -> //util/tts --- god/temper/.gitignore | 1 + god/temper/99-tempsensor.rules | 1 + god/temper/Makefile | 20 ++ god/temper/collectd-temper.sh | 9 + god/temper/temper.c | 277 +++++++++++++++++++++++ god/temper/temper.h | 39 ++++ sandbox/27c3_ticket_grabber/mechanize_tickets.py | 53 +++++ sandbox/zoneminder/Makefile | 14 ++ sandbox/zoneminder/zmdc.pl-LD_PRELOAD.patch | 10 + sandbox/zoneminder/zoneminder.conf | 2 + temper/.gitignore | 1 - temper/99-tempsensor.rules | 1 - temper/Makefile | 20 -- temper/collectd-temper.sh | 9 - temper/temper.c | 277 ----------------------- temper/temper.h | 39 ---- too_old/mechanize_tickets.py | 53 ----- tts/bin/alberto | 1 - tts/bin/anjali | 1 - tts/bin/arnaud | 1 - tts/bin/audrey | 1 - tts/bin/charles | 1 - tts/bin/claire | 1 - tts/bin/crystal | 1 - tts/bin/francesca | 1 - tts/bin/giovanni | 1 - tts/bin/juliette | 1 - tts/bin/klara | 1 - tts/bin/lauren | 1 - tts/bin/mike | 1 - tts/bin/reiner | 1 - tts/bin/rich | 1 - tts/bin/rosa | 1 - tts/names | 16 -- util/tts/bin/alberto | 1 + util/tts/bin/anjali | 1 + util/tts/bin/arnaud | 1 + util/tts/bin/audrey | 1 + util/tts/bin/charles | 1 + util/tts/bin/claire | 1 + util/tts/bin/crystal | 1 + util/tts/bin/francesca | 1 + util/tts/bin/giovanni | 1 + util/tts/bin/juliette | 1 + util/tts/bin/klara | 1 + util/tts/bin/lauren | 1 + util/tts/bin/mike | 1 + util/tts/bin/reiner | 1 + util/tts/bin/rich | 1 + util/tts/bin/rosa | 1 + util/tts/names | 16 ++ zoneminder/Makefile | 14 -- zoneminder/zmdc.pl-LD_PRELOAD.patch | 10 - zoneminder/zoneminder.conf | 2 - 54 files changed, 458 insertions(+), 458 deletions(-) create mode 100644 god/temper/.gitignore create mode 100644 god/temper/99-tempsensor.rules create mode 100644 god/temper/Makefile create mode 100755 god/temper/collectd-temper.sh create mode 100644 god/temper/temper.c create mode 100644 god/temper/temper.h create mode 100644 sandbox/27c3_ticket_grabber/mechanize_tickets.py create mode 100644 sandbox/zoneminder/Makefile create mode 100644 sandbox/zoneminder/zmdc.pl-LD_PRELOAD.patch create mode 100644 sandbox/zoneminder/zoneminder.conf delete mode 100644 temper/.gitignore delete mode 100644 temper/99-tempsensor.rules delete mode 100644 temper/Makefile delete mode 100755 temper/collectd-temper.sh delete mode 100644 temper/temper.c delete mode 100644 temper/temper.h delete mode 100644 too_old/mechanize_tickets.py delete mode 120000 tts/bin/alberto delete mode 120000 tts/bin/anjali delete mode 120000 tts/bin/arnaud delete mode 120000 tts/bin/audrey delete mode 120000 tts/bin/charles delete mode 120000 tts/bin/claire delete mode 120000 tts/bin/crystal delete mode 120000 tts/bin/francesca delete mode 120000 tts/bin/giovanni delete mode 120000 tts/bin/juliette delete mode 120000 tts/bin/klara delete mode 120000 tts/bin/lauren delete mode 120000 tts/bin/mike delete mode 120000 tts/bin/reiner delete mode 120000 tts/bin/rich delete mode 120000 tts/bin/rosa delete mode 100644 tts/names create mode 120000 util/tts/bin/alberto create mode 120000 util/tts/bin/anjali create mode 120000 util/tts/bin/arnaud create mode 120000 util/tts/bin/audrey create mode 120000 util/tts/bin/charles create mode 120000 util/tts/bin/claire create mode 120000 util/tts/bin/crystal create mode 120000 util/tts/bin/francesca create mode 120000 util/tts/bin/giovanni create mode 120000 util/tts/bin/juliette create mode 120000 util/tts/bin/klara create mode 120000 util/tts/bin/lauren create mode 120000 util/tts/bin/mike create mode 120000 util/tts/bin/reiner create mode 120000 util/tts/bin/rich create mode 120000 util/tts/bin/rosa create mode 100644 util/tts/names delete mode 100644 zoneminder/Makefile delete mode 100644 zoneminder/zmdc.pl-LD_PRELOAD.patch delete mode 100644 zoneminder/zoneminder.conf diff --git a/god/temper/.gitignore b/god/temper/.gitignore new file mode 100644 index 00000000..7e50641a --- /dev/null +++ b/god/temper/.gitignore @@ -0,0 +1 @@ +temper diff --git a/god/temper/99-tempsensor.rules b/god/temper/99-tempsensor.rules new file mode 100644 index 00000000..441a469e --- /dev/null +++ b/god/temper/99-tempsensor.rules @@ -0,0 +1 @@ +SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="1130", ATTRS{idProduct}=="660c", MODE="666" diff --git a/god/temper/Makefile b/god/temper/Makefile new file mode 100644 index 00000000..80c0206f --- /dev/null +++ b/god/temper/Makefile @@ -0,0 +1,20 @@ + +all: infest +infest: temper rules-install +CFLAGS = -O2 -Wall + +temper: temper.c + ${CC} -DUNIT_TEST -o $@ $^ -lusb + chmod +s temper + cp -a temper /usr/bin +clean: + rm -f temper *.o + +rules-install: /etc/udev/rules.d/99-tempsensor.rules +/etc/udev/rules.d/99-tempsensor.rules: + cp 99-tempsensor.rules /etc/udev/rules.d +debian-prereq: + apt-get install libusb-dev +uninstall: + rm -f /etc/udev/rules.d/99-tempsensor.rules /usr/bin/temper + diff --git a/god/temper/collectd-temper.sh b/god/temper/collectd-temper.sh new file mode 100755 index 00000000..f66e9acc --- /dev/null +++ b/god/temper/collectd-temper.sh @@ -0,0 +1,9 @@ +HOSTNAME="${COLLECTD_HOSTNAME:-localhost}" +INTERVAL="${COLLECTD_INTERVAL:-30}" +TEMPERNAME="${TEMPERNAME:-external}" +TEMPERBIN="${TEMPERBIN:-/krebs/temper/temper}" +#while sleep "$INTERVAL"; do + VALUE=`$TEMPERBIN` + echo "PUTVAL \"$HOSTNAME/sensors-temper/temperature-$TEMPERNAME\" N:$VALUE" #interval=$INTERVAL + logger "PUTVAL \"$HOSTNAME/sensors-temper/temperature-$TEMPERNAME\" N:$VALUE" #interval=$INTERVAL +#done diff --git a/god/temper/temper.c b/god/temper/temper.c new file mode 100644 index 00000000..390f9056 --- /dev/null +++ b/god/temper/temper.c @@ -0,0 +1,277 @@ +#include +#include +#include +#include + +/* + * Temper.c by Robert Kavaler (c) 2009 (relavak.com) + * All rights reserved. + * + * Temper driver for linux. This program can be compiled either as a library + * or as a standalone program (-DUNIT_TEST). The driver will work with some + * TEMPer usb devices from RDing (www.PCsensor.com). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY Robert Kavaler ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Robert kavaler BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "temper.h" + +#define VENDOR_ID 0x1130 +#define PRODUCT_ID 0x660c + +struct Temper { + struct usb_device *device; + usb_dev_handle *handle; + int debug; + int timeout; +}; + + Temper * +TemperCreate(struct usb_device *dev, int timeout, int debug) +{ + Temper *t; + int ret; + + t = calloc(1, sizeof(*t)); + t->device = dev; + t->debug = debug; + t->timeout = timeout; + t->handle = usb_open(t->device); + if(!t->handle) { + free(t); + return NULL; + } + if(t->debug) { + printf("Trying to detach kernel driver\n"); + } + + ret = usb_detach_kernel_driver_np(t->handle, 0); + if(ret) { + if(errno == ENODATA) { + if(t->debug) { + printf("Device already detached\n"); + } + } else { + if(t->debug) { + printf("Detach failed: %s[%d]\n", + strerror(errno), errno); + printf("Continuing anyway\n"); + } + } + } else { + if(t->debug) { + printf("detach successful\n"); + } + } + ret = usb_detach_kernel_driver_np(t->handle, 1); + if(ret) { + if(errno == ENODATA) { + if(t->debug) + printf("Device already detached\n"); + } else { + if(t->debug) { + printf("Detach failed: %s[%d]\n", + strerror(errno), errno); + printf("Continuing anyway\n"); + } + } + } else { + if(t->debug) { + printf("detach successful\n"); + } + } + + if(usb_set_configuration(t->handle, 1) < 0 || + usb_claim_interface(t->handle, 0) < 0 || + usb_claim_interface(t->handle, 1)) { + usb_close(t->handle); + free(t); + return NULL; + } + return t; +} + + Temper * +TemperCreateFromDeviceNumber(int deviceNum, int timeout, int debug) +{ + struct usb_bus *bus; + int n; + + n = 0; + for(bus=usb_get_busses(); bus; bus=bus->next) { + struct usb_device *dev; + + for(dev=bus->devices; dev; dev=dev->next) { + if(debug) { + printf("Found device: %04x:%04x\n", + dev->descriptor.idVendor, + dev->descriptor.idProduct); + } + if(dev->descriptor.idVendor == VENDOR_ID && + dev->descriptor.idProduct == PRODUCT_ID) { + if(debug) { + printf("Found deviceNum %d\n", n); + } + if(n == deviceNum) { + return TemperCreate(dev, timeout, debug); + } + n++; + } + } + } + return NULL; +} + + void +TemperFree(Temper *t) +{ + if(t) { + if(t->handle) { + usb_close(t->handle); + } + free(t); + } +} + + static int +TemperSendCommand(Temper *t, int a, int b, int c, int d, int e, int f, int g, int h) +{ + unsigned char buf[32]; + int ret; + + bzero(buf, 32); + buf[0] = a; + buf[1] = b; + buf[2] = c; + buf[3] = d; + buf[4] = e; + buf[5] = f; + buf[6] = g; + buf[7] = h; + + if(t->debug) { + printf("sending bytes %d, %d, %d, %d, %d, %d, %d, %d\n", + a, b, c, d, e, f, g, h); + } + + ret = usb_control_msg(t->handle, 0x21, 9, 0x200, 0x01, + (char *) buf, 32, t->timeout); + if(ret != 32) { + perror("usb_control_msg failed"); + return -1; + } + return 0; +} + + static int +TemperGetData(Temper *t, char *buf, int len) +{ + int ret; + + return usb_control_msg(t->handle, 0xa1, 1, 0x300, 0x01, + (char *) buf, len, t->timeout); +} + + int +TemperGetTemperatureInC(Temper *t, float *tempC) +{ + char buf[256]; + int ret, temperature, i; + + TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 2, 0); + TemperSendCommand(t, 0x54, 0, 0, 0, 0, 0, 0, 0); + for(i = 0; i < 7; i++) { + TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); + } + TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 1, 0); + ret = TemperGetData(t, buf, 256); + if(ret < 2) { + return -1; + } + + temperature = (buf[1] & 0xFF) + (buf[0] << 8); + temperature += 1152; // calibration value + *tempC = temperature * (125.0 / 32000.0); + return 0; +} + + int +TemperGetOtherStuff(Temper *t, char *buf, int length) +{ + TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 2, 0); + TemperSendCommand(t, 0x52, 0, 0, 0, 0, 0, 0, 0); + TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 1, 0); + return TemperGetData(t, buf, length); +} + + +#define USB_TIMEOUT 1000 /* milliseconds */ +#define DEBUG_MODE 0 +#define SLEEP_TIMEOUT 10 + + int +main(int argv,char** args) +{ + + + Temper *t; + char buf[256]; + int i, ret,oneshot=0; + if (argv == 2 && (args[1][1] == 'h' || args[1][0] == 'h')) + { + printf("Temper, does the right thing in C\n"); + printf("recompile with DEBUG_MODE = 1 for all the debug printing\n"); + printf("recompile with SLEEP_TIMEOUT = XX for a different polling interval\n"); + exit(0); + } + + usb_set_debug(DEBUG_MODE); + usb_init(); + usb_find_busses(); + usb_find_devices(); + + t = TemperCreateFromDeviceNumber(0, USB_TIMEOUT, DEBUG_MODE); + if(!t) { + perror("TemperCreate"); + exit(-1); + } + + /* + TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 2, 0); + TemperSendCommand(t, 0x43, 0, 0, 0, 0, 0, 0, 0); + TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); + TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); + TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); + TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); + TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); + TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); + */ + + bzero(buf, 256); + ret = TemperGetOtherStuff(t, buf, 256); + + float tempc; + + if(TemperGetTemperatureInC(t, &tempc) < 0) { + perror("TemperGetTemperatureInC"); + exit(1); + } + + printf("%.2f\n", tempc); + return 0; +} diff --git a/god/temper/temper.h b/god/temper/temper.h new file mode 100644 index 00000000..7ea6280a --- /dev/null +++ b/god/temper/temper.h @@ -0,0 +1,39 @@ +#ifndef TEMPER_H +#define TEMPER_H + +/* + * Temper.h by Robert Kavaler (c) 2009 (relavak.com) + * All rights reserved. + * + * Temper driver for linux. This program can be compiled either as a library + * or as a standalone program (-DUNIT_TEST). The driver will work with some + * TEMPer usb devices from RDing (www.PCsensor.com). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY Robert Kavaler ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Robert kavaler BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +typedef struct Temper Temper; + + +Temper *TemperCreateFromDeviceNumber(int deviceNum, int timeout, int debug); +void TemperFree(Temper *t); + +int TemperGetTemperatureInC(Temper *t, float *tempC); +int TempterGetOtherStuff(Temper *t, char *buf, int length); + +#endif diff --git a/sandbox/27c3_ticket_grabber/mechanize_tickets.py b/sandbox/27c3_ticket_grabber/mechanize_tickets.py new file mode 100644 index 00000000..1f12a996 --- /dev/null +++ b/sandbox/27c3_ticket_grabber/mechanize_tickets.py @@ -0,0 +1,53 @@ +#!/usr/bin/python +import mechanize +import cookielib +import time,sys +USERNAME = 'momo' +PASSWORD = '' + + +def main(): + try: + br = init_browser() + while not do_login(br): + print ("Could Not Login, retrying!") + while not fetch_ticket(br): + time.sleep(0.2) + print ("Could not fetch ticket, retrying!") + except Exception,e: + print ("Caught Exception: %s" % str(e)) + exit (1) + print ("We won? yay") + exit(0) + +def init_browser(): + br = mechanize.Browser() + br.open("https://presale.events.ccc.de/order") + cj = cookielib.LWPCookieJar() + br.set_cookiejar(cj) + br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')] + return br +def do_login(br): + br.select_form(nr=0) + br.form['account[username]'] = USERNAME + br.form['account[password]'] = PASSWORD + br.submit() + ret = br.response().read() + if 'Signed in successfully.' in ret: + if not "Confirm Order" in ret: + print("Something else is wrong, cannot find 'Confirm Order' button!") + raise Exception("Cannot find Confirm Order button") + return True + else: return False + +def fetch_ticket(br): + br.select_form(nr=0) + br.submit() + ret = br.response().read() + if not 'There are currently not enough tickets available.' in ret: + print ("we won? Better sleep some time to be sure") + return True + else: return False + +if __name__ == "__main__": + main() diff --git a/sandbox/zoneminder/Makefile b/sandbox/zoneminder/Makefile new file mode 100644 index 00000000..27302715 --- /dev/null +++ b/sandbox/zoneminder/Makefile @@ -0,0 +1,14 @@ + +.PHONY: fix it so hard +it: so +so: it hard fix + apt-get install --yes zoneminder libv4l-0 + +hard: /etc/sysctl.d/zoneminder.conf +/etc/sysctl.d/zoneminder.conf: zoneminder.conf + cp $< $@ + sysctl -p $@ + +fix: zmdc.pl-LD_PRELOAD.patch + (cd /usr/bin && patch -N) < $< || : + diff --git a/sandbox/zoneminder/zmdc.pl-LD_PRELOAD.patch b/sandbox/zoneminder/zmdc.pl-LD_PRELOAD.patch new file mode 100644 index 00000000..b00fc673 --- /dev/null +++ b/sandbox/zoneminder/zmdc.pl-LD_PRELOAD.patch @@ -0,0 +1,10 @@ +--- /usr/bin/zmdc.pl 2011-05-23 22:28:57.505247793 +0200 ++++ /usr/bin/zmdc.pl 2011-05-23 22:29:45.597248242 +0200 +@@ -62,6 +62,7 @@ + $ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; + delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + ++$ENV{LD_PRELOAD} = '/usr/lib/libv4l/v4l2convert.so'; + my @daemons = ( + 'zmc', + 'zma', diff --git a/sandbox/zoneminder/zoneminder.conf b/sandbox/zoneminder/zoneminder.conf new file mode 100644 index 00000000..1eec6fd9 --- /dev/null +++ b/sandbox/zoneminder/zoneminder.conf @@ -0,0 +1,2 @@ +kernel.shmall = 134217728 +kernel.shmmax = 134217728 diff --git a/temper/.gitignore b/temper/.gitignore deleted file mode 100644 index 7e50641a..00000000 --- a/temper/.gitignore +++ /dev/null @@ -1 +0,0 @@ -temper diff --git a/temper/99-tempsensor.rules b/temper/99-tempsensor.rules deleted file mode 100644 index 441a469e..00000000 --- a/temper/99-tempsensor.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="1130", ATTRS{idProduct}=="660c", MODE="666" diff --git a/temper/Makefile b/temper/Makefile deleted file mode 100644 index 80c0206f..00000000 --- a/temper/Makefile +++ /dev/null @@ -1,20 +0,0 @@ - -all: infest -infest: temper rules-install -CFLAGS = -O2 -Wall - -temper: temper.c - ${CC} -DUNIT_TEST -o $@ $^ -lusb - chmod +s temper - cp -a temper /usr/bin -clean: - rm -f temper *.o - -rules-install: /etc/udev/rules.d/99-tempsensor.rules -/etc/udev/rules.d/99-tempsensor.rules: - cp 99-tempsensor.rules /etc/udev/rules.d -debian-prereq: - apt-get install libusb-dev -uninstall: - rm -f /etc/udev/rules.d/99-tempsensor.rules /usr/bin/temper - diff --git a/temper/collectd-temper.sh b/temper/collectd-temper.sh deleted file mode 100755 index f66e9acc..00000000 --- a/temper/collectd-temper.sh +++ /dev/null @@ -1,9 +0,0 @@ -HOSTNAME="${COLLECTD_HOSTNAME:-localhost}" -INTERVAL="${COLLECTD_INTERVAL:-30}" -TEMPERNAME="${TEMPERNAME:-external}" -TEMPERBIN="${TEMPERBIN:-/krebs/temper/temper}" -#while sleep "$INTERVAL"; do - VALUE=`$TEMPERBIN` - echo "PUTVAL \"$HOSTNAME/sensors-temper/temperature-$TEMPERNAME\" N:$VALUE" #interval=$INTERVAL - logger "PUTVAL \"$HOSTNAME/sensors-temper/temperature-$TEMPERNAME\" N:$VALUE" #interval=$INTERVAL -#done diff --git a/temper/temper.c b/temper/temper.c deleted file mode 100644 index 390f9056..00000000 --- a/temper/temper.c +++ /dev/null @@ -1,277 +0,0 @@ -#include -#include -#include -#include - -/* - * Temper.c by Robert Kavaler (c) 2009 (relavak.com) - * All rights reserved. - * - * Temper driver for linux. This program can be compiled either as a library - * or as a standalone program (-DUNIT_TEST). The driver will work with some - * TEMPer usb devices from RDing (www.PCsensor.com). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY Robert Kavaler ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Robert kavaler BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "temper.h" - -#define VENDOR_ID 0x1130 -#define PRODUCT_ID 0x660c - -struct Temper { - struct usb_device *device; - usb_dev_handle *handle; - int debug; - int timeout; -}; - - Temper * -TemperCreate(struct usb_device *dev, int timeout, int debug) -{ - Temper *t; - int ret; - - t = calloc(1, sizeof(*t)); - t->device = dev; - t->debug = debug; - t->timeout = timeout; - t->handle = usb_open(t->device); - if(!t->handle) { - free(t); - return NULL; - } - if(t->debug) { - printf("Trying to detach kernel driver\n"); - } - - ret = usb_detach_kernel_driver_np(t->handle, 0); - if(ret) { - if(errno == ENODATA) { - if(t->debug) { - printf("Device already detached\n"); - } - } else { - if(t->debug) { - printf("Detach failed: %s[%d]\n", - strerror(errno), errno); - printf("Continuing anyway\n"); - } - } - } else { - if(t->debug) { - printf("detach successful\n"); - } - } - ret = usb_detach_kernel_driver_np(t->handle, 1); - if(ret) { - if(errno == ENODATA) { - if(t->debug) - printf("Device already detached\n"); - } else { - if(t->debug) { - printf("Detach failed: %s[%d]\n", - strerror(errno), errno); - printf("Continuing anyway\n"); - } - } - } else { - if(t->debug) { - printf("detach successful\n"); - } - } - - if(usb_set_configuration(t->handle, 1) < 0 || - usb_claim_interface(t->handle, 0) < 0 || - usb_claim_interface(t->handle, 1)) { - usb_close(t->handle); - free(t); - return NULL; - } - return t; -} - - Temper * -TemperCreateFromDeviceNumber(int deviceNum, int timeout, int debug) -{ - struct usb_bus *bus; - int n; - - n = 0; - for(bus=usb_get_busses(); bus; bus=bus->next) { - struct usb_device *dev; - - for(dev=bus->devices; dev; dev=dev->next) { - if(debug) { - printf("Found device: %04x:%04x\n", - dev->descriptor.idVendor, - dev->descriptor.idProduct); - } - if(dev->descriptor.idVendor == VENDOR_ID && - dev->descriptor.idProduct == PRODUCT_ID) { - if(debug) { - printf("Found deviceNum %d\n", n); - } - if(n == deviceNum) { - return TemperCreate(dev, timeout, debug); - } - n++; - } - } - } - return NULL; -} - - void -TemperFree(Temper *t) -{ - if(t) { - if(t->handle) { - usb_close(t->handle); - } - free(t); - } -} - - static int -TemperSendCommand(Temper *t, int a, int b, int c, int d, int e, int f, int g, int h) -{ - unsigned char buf[32]; - int ret; - - bzero(buf, 32); - buf[0] = a; - buf[1] = b; - buf[2] = c; - buf[3] = d; - buf[4] = e; - buf[5] = f; - buf[6] = g; - buf[7] = h; - - if(t->debug) { - printf("sending bytes %d, %d, %d, %d, %d, %d, %d, %d\n", - a, b, c, d, e, f, g, h); - } - - ret = usb_control_msg(t->handle, 0x21, 9, 0x200, 0x01, - (char *) buf, 32, t->timeout); - if(ret != 32) { - perror("usb_control_msg failed"); - return -1; - } - return 0; -} - - static int -TemperGetData(Temper *t, char *buf, int len) -{ - int ret; - - return usb_control_msg(t->handle, 0xa1, 1, 0x300, 0x01, - (char *) buf, len, t->timeout); -} - - int -TemperGetTemperatureInC(Temper *t, float *tempC) -{ - char buf[256]; - int ret, temperature, i; - - TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 2, 0); - TemperSendCommand(t, 0x54, 0, 0, 0, 0, 0, 0, 0); - for(i = 0; i < 7; i++) { - TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); - } - TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 1, 0); - ret = TemperGetData(t, buf, 256); - if(ret < 2) { - return -1; - } - - temperature = (buf[1] & 0xFF) + (buf[0] << 8); - temperature += 1152; // calibration value - *tempC = temperature * (125.0 / 32000.0); - return 0; -} - - int -TemperGetOtherStuff(Temper *t, char *buf, int length) -{ - TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 2, 0); - TemperSendCommand(t, 0x52, 0, 0, 0, 0, 0, 0, 0); - TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 1, 0); - return TemperGetData(t, buf, length); -} - - -#define USB_TIMEOUT 1000 /* milliseconds */ -#define DEBUG_MODE 0 -#define SLEEP_TIMEOUT 10 - - int -main(int argv,char** args) -{ - - - Temper *t; - char buf[256]; - int i, ret,oneshot=0; - if (argv == 2 && (args[1][1] == 'h' || args[1][0] == 'h')) - { - printf("Temper, does the right thing in C\n"); - printf("recompile with DEBUG_MODE = 1 for all the debug printing\n"); - printf("recompile with SLEEP_TIMEOUT = XX for a different polling interval\n"); - exit(0); - } - - usb_set_debug(DEBUG_MODE); - usb_init(); - usb_find_busses(); - usb_find_devices(); - - t = TemperCreateFromDeviceNumber(0, USB_TIMEOUT, DEBUG_MODE); - if(!t) { - perror("TemperCreate"); - exit(-1); - } - - /* - TemperSendCommand(t, 10, 11, 12, 13, 0, 0, 2, 0); - TemperSendCommand(t, 0x43, 0, 0, 0, 0, 0, 0, 0); - TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); - TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); - TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); - TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); - TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); - TemperSendCommand(t, 0, 0, 0, 0, 0, 0, 0, 0); - */ - - bzero(buf, 256); - ret = TemperGetOtherStuff(t, buf, 256); - - float tempc; - - if(TemperGetTemperatureInC(t, &tempc) < 0) { - perror("TemperGetTemperatureInC"); - exit(1); - } - - printf("%.2f\n", tempc); - return 0; -} diff --git a/temper/temper.h b/temper/temper.h deleted file mode 100644 index 7ea6280a..00000000 --- a/temper/temper.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef TEMPER_H -#define TEMPER_H - -/* - * Temper.h by Robert Kavaler (c) 2009 (relavak.com) - * All rights reserved. - * - * Temper driver for linux. This program can be compiled either as a library - * or as a standalone program (-DUNIT_TEST). The driver will work with some - * TEMPer usb devices from RDing (www.PCsensor.com). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY Robert Kavaler ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Robert kavaler BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -typedef struct Temper Temper; - - -Temper *TemperCreateFromDeviceNumber(int deviceNum, int timeout, int debug); -void TemperFree(Temper *t); - -int TemperGetTemperatureInC(Temper *t, float *tempC); -int TempterGetOtherStuff(Temper *t, char *buf, int length); - -#endif diff --git a/too_old/mechanize_tickets.py b/too_old/mechanize_tickets.py deleted file mode 100644 index 1f12a996..00000000 --- a/too_old/mechanize_tickets.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/python -import mechanize -import cookielib -import time,sys -USERNAME = 'momo' -PASSWORD = '' - - -def main(): - try: - br = init_browser() - while not do_login(br): - print ("Could Not Login, retrying!") - while not fetch_ticket(br): - time.sleep(0.2) - print ("Could not fetch ticket, retrying!") - except Exception,e: - print ("Caught Exception: %s" % str(e)) - exit (1) - print ("We won? yay") - exit(0) - -def init_browser(): - br = mechanize.Browser() - br.open("https://presale.events.ccc.de/order") - cj = cookielib.LWPCookieJar() - br.set_cookiejar(cj) - br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')] - return br -def do_login(br): - br.select_form(nr=0) - br.form['account[username]'] = USERNAME - br.form['account[password]'] = PASSWORD - br.submit() - ret = br.response().read() - if 'Signed in successfully.' in ret: - if not "Confirm Order" in ret: - print("Something else is wrong, cannot find 'Confirm Order' button!") - raise Exception("Cannot find Confirm Order button") - return True - else: return False - -def fetch_ticket(br): - br.select_form(nr=0) - br.submit() - ret = br.response().read() - if not 'There are currently not enough tickets available.' in ret: - print ("we won? Better sleep some time to be sure") - return True - else: return False - -if __name__ == "__main__": - main() diff --git a/tts/bin/alberto b/tts/bin/alberto deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/alberto +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/anjali b/tts/bin/anjali deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/anjali +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/arnaud b/tts/bin/arnaud deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/arnaud +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/audrey b/tts/bin/audrey deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/audrey +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/charles b/tts/bin/charles deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/charles +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/claire b/tts/bin/claire deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/claire +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/crystal b/tts/bin/crystal deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/crystal +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/francesca b/tts/bin/francesca deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/francesca +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/giovanni b/tts/bin/giovanni deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/giovanni +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/juliette b/tts/bin/juliette deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/juliette +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/klara b/tts/bin/klara deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/klara +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/lauren b/tts/bin/lauren deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/lauren +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/mike b/tts/bin/mike deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/mike +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/reiner b/tts/bin/reiner deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/reiner +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/rich b/tts/bin/rich deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/rich +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/bin/rosa b/tts/bin/rosa deleted file mode 120000 index 6947e393..00000000 --- a/tts/bin/rosa +++ /dev/null @@ -1 +0,0 @@ -../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/tts/names b/tts/names deleted file mode 100644 index 576c74e5..00000000 --- a/tts/names +++ /dev/null @@ -1,16 +0,0 @@ -alberto -anjali -arnaud -audrey -charles -claire -crystal -francesca -giovanni -juliette -klara -lauren -mike -reiner -rich -rosa diff --git a/util/tts/bin/alberto b/util/tts/bin/alberto new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/alberto @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/anjali b/util/tts/bin/anjali new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/anjali @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/arnaud b/util/tts/bin/arnaud new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/arnaud @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/audrey b/util/tts/bin/audrey new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/audrey @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/charles b/util/tts/bin/charles new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/charles @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/claire b/util/tts/bin/claire new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/claire @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/crystal b/util/tts/bin/crystal new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/crystal @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/francesca b/util/tts/bin/francesca new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/francesca @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/giovanni b/util/tts/bin/giovanni new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/giovanni @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/juliette b/util/tts/bin/juliette new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/juliette @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/klara b/util/tts/bin/klara new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/klara @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/lauren b/util/tts/bin/lauren new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/lauren @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/mike b/util/tts/bin/mike new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/mike @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/reiner b/util/tts/bin/reiner new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/reiner @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/rich b/util/tts/bin/rich new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/rich @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/bin/rosa b/util/tts/bin/rosa new file mode 120000 index 00000000..6947e393 --- /dev/null +++ b/util/tts/bin/rosa @@ -0,0 +1 @@ +../../util/bin/naturalvoices.att \ No newline at end of file diff --git a/util/tts/names b/util/tts/names new file mode 100644 index 00000000..576c74e5 --- /dev/null +++ b/util/tts/names @@ -0,0 +1,16 @@ +alberto +anjali +arnaud +audrey +charles +claire +crystal +francesca +giovanni +juliette +klara +lauren +mike +reiner +rich +rosa diff --git a/zoneminder/Makefile b/zoneminder/Makefile deleted file mode 100644 index 27302715..00000000 --- a/zoneminder/Makefile +++ /dev/null @@ -1,14 +0,0 @@ - -.PHONY: fix it so hard -it: so -so: it hard fix - apt-get install --yes zoneminder libv4l-0 - -hard: /etc/sysctl.d/zoneminder.conf -/etc/sysctl.d/zoneminder.conf: zoneminder.conf - cp $< $@ - sysctl -p $@ - -fix: zmdc.pl-LD_PRELOAD.patch - (cd /usr/bin && patch -N) < $< || : - diff --git a/zoneminder/zmdc.pl-LD_PRELOAD.patch b/zoneminder/zmdc.pl-LD_PRELOAD.patch deleted file mode 100644 index b00fc673..00000000 --- a/zoneminder/zmdc.pl-LD_PRELOAD.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- /usr/bin/zmdc.pl 2011-05-23 22:28:57.505247793 +0200 -+++ /usr/bin/zmdc.pl 2011-05-23 22:29:45.597248242 +0200 -@@ -62,6 +62,7 @@ - $ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; - delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; - -+$ENV{LD_PRELOAD} = '/usr/lib/libv4l/v4l2convert.so'; - my @daemons = ( - 'zmc', - 'zma', diff --git a/zoneminder/zoneminder.conf b/zoneminder/zoneminder.conf deleted file mode 100644 index 1eec6fd9..00000000 --- a/zoneminder/zoneminder.conf +++ /dev/null @@ -1,2 +0,0 @@ -kernel.shmall = 134217728 -kernel.shmmax = 134217728 -- cgit v1.2.3