Skip to content

Instantly share code, notes, and snippets.

View eggbean's full-sized avatar

Jason Gomez eggbean

  • London, United Kingdom
View GitHub Profile
@eggbean
eggbean / AltGr-to-Alt-and-PrtSc-to-Context-Menu.reg
Created July 3, 2023 12:10
Windows registry key to change PrtSc key to Context Menu key and AltGr to Alt (you can still Ctrl+Alt to get the same function as AltGr. This is useful for ThinkPad users in the UK in particular.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,5d,e0,37,e0,38,00,38,e0,\
00,00,00,00
@eggbean
eggbean / kernel_update_check.sh
Last active June 6, 2023 05:13
Bash snippet to determine if the kernel has been updated, requiring a reboot. Tested on Debian and RHEL-based systems. If you put it in your .bashrc, surround it with (parentheses) so that it runs in a subshell, or execute it as a separate script, as otherwise it would change your nullglob shell option and current directory if sourced.
#!/bin/bash
cd /boot || exit 1
shopt -s nullglob ; for file in config-* ; do kernels+=( "${file#config-}" ) ; done
newest="$(printf '%s\n' "${kernels[@]}" | sort -V -t - -k 1,2 | tail -n1)"
current="$(uname -r)"
[[ $current != $newest ]] && echo "Reboot needed for new kernel"
@eggbean
eggbean / twitter_go_back.user.js
Last active October 6, 2021 20:19
Userscript for Twitter Go Back with H key
// ==UserScript==
// @name Twitter Go Back with H key
// @namespace https://gist.github.com/eggbean/ba4daf82f132421c69dbd2c2e0b3e061/raw/twitter_go_back.user.js
// @version 1.0
// @description Makes the unused H key a browser back button for better H,J,K,L keyboard navigation
// @author https://github.com/eggbean
// @match https://twitter.com/*
// @icon https://twitter.com/favicon.ico
// @grant none
// ==/UserScript==