Skip to content

Instantly share code, notes, and snippets.

@abdusco
abdusco / FINDINGS.md
Last active November 10, 2026 19:01
Minimal Python extractor for Inno Setup 6.7.x installers (stdlib only)

Inno Setup 6.5–6.7 format changes

These notes cover:

  • the Inno Setup installer format changes after 6.4.0,
  • how innoextract was patched to read them (innoextract-inno-6.5-6.7.patch),
  • how the standalone innoextract.py reads them.

Sources:

@abdusco
abdusco / telegram_chat_id.sh
Created June 25, 2026 05:39
Get Telegram chat ID for a bot
#!/bin/bash
# Dependencies: curl, jq, fzf
# Required Env: TELEGRAM_BOT_TOKEN
set -e
if [[ -z "$TELEGRAM_BOT_TOKEN" ]]; then
echo "Error: TELEGRAM_BOT_TOKEN is not set." >&2
exit 1
@abdusco
abdusco / install_latest_sqlite.sh
Last active June 25, 2026 04:37
Install latest version of sqlite
#!/usr/bin/env bash
set -euo pipefail
require_cmd() {
command -v "$1" >/dev/null 2>&1 || {
printf 'Missing required command: %s\n' "$1" >&2
exit 1
}
}
@abdusco
abdusco / youtube_transcript.py
Created November 7, 2025 18:48
Transcribe YouTube videos
#!/usr/bin/env -S python3
from pathlib import Path
import subprocess
import json
import sys
import tempfile
import argparse
import logging
@abdusco
abdusco / subtitle_translator.py
Last active August 17, 2025 16:24
Subtitle translator
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = ["srt", "httpx"]
# ///
import argparse
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import os
@abdusco
abdusco / whisper_subtitles.py
Last active July 31, 2025 11:37
Generate SRT subtitles for a video / audio using OpenAI's Whisper model
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = ["httpx", "srt"]
# ///
"""
# Whisper Subtitles
This script generates SRT subtitles for audio or video files using the OpenAI Whisper API.
@abdusco
abdusco / chat.html
Last active March 25, 2025 15:25
LLM chat interface
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cet ci pi ti</title>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<style>
:root {
/* Light theme variables */
@abdusco
abdusco / HTMLPopup.swift
Last active March 19, 2026 16:23
Show HTML as popup on Mac
import Cocoa
import WebKit
struct Options {
var html: String = ""
var url: URL? = nil
var title: String = "HTML Viewer"
var width: CGFloat = 800
var height: CGFloat = 600
var env: String = "{}" // Default empty JSON object
@abdusco
abdusco / htmlpopup.go
Last active December 24, 2024 19:35
Open up HTML from stdin in a browser tab
package main
import (
"context"
"fmt"
"io"
"log"
"net"
"net/http"
"os"
@abdusco
abdusco / server.py
Created March 2, 2024 04:51
Python mini HTTP server to serve a single request and shutdown
import http.server
import socketserver
import threading
import urllib.parse
def wait_for_oauth_callback(port: int = 9090) -> str:
code: str | None = None
class CallbackHandler(http.server.SimpleHTTPRequestHandler):