Skip to content

Instantly share code, notes, and snippets.

View James-E-A's full-sized avatar

James E. A. James-E-A

View GitHub Profile
@James-E-A
James-E-A / 10-LVDS-gamma.conf
Last active June 21, 2018 19:26
Fix laptop blue hue on Linux
# /etc/X11/xorg.conf.d/10-LVDS-gamma.conf
# Works on Debian and Ubuntu for at least the last 5 years
Section "Monitor"
Identifier "LVDS"
# Identifier "eDP-1"
Gamma 1.15 0.8 0.78 #tune to taste or accuracy
EndSection
@James-E-A
James-E-A / [email protected]
Last active September 11, 2025 02:09
systemd user-unit file for Minecraft server
# ~/.config/systemd/user/[email protected]
# Setup:
# loginctl enable-linger "${USER}"
# systemctl --user daemon-reload
# ln -sfv ../../jars/paper.jar /var/minecraft/servers/survival/server.jar
# systemctl --user enable --now minecraft@"$(systemd-escape /var/minecraft/servers/survival)".service
[Unit]
Description=Minecraft Server (%I)
@James-E-A
James-E-A / udp_helper.py
Last active September 11, 2025 02:09
Python UDP socket.recv() iterator supporting KeyboardInterrupt and Multicast
#!/usr/bin/env python3
# Authored by James Edington Administrator in 2025; placed in the Public Domain.
__all__ = ['udp_listen_sync', 'udp_listen_async']
"""USAGE:
from udp_helper import *
# Simple iterator that responds instantly to Ctrl+C / SIGINT
@James-E-A
James-E-A / temporal_settlement.py
Last active September 11, 2025 02:11
Beancount clear different legs of transaction on different dates
from contextlib import contextmanager
from datetime import date
from functools import reduce
from gettext import dgettext
from traceback import format_exception
from types import SimpleNamespace
import re
import uuid
from beancount.core.account import join as account_join, leaf, root, sans_root
@x42005e1f
x42005e1f / glock.py
Last active November 6, 2025 18:29
A group-level lock (async-aware & thread-aware)
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2025 Ilya Egorov <[email protected]>
# SPDX-License-Identifier: ISC
from __future__ import annotations
from collections import OrderedDict
from typing import TYPE_CHECKING