Skip to content

Instantly share code, notes, and snippets.

View gretel's full-sized avatar
🚀
the jitter does know where it is at none time

Tom Hensel gretel

🚀
the jitter does know where it is at none time
View GitHub Profile
@gretel
gretel / make.conf
Last active December 8, 2017 17:07
freebsd-11 system-wide settings that will apply to every build using make
BOOTWAIT=3000
CPUTYPE?=native
DEFAULT_VERSIONS+=ssl=openssl
LOADER_TFTP_SUPPORT=NO
MAKE_JOBS_NUMBER?=4
MALLOC_PRODUCTION=YES
#NO_CLEAN=YES
#NO_CLEANDIR=YES
#NO_KERNELCLEAN=YES
NO_SENDMAIL=YES
@gretel
gretel / install_pimatic.sh
Last active December 18, 2017 23:05
takes a debian stretch and yarns https://pimatic.org/ on top of it. i really cant stand npm anymore 👅
#!/bin/sh
###
### arguments
###
BASE_DIR="${HOME}/pimatic-app"
APT_PACKAGES="build-essential git libssl-dev nodejs npm yarn avahi-daemon"
@gretel
gretel / main.py
Last active December 30, 2017 13:02
finally got a 'wipy' and put this little code on it. does very simple demo of a LED, buzzer, and two switches. could be little synth if extended lots.
# tom@jitter.eu 12/2017 :*
# https://gist.github.com/gretel/c84643e4d13818fc5a35a8de888126bb
import pycom
import time
from machine import Pin
from machine import PWM
# increments per cycle
STEP_1 = 0.00700
@gretel
gretel / mpv.conf
Created January 5, 2018 16:40
focus on quality and response configuration for https://mpv.io/
##################
# video settings #
##################
# Start in fullscreen mode by default.
#fs=yes
# force starting with centered window
geometry=50%:50%
@gretel
gretel / graphite_nut.py
Created January 11, 2018 00:31
send basic values gathered via 'upsc' from "network ups tools" to graphite in python3
#!/usr/bin/env python3
#
import graphyte
import subprocess
import time
UPS_ID='apc1500@kali'
TIME_INTERVAL=15
GRAPHITE_HOST='graphite.jitter.local'
GRAPHITE_PREFIX='ups.apc1500'
@gretel
gretel / temphumi.py
Created March 13, 2018 16:11
openbsd has native support for 'ugold' temperature/humidity sensors - this does publish the measured values via mqtt
#!/usr/bin/env python3
#
# https://gist.github.com/gretel/22b7b042ef0317d779e5d114710d1e17
MQTT_HOST='mqtt.jitter.local'
import subprocess
from time import sleep
import paho.mqtt.client as mqtt
@gretel
gretel / uvc_cap.py
Created January 24, 2017 01:02
hack to display video stream from usb connected camera (via libuvc, pyuvc, pygame)
# https://gist.github.com/gretel/73fb72ff48db4cfea71a650f4cc72ba7
# based on example at https://github.com/pupil-labs/pyuvc
# install libuvc and pyuvc - see https://github.com/pupil-labs/pyuvc/blob/master/README.md
# install pygame (pip install pygame)
import uvc
import sys
import logging
import pygame
from pygame.locals import *
@gretel
gretel / geiger-counter.py
Last active May 16, 2018 13:40
read radiation level from MightyOhm Geiger Counter v1.0 and log to file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import time
import logging
import sys
from parse import * # $ pip install pyparse
import serial # $ pip install pyserial
@gretel
gretel / smtpd.conf
Last active June 2, 2018 16:32
openbsd 6.3-current new grammer opensmtpd configuration
# https://gist.github.com/gretel/e56956f05cc59682195ade6a089c28db
# tables
table aliases file:/etc/mail/aliases
table domains file:/etc/mail/domains
table passwd file:/etc/mail/passwd
table secrets file:/etc/mail/secrets
table deny db:/etc/mail/deny.db
table receip db:/etc/mail/receip.db
@gretel
gretel / disable.sh
Last active June 12, 2018 20:20
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=(