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
@dale3h
dale3h / lovelace-migrate.py
Created June 29, 2018 00:02
Lovelace UI Migration Script
"""
Migration tool for Home Assistant Lovelace UI.
"""
import argparse
import logging
import sys
import json
from collections import OrderedDict
from getpass import getpass
@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
@gopsmith
gopsmith / disable.sh
Last active July 22, 2024 20:35
Disable bunch of #$!@ in High Sierra
#!/bin/bash
# NOTE: This script must be run from Terminal within RECOVERY MODE. This version is for macOS High Sierra.
# There is no need to disable SIP (via csrutil), because recovery mode is not constrained by SIP.
# WARNING: It might enable things that you may not like. Please double check the services in the TODISABLE vars.
#
# For OSes newer than High Sierra, see comments in the original gist author's Catalina version, at
# https://gist.github.com/pwnsdx/1217727ca57de2dd2a372afdd7a0fc21
# (see the "Note about Big Sur" at the top, and there are comments about Monterey further down).
#
@moorer2k
moorer2k / rtlsdr-decoder-setup.sh
Last active February 25, 2025 17:46
Automated setup created for DietPi on an RPI2 for RTL-SDR pager decoding using mutlimon-ng and pagermon. Uses version managers for node and python to keep it isolated + correctly compiled.
#DietPi setup script for RTL-SDR/Multimon-ng/Pagermon for decoding pager messages(FLEX/POCSAG etc.)
cat <<EOF >no-rtl.conf
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
EOF
mv no-rtl.conf /etc/modprobe.d/
@qubodup
qubodup / credits.htm
Last active April 21, 2025 14:06
Shotcut Scrolling Credits Text Animation WebVfx example
<!DOCTYPE html><html><head><meta charset="UTF-8">
<script src="qrc:/scripts/jquery.js"></script>
<script src="qrc:/scripts/rangy-core.js"></script>
<script src="qrc:/scripts/rangy-cssclassapplier.js"></script>
<script src="qrc:/scripts/htmleditor.js"></script>
<!-- this is possible thanks to http://www.elusien.co.uk/shotcut/ -->
<style>
html, body {margin: 0; width: 100%; height: 100%; overflow: hidden; }
#credits {position: absolute; top: 100%; width: 100%; padding: 25px 0; margin:0; text-align: center;}
/****************************************/
@gretel
gretel / amiibo.sh
Last active September 7, 2024 13:32
query, read, encode (using amiitool), write and lock NTAG215 (using uFR Nano hardware) for the purpose of researching Nintendo's Amiibo infrastructure Raw
#!/bin/bash
# This is a companion script to https://github.com/konstantin-kelemen/arduino-amiibo-tools
# The original post this was crafted for was https://games.kel.mn/en/create-amiibo-clones-with-arduino/
# For more info go to https://games.kel.mn/en/companion-script-to-simplify-amiibo-cloning-with-arduino/
#requirements:
#sha1sum (part of coreutils)
#xxd (part of vim)
#hexdump
#amiitool (https://github.com/socram8888/amiitool)
// www.thingiverse.com/thing:1397964
// https://gist.github.com/gretel/3a2ff28e2489105f966c787eed160ef1
/* Measurements */
// Dog Width in inches
A = 5.906;
// Dog Height in inches
B = 11.417;
@gretel
gretel / rpi3strech_custom
Last active April 14, 2017 17:36
template for https://github.com/drtyhlpr/rpi23-gen-image to build a very minimal debian strech image (armhf/rpi3)
# https://gist.github.com/gretel/0b3cb1fced594fa0a9011c91da2603d8
# https://github.com/drtyhlpr/rpi23-gen-image/blob/master/README.md
#
APT_INCLUDES="ca-certificates,curl,tmux"
APT_SERVER="ftp.de.debian.org"
BUILD_KERNEL=true
DEFLOCAL="en_US.UTF-8"
ENABLE_DHCP=true
ENABLE_HARDNET=true
ENABLE_MINBASE=true
@simonw
simonw / recover_source_code.md
Last active September 14, 2025 04:26
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@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 *