Skip to content

Instantly share code, notes, and snippets.

View HerrSpace's full-sized avatar
💭
🧠🔥

Space Meyer HerrSpace

💭
🧠🔥
View GitHub Profile
#!/usr/bin/env python
import socket
import time
import random
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("94.45.224.223", 1234))
print("connected")
while True:
@HerrSpace
HerrSpace / gist:1af514af76f112953558
Last active August 29, 2015 14:18
subraum spam
#!/usr/bin/env python
import socket
import time
import random
from PIL import Image
img = Image.open("/home/space/subraum_cube_medium.png")
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
s.connect(("2001:67c:20a1:1:201:2eff:fe2b:3f3a", 1234))
def rgbToHex(r, g, b):
rHex = hex(r)[2:]
gHex = hex(g)[2:]
bHex = hex(b)[2:]
colour = ""
for subColour in [rHex,gHex,bHex]:
if len(subColour) < 2:
colour += "0" + subColour
else:
@HerrSpace
HerrSpace / spi_to_bin.py
Created February 12, 2016 21:38 — forked from plushvoxel/spi_to_bin.py
write shit to binary
#!/usr/bin/env python2
import time
import serial
import struct
import binascii
mem_addr = 0x80000000
ser= serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
@HerrSpace
HerrSpace / n26.sh
Created June 27, 2016 17:16
Curl number26 transactions.
curl 'https://api.tech26.de/oauth/token' -H 'Authorization: Basic bXktdHJ1c3RlZC13ZHBDbGllbnQ6c2VjcmV0' --data-urlencode 'username=' --data-urlencode 'password=' --data 'grant_type=password' | jq -r '.["access_token"]' | (read token; curl 'https://api.tech26.de/api/smrt/transactions?limit=50' -H "Authorization: bearer $token") | jq
@HerrSpace
HerrSpace / opensmtpd.service
Created May 24, 2017 23:09
A systemd service file for opensmtpd.
[Unit]
Description=Opensmtpd Mailserver
[Service]
Type=simple
ExecStartPre=/usr/sbin/smtpd -n
ExecStart=/usr/sbin/smtpd -d
ExecStop=/usr/sbin/smtpctl stop
[Install]

Lasercutter Mods

Wasser Temperatur Ueberwachung

Problem: Der Lasercutter wird Wassergekuehlt. Das Wasser darf nicht > 25 Grad werden, sonst stirbt die Laserroehre (noch) schneller. Loesung: Das Wasser muss Temperatur ueberwacht werden. Benoetigte Komponenten:

  • Arduino + Netzteil. (Nicht interne 5V benutzen!)
@HerrSpace
HerrSpace / find_orphants.py
Created June 30, 2017 16:49
Find orphant stubnitz media archive dirs not linked to any event in the db.
#!/usr/bin/env python
import os, re
from mysql.connector import MySQLConnection, Error
__author__ = 'Patrick <space> Meyer'
ARCHIVE_MOUNT = '/var/www/'
EVENT_DIR_RE = ARCHIVE_MOUNT + r'current-archive\/(audio|video|bilder)\/[0-9]+\/[0-9]+\/[0-9]+\/[0-9]+'
# systemd service for managing all PostgreSQL clusters on the system. This
# service is actually a systemd target, but we are using a service since
# targets cannot be reloaded.
[Unit]
Description=PostgreSQL RDBMS
[Service]
Type=oneshot
ExecStart=/bin/true
╭─space@FeTAp ~
╰─$ python
Python 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> b'\x00'.join(b'\x11\x11\x11')
'\x11\x00\x11\x00\x11'
>>> ^D
╭─space@FeTAp ~
╰─$ python3