How to Monkey-Patch the Linux Kernel
The author has a unique keyboard setup where they type in Dvorak but use Qwerty for hotkeys, as the classic text-editing shortcuts are optimally located for Qwerty. However, this setup broke when their machine updated to Wayland due to its sensible security rules preventing random programs from capturing all keyboard events. To resolve this issue, they discovered SystemTap, a tool designed for debugging purposes that allows probing the Linux kernel and modifying variables in a running kernel. They used SystemTap to monkey-patch their system, enabling them to get the desired keyboard behavior without maintaining a fork forever or spending weeks developing a feature worthy of pushing upstream. The author proposes two rules for monkey patching: only the exclusive owner of the environment may monkey-patch it and the owner takes full responsibility for any breakages caused.
Company
Cloudflare
Date published
Oct. 24, 2017
Author(s)
Kenton Varda
Word count
1409
Hacker News points
None found.
Language
English