Skip to content

Instantly share code, notes, and snippets.

View theodric's full-sized avatar
🎯
Shoobydoowop

þēodrīċ theodric

🎯
Shoobydoowop
View GitHub Profile
@theodric
theodric / touchegg.conf
Created March 3, 2025 05:10
~/.config/touchegg.conf for vaguely c.2012 Mac-like gestures on Linux/X11
<touchégg>
<settings>
<!--
Delay, in milliseconds, since the gesture starts before the animation is displayed.
Default: 150ms if this property is not set.
Example: Use the MAXIMIZE_RESTORE_WINDOW action. You will notice that no animation is
displayed if you complete the action quick enough. This property configures that time.
-->
<property name="animation_delay">150</property>
@theodric
theodric / [email protected]
Created January 31, 2025 13:10
TightVNC systemd unit file for Debian
[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target
[Service]
Type=forking
User=someusername
Group=somegroupname
WorkingDirectory=/home/someusername
@theodric
theodric / LOCAL-Train_a_GPT_2_Text_Generating_Model_w_GPU.ipynb
Created January 30, 2025 16:25
A local-ized version of Max Woolf's GPT-2 training Colab notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theodric
theodric / vncserver.service
Created January 20, 2025 14:12
Simple systemd unit file to run vncserver as root on boot (lol security)
[Unit]
Description=VNC Server
After=network.target
[Service]
Type=forking
Environment="HOME=/root"
ExecStart=/usr/bin/vncserver
ExecStop=/usr/bin/vncserver -kill :1
Restart=always
@theodric
theodric / tpmorse.py
Last active January 2, 2025 10:39
ThinkPad lid dot Morse code transmitter - python3 & Linux + thinkpad_acpi required
#!/usr/bin/env python3
# theodric 2025-01-01
# ThinkPads have a red dot on the lid that lights up when the system is powered on.
# Use it to send messages in Morse code!
import sys
import time
# path to the led brightness file
LED_BRIGHTNESS_PATH = "/sys/devices/platform/thinkpad_acpi/leds/tpacpi::lid_logo_dot/brightness"
@theodric
theodric / husesockettoggler.py
Created January 1, 2025 13:47
Python script to toggle the state of a Philips Hue smart socket using "openhue" (https://www.openhue.io/cli/openhue-cli). I use this in combination with the plasmoid "Run Command" (https://himdek.com/Run-Command-Widget-for-Plasma/) to turn my ThinkPad charging brick on and off.
#!/usr/bin/env python3
import os
import subprocess
# Define the commands
cmd_on = "openhue set light 626d5ac8-dd60-4eaa-9fa7-f0d0eb31ec15 --on"
cmd_off = "openhue set light 626d5ac8-dd60-4eaa-9fa7-f0d0eb31ec15 --off"
get_cmd = "openhue get light 626d5ac8-dd60-4eaa-9fa7-f0d0eb31ec15"
# Function to get the current status of the light
@theodric
theodric / twostopbits-darkmode.js
Created December 31, 2024 15:22
Two Stop Bits (twostopbits.com) dark mode userstyle for Violentmonkey
// ==UserScript==
// @name TwoStopBits Dark Mode
// @namespace http://tampermonkey.net/
// @version 1.2
// @description twostopbits.com dark mode userstyle
// @author Theodric
// @match https://twostopbits.com/*
// @grant GM_addStyle
// ==/UserScript==
@theodric
theodric / tpe14g2ledshit.md
Last active December 30, 2024 22:28
ThinkPad E14g2 Cool LED Shit

So you want the LEDs on your Acer-with-a-clit (ThinkPad E14 gen2) to be more humane?

Mute and micmute LEDs = off?

Power indicator LED = flashes with phy0 RX (white) and TX (green?

Good news, everyone! Do this:

create /some/where/tpled.sh:

@theodric
theodric / Thinkpad E14g2 keyd config + libinput quirks file
Last active January 10, 2025 19:27
keyd config for the ThinkPad E14 gen2
## E14 (with a fucked-up Fn key)
## First part: Mappings to make the keyboard work more like the C13
## Second part: Libinput quirks file to restore the function of disabling the touchpad while typing
## twinkpad:/etc/keyd # cat thinky.conf
[ids]
0001:0001:a38e6885
[main]
f1 = back
@theodric
theodric / etc-keyd-cros.conf
Last active December 28, 2024 16:17
'MORPHIUS' Chromebook ThinkPad C13 Yoga-specific keyd keymapper config - needs https://github.com/rvaiya/keyd
[ids]
k:18d1:503d
k:18d1:504c
k:18d1:5030
k:18d1:5057
k:18d1:502b
k:18d1:5052
k:18d1:5050
k:18d1:5044
k:18d1:503c