Skip to content

Instantly share code, notes, and snippets.

View bkbilly's full-sized avatar
🎃
Let's Build a Better World Together

Vasilis Koulis bkbilly

🎃
Let's Build a Better World Together
View GitHub Profile
""" Decode IR signals from remote controls """
def decode_nec(ir_signal):
protocol_leading = 9000
protocol_leading_space = 4500
protocol_pulse = 562.5
protocol_pulse_high = 1687.5
width = 200
leading_pulse = ir_signal.pop(0)
@bkbilly
bkbilly / audio_metadata_fix.py
Last active October 3, 2024 09:57
Useful for reading MP3 files with PLEX
import re
import os
import glob
import eyed3
def get_valid_filename(value):
value = value.replace("/", " ")
value = re.sub(r"[^-\w.\s^\]^\[^\(\^)]", "", value)
value = re.sub(r"[\s]+", " ", value).strip('-_.')
@bkbilly
bkbilly / README.md
Last active June 28, 2025 13:25
OpenWRT network monitor: Detects new devices via DHCP/ARP, resolves hostnames and MAC types, then sends MQTT alerts.

OpenWRT New Device Monitor

This OpenWRT app identifies new network devices (DHCP/ARP), publishing detailed JSON messages to an MQTT topic. It includes device MAC, IP, hostname (if available), and MAC type (random/physical).

Features

  • New Device Detection: Monitors DHCP leases and ip neigh show for new devices.
  • MQTT Notifications: Sends JSON messages with device details.
  • Hostname Resolution: Uses DHCP leases and nslookup for hostnames.
  • MAC Type Identification: Differentiates "physical" vs. "random" MACs.
  • Minimal & Integrated: Shell script, minimal dependencies, procd managed for auto-start and stability.