Skip to content

Instantly share code, notes, and snippets.

View HerrSpace's full-sized avatar
💭
🧠🔥

Space Meyer HerrSpace

💭
🧠🔥
View GitHub Profile
# Ignored by AndroidStudio
*.iws
# Folders related to builds
.gradle/
*/build/
# Local settings (regenerated by Android Studio)
.idea/workspace.xml
local.properties
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>
@HerrSpace
HerrSpace / gist:8529801
Last active January 3, 2016 22:39
Pretty LED stuff.
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NumberPixels 60
#define FadeFrames 6
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
@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

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
def git_version(path):
# Like v1.0.0 or v1.0.0-1-g963fc39.dirty
git_describe = check_output([
'git', '-C', path, 'describe', '--tags', '--dirty=.dirty']
).decode().strip()
# Like v1.0.0
last_tag = check_output([
'git', '-C', path, 'describe', '--tags', '--abbrev=0']
).decode().strip()