Skip to content

Instantly share code, notes, and snippets.

View theodric's full-sized avatar
🎯
Shoobydoowop

þēodrīċ theodric

🎯
Shoobydoowop
View GitHub Profile
@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
@theodric
theodric / asteriskdahdinotes.txt
Created December 24, 2024 01:46
asterisk & dahdi with tdm410
From: https://serverfault.com/questions/978738/dahdi-3-0-0-not-assign-spans-and-cannot-generate-configuration/989462#989462
site logo
Skip to main content
Server Fault
DAHDI 3.0.0 not assign spans and cannot generate configuration
Asked 5 years, 4 months ago
Modified 2 years, 3 months ago
@theodric
theodric / macOS-open-for-bash-on-linux.txt
Last active December 23, 2024 19:21
macOS 'open' for bash on linux
open() {
if [[ -z "$1" ]]; then
echo "usage: open <file>" >&2
return 1
fi
if [[ ! -e "$1" ]]; then
echo "file not found: $1" >&2
return 1
fi
@theodric
theodric / darkrotik.js
Last active December 20, 2024 20:42
Mikrotik webfig color inverter userstyle (dark mode)
// ==UserScript==
// @name MikroTik Inverted Dark Mode
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Invert colors on MikroTik webfig
// @author Peepee Poopoo
// @source https://gist.github.com/theodric/2c3b234c8a668eec50ceb3688aad0786
// @fart hey you, edit this file so it works on your device's IP address/DNS name
// @match http://192.168.88.1/*
// @grant none
@theodric
theodric / 1337infowars.js
Created December 14, 2024 18:22
InfoWars Black Hat Hacker userstyle
// ==UserScript==
// @name InfoWars Black Hat Hax0r Mode
// @namespace http://tampermonkey.net/
// @version 1.3
// @description A dark mode for Drudge Report with a 1337 |-|4><0R æsthetic
// @author Theodric Æðelfriþ
// @match https://www.infowars.com/*
// @grant none
// ==/UserScript==
@theodric
theodric / 1337drudge.js
Created December 10, 2024 17:12
Drudge Report black hat hacker-mode userstyle for ViolentMonkey
// ==UserScript==
// @name Drudge Report Black Hat Hax0r Mode
// @namespace http://tampermonkey.net/
// @version 1.1
// @description A dark mode for Drudge Report with a 1337 |-|4><0R æsthetic
// @author Theodric Æðelfriþ
// @match https://drudgereport.com/*
// @grant none
// ==/UserScript==