Skip to content

Instantly share code, notes, and snippets.

View tjvr's full-sized avatar

Tim Radvan tjvr

View GitHub Profile
@tjvr
tjvr / crypttab
Last active March 13, 2024 17:06
Hibernate on Ubuntu 18.04 with LVM full-disk encryption
sda5_crypt UUID=c66880c1-c2f1-40fc-9580-f25d493876ef none luks,discard
@tjvr
tjvr / flirc-mpris.service
Last active March 25, 2023 20:35
Flirc DBUS MPRIS Daemon
[Unit]
Description=Control MPRIS media players with your Flirc
[Service]
ExecStart=/usr/bin/flirc_mpris.py
Restart=always
[Install]
WantedBy=default.target
@tjvr
tjvr / switch.py
Created August 3, 2019 11:13
Kramer Protocol 2000 for VS-66HN (and probably other HDMI switchers too)
#!/usr/bin/env python
import socket
import struct
import sys
HOST = "192.168.1.39"
PORT = 5000
def switch(input_port):
@tjvr
tjvr / compile.js
Last active September 27, 2019 16:10
compile a moo lexer
const moo = require('moo')
function compileClass(constructor, indent) {
let s = ''
s += indent + 'var ' + constructor.name + ' = ' + constructor
for (let key in constructor.prototype) {
s += '\n\n'
const value = constructor.prototype[key]
if (typeof value === 'function') {
s += indent + constructor.name + '.prototype.' + key + ' = ' + value
@tjvr
tjvr / 99-pico.rules
Created April 6, 2021 19:08
Raspberry Pi Pico/RP2040 udev rules
# /etc/udev/rules.d/99-pico.rules
# Make an RP2040 in BOOTSEL mode writable by all users, so you can `picotool`
# without `sudo`.
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0003", MODE="0666"
# Symlink an RP2040 running MicroPython from /dev/pico.
#
# Then you can `mpr connect $(realpath /dev/pico)`.
SUBSYSTEM=="tty", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0005", SYMLINK+="pico"