Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
hacking home at home

Tom Hensel gretel

🏠
hacking home at home
View GitHub Profile
@gretel
gretel / disable.sh
Last active Jun 12, 2018
Disable bunch of #$!@ in Sierra (Version 2.1)
View disable.sh
#!/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=(
@gretel
gretel / smtpd.conf
Last active Jun 2, 2018
openbsd 6.3-current new grammer opensmtpd configuration
View smtpd.conf
# 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 / course53.py
Last active Oct 17, 2020
cli for route53 to create/update A (ipv4) and AAAA (ipv6) records. use in conjunction with https://gist.github.com/gretel/d42879295a0750c102edc7babbebcc0e
View course53.py
#!/usr/bin/env python3
# https://gist.github.com/gretel/8bb0c2936ae5cda12ae5f0bf381dd3f0
# based on https://github.com/edgan/route53-set-hostname/blob/master/route53-set-hostname.py
import boto3
import sys
import argparse
class Course53(object):
def __init__(self, region, domain, subdomain, hosted_zone_id, record_type, ipaddress, ttl):
@gretel
gretel / temphumi.py
Created Mar 13, 2018
openbsd has native support for 'ugold' temperature/humidity sensors - this does publish the measured values via mqtt
View temphumi.py
#!/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 / graphite_nut.py
Created Jan 11, 2018
send basic values gathered via 'upsc' from "network ups tools" to graphite in python3
View graphite_nut.py
#!/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 / mpv.conf
Created Jan 5, 2018
focus on quality and response configuration for https://mpv.io/
View mpv.conf
##################
# video settings #
##################
# Start in fullscreen mode by default.
#fs=yes
# force starting with centered window
geometry=50%:50%
@gretel
gretel / main.py
Last active Dec 30, 2017
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.
View main.py
# 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 / install_pimatic.sh
Last active Dec 18, 2017
takes a debian stretch and yarns https://pimatic.org/ on top of it. i really cant stand npm anymore 👅
View install_pimatic.sh
#!/bin/sh
###
### arguments
###
BASE_DIR="${HOME}/pimatic-app"
APT_PACKAGES="build-essential git libssl-dev nodejs npm yarn avahi-daemon"
@gretel
gretel / make.conf
Last active Dec 8, 2017
freebsd-11 system-wide settings that will apply to every build using make
View make.conf
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 / build_sierra_iso.sh
Created Sep 20, 2017
build osx sierra .iso to use in virtualbox (or burn a dual-layer rom)
View build_sierra_iso.sh
rm -f /tmp/Sierra.cdr
rm -f /tmp/Sierra.cdr.dmg
hdiutil attach '/Applications/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg' -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg