Skip to content

Instantly share code, notes, and snippets.

View matthewblott's full-sized avatar

Matthew Blott matthewblott

View GitHub Profile

Keys

Escape        =   9 Escape
Backspace     =  22 Backspace
Caps lock     =  66 Caps_Lock
Shift left    =  50 Shift_L
Function = 
Control left = 37 Super_L
#!/usr/bin/env bash
# load file
xmodmap .Xmodmap
# list bound modifiers
xmodmap -pm
# remove one of the super (command) key modifiers
xmodmap -e "remove mod4 = Super_L"
#!/usr/bin/env bash
# To find a key code execute the command below and then hover the mouse over the
# square in the window that appears. Press the key you wish to find the key code for
# and then set the focus back to the terminal and the key with its code will appear.
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = 1 exclam 1 exclam onesuperior exclamdown onesuperior exclamdown
keycode 11 = 2 at 2 quotedbl EuroSign oneeighth twosuperior oneeighth
keycode 12 = 3 sterling 3 sterling numbersign sterling threesuperior sterling
keycode 13 = 4 dollar 4 dollar onequarter dollar EuroSign onequarter
keycode 14 = 5 percent 5 percent onehalf threeeighths onehalf threeeighths
keycode 15 = 6 asciicircum 6 asciicircum threequarters fiveeighths threequarters fiveeighths
keycode 16 = 7 ampersand 7 ampersand braceleft seveneighths braceleft seveneighths
keycode 17 = 8 asterisk 8 asterisk bracketleft trademark bracketleft trademark
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
#!/usr/bin/env bash
# remove .DS_Store files
sudo find / -name .DS_Store -delete; killall Finder
# disable writng .DS_Store files
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
# enable writing .DS_Store files
defaults write com.apple.desktopservices DSDontWriteNetworkStores false
Host hostname
HostName example.com
User username
Port 22
PubKeyAuthentication yes
IdentityFile ~/.ssh/id_rsa
RemoteForward 52698 localhost:52698
#!/usr/bin/env bash
# list ports used with localhost
ss -lt
# find process id for used port
fuser --namespace tcp 8080
# kill process
sudo kill -9 12345
const typography = require('@tailwindcss/typography')
module.exports = {
theme: {
extend: {
typography: {
DEFAULT: {
css: {
color: '#333',
a: {
#!/usr/bin/env bash
# list the directories in the current directory
tree -d -L 1
# list the directories, and their immediate child directories in the current directory
tree -d -L 2