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
@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.
@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('-_.')
""" 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)
import base64
from datetime import datetime
import asyncio
from winsdk.windows.media.control import GlobalSystemMediaTransportControlsSessionManager as MediaManager
from winsdk.windows.storage.streams import Buffer, InputStreamOptions
async def get_media_info():
sessions = await MediaManager.request_async()
from m3u8downloader.main import M3u8Downloader
from bs4 import BeautifulSoup
import requests
import re
import os
file_location = 'Η Γη της Ελιάς'
vgm_url = 'https://www.megatv.com/episodes/?id=s242&type=tvshows'
os.makedirs(file_location, exist_ok=True)
@bkbilly
bkbilly / stickypassword_to_csv.py
Last active June 14, 2023 20:40
Converts the XML files exported by Sticky Password to CSV format for import to Chrome or Firefox.
import xmltodict
import pprint
import csv
# Make sure you convert the xml file to UTF-8
in_xml = "stickypassword.xml"
out_csv = "pass.csv"
pp = pprint.PrettyPrinter(depth=2)
esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: true
project:
name: bkbilly.smartdevice
version: "1.0"
logger:
captive_portal:
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &
# vncserver -localhost no :2
# vncserver -kill :2
@bkbilly
bkbilly / docker-cvat.yml
Last active February 9, 2025 13:28
Access CVAT from any host
# Copyright (C) 2018-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
version: '3.3'
services:
cvat_db:
container_name: cvat_db
image: postgres:10-alpine
#include <Wire.h>
#include <TFLI2C.h>
#include <ESP8266WiFi.h>
TFLI2C tflI2C;
int16_t tfDist; // distance in centimeters
int16_t tfAddr = TFL_DEF_ADR; // Use this default I2C address
const char* ssid = "CHANGE_SSID";