Skip to content

Instantly share code, notes, and snippets.

View ssokolow's full-sized avatar

Stephan Sokolow ssokolow

View GitHub Profile
@ssokolow
ssokolow / Disable Root Cert Updates.reg
Created December 26, 2025 01:26
Registry patch to apply if your method for keeping Windows 7 off the Internet induces 25-second delays when starting some games
Windows Registry Editor Version 5.00
; Use this if you're blocking off network access in a way which causes timeouts
; and it's causing some games to wait 25 seconds on every game start as DirectX tries
; to check the root certs for updates as part of video driver signature checking
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\AuthRoot\AutoUpdate]
"DisableWebRetrieval"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SystemCertificates\AuthRoot]
"DisableRootAutoUpdate"=dword:00000001
@ssokolow
ssokolow / thunderbird_esc_fix.py
Created June 22, 2025 16:30
Helper to keep the Thunderbird Quick Filter Bar from seeing Escape keypresses
#!/usr/bin/env python3
"""Helper to block Esc key presses from reaching Thunderbird
(Works by using XGrabKey to claim Esc on all Thunderbird "3pane" windows,
either at startup or when the window first receives focus.)
Requires:
- Python
- python-xlib
@ssokolow
ssokolow / prep_scummvm_games.py
Last active April 27, 2025 02:39
Script to automate adding ScummVM games to EmulationStation Desktop Edition
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# prep_scummvm_games.py
# Copyright 2025 Stephan Sokolow
#
# Helper for batch-adding ScummVM games to ES-DE.
#
# License: MIT (https://opensource.org/license/mit)
#
@ssokolow
ssokolow / win7.sh
Created February 12, 2025 05:05
Script to trigger a KVM switch on Linux by blinking Scroll Lock
#!/bin/bash
# Toggle the KVM switch programmatically by toggling the Scroll Lock LED
# Source: https://askubuntu.com/a/546989/23552
SLEEP=0.5
LEDNAME="Scroll Lock"
echo "Switching..."
xset led named "$LEDNAME"
sleep $SLEEP
@ssokolow
ssokolow / ksni_practice.py
Created December 5, 2024 22:24
Python+QtDBUS reimplementation of (most of) org.kde.StatusNotifierItem
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A demonstration of implementing (most of) org.kde.StatusNotifierItem using
QtDBus to serve as as an example of how more advanced QtDBus features map to
PyQt5, absent robust documentation for how the schema annotations translate.
"""
import os
import signal
import sys
@ssokolow
ssokolow / openraster_test.py
Created October 7, 2024 09:13
Proof of Concept for OpenRaster-based "Use external editor" option
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Proof of concept code for generating and opening an OpenRaster image in the
user's preferred OpenRaster editor.
"""
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__appname__ = "OpenRaster Proof of Concept"
__version__ = "0.1"
__license__ = "MIT"
@ssokolow
ssokolow / completingplaintextedit.py
Created May 10, 2024 05:44
QPlainTextEdit subclass with completion and extras, suitable for Qt Designer promotion
"""A QPlainTextEdit subclass with completion and some extras
Adapted from
https://doc.qt.io/qt-5/qtwidgets-tools-customcompleter-example.html
with the intent to be a minimally complicated way to get as-you-type
autocomplete in a QTextEdit.
As such, a lot of needless complexity has been removed, and odd design choices
which make the code needlessly difficult to maintain have been corrected.
@ssokolow
ssokolow / manga_to_html.py
Created November 23, 2023 07:15
Quick script to split a CBZ file full of two-page scans into pages and then bundle them into data URIs in a .html file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A quick helper for splitting manga pages in a CBZ containing two-page
spreads and then bundling them into base64 URLs in an HTML file so the mobile
Safari preview inside the iOS Files app can act as a quick-and-dirty manga
reader.
Takes .cbz files and produces large .html files.
Currently assumes first image will be a cover and doesn't split it.
@ssokolow
ssokolow / manga_split.py
Created November 23, 2023 06:05
Quick script to split manga CBZs scanned as two-page spreads so they'll convert with proper page order in Calibre
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A quick helper for splitting manga pages so Calibre doesn't split them for
you and present them in the wrong order.
Takes and produces .cbz files.
Currently assumes first image will be a cover and doesn't split it.
"""
@ssokolow
ssokolow / dragtargets.py
Created April 8, 2023 17:48
Quick and dirty example of receiving inter-application drag-and-drop in Python with GTK 3.x
#!/usr/bin/python
"""Quit and dirty port of the old PyGTK dragtargets.py to PyGObject"""
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk, Gtk