Skip to content

Instantly share code, notes, and snippets.

@Tekunogosu
Tekunogosu / wg-killswitch.sh
Last active March 8, 2025 01:39
Wireguard killswitch
#!/bin/bash
# Copy the file to /etc/wireguard/
# Make it executable: chmod +x /etc/wireguard/wg-killswitch.sh
# Add the following lines to your wireguard conf (/etc/wireguard/wg0.conf)
# PostUp = /etc/wireguard/wg-killswitch.sh up %i 123.45.78.99
# PostDown = /etc/wireguard/wg-killswitch.sh down %i 123.45.78.99
# Make sure you update the ip addresses in this file to match your wireguard config and your network
@Tekunogosu
Tekunogosu / Cargo.toml
Last active September 26, 2024 04:50
Small cli program to open a new tab in kitty. There are no options here; this was an exercise in rust and optimizations for release builds. The binary is 363k on my system when built.
[package]
name = "ktab"
version = "0.1.0"
edition = "2021"
[dependencies]
[profile.release]
opt-level = 3
lto = "fat"
@t184256
t184256 / example_remap.py
Created January 19, 2018 03:26
A thoroughly annotated example on keyboard remapping with evdev/uinput.
#!/usr/bin/python3
# CC0, originally written by t184256.
# This is an example Python program for Linux that remaps a keyboard.
# The events (key presses releases and repeats), are captured with evdev,
# and then injected back with uinput.
# This approach should work in X, Wayland, anywhere!
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active October 13, 2025 18:44
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se