Skip to content

Instantly share code, notes, and snippets.

View ahbanavi's full-sized avatar
🎯
Focusing

Amir ahbanavi

🎯
Focusing
View GitHub Profile
@ahbanavi
ahbanavi / README.md
Last active November 3, 2026 08:25
Claude FM for Windows: the YouTube live stream as a small mpv radio with a Start menu shortcut and minimize-to-tray

Claude FM for Windows

A Start menu launcher for the Claude FM YouTube live stream. It plays audio only, in a small mpv window that minimizes to the tray.

Unofficial; not affiliated with Anthropic.

Claude FM window

What you get

@ahbanavi
ahbanavi / README.md
Last active October 30, 2026 09:35
Moved to github.com/ahbanavi/openwrt-passwall2-tools (killswitch/): pw-killswitch, a killswitch for passwall2 on OpenWrt
@ahbanavi
ahbanavi / README.md
Last active October 30, 2026 09:35
Moved to github.com/ahbanavi/openwrt-passwall2-tools (patches/): five local patches for passwall2 on OpenWrt
@ahbanavi
ahbanavi / README.md
Last active October 30, 2026 09:34
Moved to github.com/ahbanavi/openwrt-passwall2-tools (failover/): pw-failover, passwall2 node and WAN failover for OpenWrt
@ahbanavi
ahbanavi / README.md
Created October 5, 2026 10:33
trakt-backup: back up a whole Trakt.tv account (incl. hidden/dropped shows, playback) to a ZIP of JSON via the API, from cron. Same files as Trakt's web export. Python stdlib only.

trakt-backup

Back up a whole Trakt.tv account to a ZIP of JSON files through the Trakt API, unattended, from cron or any scheduler. One Python file, standard library only.

What it saves

trakt_backup.py makes the same API calls as Trakt's own web export (Settings ▸ Data ▸ Raw Export) and writes the same file names: one JSON per endpoint, with a -<page> suffix when an endpoint spans several pages. The endpoint list was read from the web app's export code in October

@ahbanavi
ahbanavi / README.md
Created August 7, 2026 14:31
Full voice control of an LG C5 (webOS 25) from Home Assistant + Google Assistant, without LG ThinQ — IR turn-on because Wake-on-LAN can't work, screen-off, app launching, repurposed remote keys

Full voice control of an LG C5 (webOS 25) from Home Assistant + Google Assistant — without LG ThinQ

Everything here runs over the LAN: no LG cloud, no Nabu Casa, no rooting the TV, nothing sideloaded onto it. Home Assistant talks to the set with the built-in webostv integration, and Google only ever sees HA's own fulfillment.

Written up because ThinQ was a dead end for me and most of the individual pieces below are either undocumented, wrong in the obvious place, or only findable by reading the integration source.

Tested on an OLED65C56LA, firmware 33.31.68, HA 2026.7.4.

@ahbanavi
ahbanavi / README.md
Created August 6, 2026 14:17
Jellyfin on LG webOS: every clock off by your UTC offset — webOS's WebAppManager engine resolves Intl's default time zone to Etc/Unknown (= UTC) while Date is correct. Full diagnosis + a self-gating JS fix.

Jellyfin on LG webOS: every clock is off by exactly your UTC offset

TL;DR — webOS's WebAppManager engine resolves the default Intl time zone to Etc/Unknown, which ICU formats as UTC. Date is perfectly correct; only Intl is broken. jellyfin-web renders every clock through Intl, so they all shift together by your UTC offset. Nothing about your TV, server, or container time zone is misconfigured. Fix: pin the zone from JavaScript (webos-intl-timezone-fix.js).


Symptoms

In the Jellyfin app on an LG Smart TV, every rendered time is behind (or ahead) by exactly your UTC offset:

@ahbanavi
ahbanavi / script.js
Created March 17, 2025 06:43
find duplicated name in a web page
const findDuplicateNames = () => {
// Get all form elements excluding radio buttons
const elements = document.querySelectorAll('input:not([type="radio"]), textarea, select');
const nameMap = new Map();
elements.forEach(element => {
const name = element.getAttribute('name');
if (name) {
if (!nameMap.has(name)) {
@ahbanavi
ahbanavi / n8n-docker-compose.yml
Last active March 3, 2025 07:15
Docker Compose configuration for setting up n8n
# https://gist.github.com/ahbanavi/308b27b5538559352dac960d48772cde
services:
n8n:
image: docker.n8n.io/n8nio/n8n
container_name: n8n
restart: always
environment:
N8N_SECURE_COOKIE: false # If you also want to use it with localhost
WEBHOOK_URL: https://n8n.example.com # The domain configured in Cloudflare Zero Trust
@ahbanavi
ahbanavi / nyaa_rss_check.sh
Last active June 29, 2026 17:36
Nyaa.si RSS Feed Monitor with Telegram Notifications
#!/bin/bash
# RSS Feed Monitor for Nyaa.si
# ==========================
# This script monitors nyaa.si RSS feed for new items matching a keyword and sends
# notifications via Telegram.
# By default, this script only checks for english-translated anime items.
#
# Requirements:
# - curl