Skip to content

Instantly share code, notes, and snippets.

View cpulvermacher's full-sized avatar

Christian Pulvermacher cpulvermacher

View GitHub Profile
@sbrugman
sbrugman / testable_tread.py
Last active November 20, 2024 05:17
Wrapper around Python's thread that propages exceptions (pytest).
import threading
class TestableThread(threading.Thread):
"""Wrapper around `threading.Thread` that propagates exceptions."""
def __init__(self, target, args):
super().__init__(self, target=target, args=args)
self.exc = None
#!/bin/bash
# set -x
print_usage() {
echo "$0 [--map=0:3] video_file" >&2
echo "" >&2
echo "With video_file the path to a file like mkv which embeds the subtitles" >&2
echo "--map: use the specified embedded subtitle." >&2
echo "" >&2
@m13253
m13253 / upower-Add-a-critical-action-Ignore.patch
Created October 5, 2016 14:19
A patch for UPower to disable low battery action
From 1ba6e724dabf3a91e59b871750e22d420a4b1238 Mon Sep 17 00:00:00 2001
From: Star Brilliant <m13253@hotmail.com>
Date: Wed, 5 Oct 2016 22:02:36 +0800
Subject: [PATCH] Add a critical action: Ignore
---
etc/UPower.conf | 3 ++-
src/linux/up-backend.c | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
@eighthave
eighthave / find-https-debian-archives.py
Last active November 19, 2025 11:05
Script to find official Debian mirrors that support HTTPS
#!/usr/bin/env python3
import urllib.request
import re
import ssl
import sys
# # find generic mirrors
mirrors = urllib.request.urlopen('http://www.debian.org/mirror/list')
https = []