diff options
author | jaseg <git@jaseg.net> | 2017-03-24 14:08:44 +0100 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2017-03-24 14:12:31 +0100 |
commit | b0b2e985a3f35962ed2f4d639d756862fcdc5168 (patch) | |
tree | 38d41c8a36d8b0f673e1b6b5cefc4d397608f938 /host | |
parent | 7dc09a38bbed26ae188bfafc72b803752501f00a (diff) | |
download | matelight-b0b2e985a3f35962ed2f4d639d756862fcdc5168.tar.gz matelight-b0b2e985a3f35962ed2f4d639d756862fcdc5168.tar.bz2 matelight-b0b2e985a3f35962ed2f4d639d756862fcdc5168.zip |
Diffstat (limited to 'host')
-rwxr-xr-x | host/aus.py | 15 | ||||
-rw-r--r-- | host/bdf.c | 16 | ||||
-rw-r--r-- | host/bdf.py | 15 | ||||
-rw-r--r-- | host/color.c | 16 | ||||
-rw-r--r-- | host/config.py | 15 | ||||
-rw-r--r-- | host/crap.py | 16 | ||||
-rwxr-xr-x | host/crap_to_opc.py | 15 | ||||
-rw-r--r-- | host/font.c | 16 | ||||
-rwxr-xr-x | host/genpal.py | 14 | ||||
-rwxr-xr-x | host/gifserver.py | 15 | ||||
-rwxr-xr-x | host/gifstream.py | 14 | ||||
-rw-r--r-- | host/matelight.py | 16 | ||||
-rwxr-xr-x | host/opc_to_crap.py | 15 | ||||
-rw-r--r-- | host/secret_sauce.py | 56 | ||||
-rwxr-xr-x | host/server.py | 16 | ||||
-rw-r--r-- | host/terminal.py | 16 | ||||
-rw-r--r-- | host/usb.c | 16 | ||||
-rwxr-xr-x | host/viewer.py | 17 |
18 files changed, 262 insertions, 57 deletions
diff --git a/host/aus.py b/host/aus.py index c0bab71..9aef0d1 100755 --- a/host/aus.py +++ b/host/aus.py @@ -1,4 +1,19 @@ #!/usr/bin/env python +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. from socketserver import * import socket @@ -1,3 +1,19 @@ +/* Matelight + * Copyright (C) 2016 Sebastian Götte <code@jaseg.net> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "config.h" #include "bdf.h" diff --git a/host/bdf.py b/host/bdf.py index fb4c928..377376a 100644 --- a/host/bdf.py +++ b/host/bdf.py @@ -1,3 +1,18 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. import config import threading diff --git a/host/color.c b/host/color.c index 17748d4..eaef3b1 100644 --- a/host/color.c +++ b/host/color.c @@ -1,3 +1,19 @@ +/* Matelight + * Copyright (C) 2016 Sebastian Götte <code@jaseg.net> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "color.h" #include <stdlib.h> diff --git a/host/config.py b/host/config.py index b76e2aa..e40ad58 100644 --- a/host/config.py +++ b/host/config.py @@ -1,3 +1,18 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. # Display geometry # ┌─────────┐ ┌───┬───┬ ⋯ ┬───┬───┐ diff --git a/host/crap.py b/host/crap.py index 80fb647..482d487 100644 --- a/host/crap.py +++ b/host/crap.py @@ -1,3 +1,19 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# Copyright (C) 2015 Uwe Kamper <me@uwekamper.de> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. import socket import struct diff --git a/host/crap_to_opc.py b/host/crap_to_opc.py index 83537d2..15d3e73 100755 --- a/host/crap_to_opc.py +++ b/host/crap_to_opc.py @@ -1,4 +1,19 @@ #!/usr/bin/env python3 +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. import struct import socket diff --git a/host/font.c b/host/font.c index 59bc2ef..81c39fe 100644 --- a/host/font.c +++ b/host/font.c @@ -1,3 +1,19 @@ +/* Matelight + * Copyright (C) 2016 Sebastian Götte <code@jaseg.net> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "font.h" #include <stdint.h> diff --git a/host/genpal.py b/host/genpal.py index b8e550b..5532cc0 100755 --- a/host/genpal.py +++ b/host/genpal.py @@ -1,5 +1,19 @@ #!/usr/bin/env python3 # Generate an XTerm-256 color RGB palette +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. xterm_colors = [ (0x00, 0x00, 0x00), diff --git a/host/gifserver.py b/host/gifserver.py index 7fbbfe3..7a1338b 100755 --- a/host/gifserver.py +++ b/host/gifserver.py @@ -1,4 +1,19 @@ #!/usr/bin/env python +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. import argparse, time, argparse, textwrap, threading, io from urllib.parse import urlparse diff --git a/host/gifstream.py b/host/gifstream.py index a580ae1..9905d34 100755 --- a/host/gifstream.py +++ b/host/gifstream.py @@ -1,5 +1,19 @@ #!/usr/bin/env python3 # This script eats CRAP and outputs a live GIF-over-HTTP stream. The required bandwidth is about 20kB/s +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. import io import math diff --git a/host/matelight.py b/host/matelight.py index 886e0f1..442b8d2 100644 --- a/host/matelight.py +++ b/host/matelight.py @@ -1,3 +1,19 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + import colorsys from itertools import product from ctypes import c_size_t, c_uint8, c_void_p, c_float, CDLL, Structure, POINTER diff --git a/host/opc_to_crap.py b/host/opc_to_crap.py index 85b4eeb..f39b471 100755 --- a/host/opc_to_crap.py +++ b/host/opc_to_crap.py @@ -1,4 +1,19 @@ #!/usr/bin/env python3 +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. import struct import socket diff --git a/host/secret_sauce.py b/host/secret_sauce.py deleted file mode 100644 index 3682b0e..0000000 --- a/host/secret_sauce.py +++ /dev/null @@ -1,56 +0,0 @@ - -from collections import defaultdict -import signal - - -RATELIMIT_THRESHOLD = 20 -GRAYLIST_LENGTH = 8 - -class SpamError(ValueError): - def __str__(self): - return ' '.join(self.args) - - -def loadlist(fn): - try: - with open(fn) as f: - return [ l for l in ( l.strip() for l in f.readlines() if not l.startswith('#')) if l ] - except: - return [] - -greenlist = set() - -graylist = [] -def do_graylist(msg): - global graylist - graylist = [msg] + graylist[:GRAYLIST_LENGTH-1] - -blacklist = loadlist('blacklist') -badwords = loadlist('badwords') -def signal_handler(_signum, _frame): - global blacklist, badwords - blacklist = load_blacklist() - badwords = load_badwords() -signal.signal(signal.SIGHUP, signal_handler) - -ratelimitdict = defaultdict(lambda: 0) -def empty_ratelimit(_signum, _frame): - global ratelimitdict - ratelimitdict = defaultdict(lambda: 0) -signal.signal(signal.SIGALRM, empty_ratelimit) -signal.setitimer(signal.ITIMER_REAL, 60) - -def check_spam(addr, data): - ratelimitdict[addr] += 1 - try: - if ratelimitdict[addr] > RATELIMIT_THRESHOLD: - raise SpamError('rate-limit') - if any(word in data.lower() for word in badwords): - raise SpamError('badwords filter') - if addr not in greenlist and data in graylist: - raise SpamError('graylist') - except SpamError as err: - do_graylist(data) - blacklist.append(addr) - raise err - greenlist.add(addr) diff --git a/host/server.py b/host/server.py index e622d9b..d65b721 100755 --- a/host/server.py +++ b/host/server.py @@ -1,4 +1,20 @@ #!/usr/bin/env python +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# Copyright (C) 2015 Uwe Kamper <me@uwekamper.de> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. import socket import time diff --git a/host/terminal.py b/host/terminal.py index 86b4db1..2a4e4d6 100644 --- a/host/terminal.py +++ b/host/terminal.py @@ -1,3 +1,19 @@ +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + from pixelterm.pixelterm import termify_pixels class MockImage: @@ -1,3 +1,19 @@ +/* Matelight + * Copyright (C) 2016 Sebastian Götte <code@jaseg.net> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include <stdio.h> #include <stdint.h> diff --git a/host/viewer.py b/host/viewer.py index 9862961..316e4cc 100755 --- a/host/viewer.py +++ b/host/viewer.py @@ -1,4 +1,19 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# Matelight +# Copyright (C) 2016 Sebastian Götte <code@jaseg.net> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. import argparse import atexit |