Add LICENSE
This commit is contained in:
parent
7dc09a38bb
commit
b0b2e985a3
20 changed files with 938 additions and 57 deletions
15
host/aus.py
15
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
|
||||
|
|
|
|||
16
host/bdf.c
16
host/bdf.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 "config.h"
|
||||
#include "bdf.h"
|
||||
|
|
|
|||
15
host/bdf.py
15
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
|
||||
|
|
|
|||
16
host/color.c
16
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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
# ┌─────────┐ ┌───┬───┬ ⋯ ┬───┬───┐
|
||||
|
|
|
|||
16
host/crap.py
16
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
16
host/font.c
16
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>
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
16
host/usb.c
16
host/usb.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 <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue