I keep acquiring useful tidbits of knowledge. They should be documented for other's benefit. I've gone too long
wanting for an appropriate place to dump these things. There's probably a wiki somewhere, but I haven't found it
yet. So for now I'm going to leave them here.
TinyFugue needed a spell checker.
Everything supports spellcheck on the fly these days except TF. One day I'd had enough waiting and did it myself.
Get the latest and greatest here: kaispell.tf. Older
versions are available too if you're curious how the thing
evolved from a quick hack to a grandiose hack.
The Windows "Offline Files" feature kinda sucks.
I don't know about y'all, but it keeps messing up for me - it gets out of sync, spews tons of sync errors, won't
ever go back online, pretends to delete my offline copies but doesn't actually delete them, and keeps them around
even after I uncheck the "Always available offline" checkbox. Here's the only way I know to fix it:
resetofflinefiles.reg. Right click, save-as, then run it. This will reformat your
offline files database on the next reboot. I discovered the technique
here
and turned it into a reg file because I seem to need it a lot.
Associating files on Debian/Gnome
When you right-click, open-with, you might not find the program you want. There's no way to enter a custom one.
Tutorials always point you toward creating .desktop files and fooling with xdg-open and gvfs-open and ... I dunno, I
always get lost every time I have to do it. I stumbled across an easy way: "mimeopen -d (filename)". You can then
set a custom command and it creates a correctly-formatted .desktop file in ~/.local/share/applications. That's a
lot more handy than figuring it out every time. You might need to run update-desktop-database.
ecryptfs stupidity
"mount(2) system call failed: No such file or directory." Fix: "sudo keyctl link @u @s", then try again
neat tools
Network: iftop nload flowtop
nmon: monitor everything
detox: fix stupid filenames
jc: make unix commands output JSON
jq: JSON swiss army knife
gron: make JSON greppable
visidata: CSV TSV JSON SQLite spreadsheet/browser
bat / batcat: syntax highlighter
btdu: fast sampling du for btrfs
execsnoop: watch all new processes
vidir: rename and delete
lnav: powerful logfile read/search/query/more tool
btop (graphs), ctop (containers)
hyperfine: CLI benchmarking
THE BEST way to map CapsLock to Ctrl
is to do it in Linux instead of in X. That way it works on the terminal too, and there's no jank with programs
which handle their own keycodes.
The old way: setxkbmap -option ctrl:nocaps
or setxkbmap -option caps:ctrl_modifier
The better way:
cat >/etc/udev/hwdb.d/70-keyremap.hwdb <<EOF
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*
KEYBOARD_KEY_3A=29 # Remap Caps to LCtrl
evdev:input:b0003*
KEYBOARD_KEY_70039=leftctrl
EOF
systemd-hwdb update
udevadm trigger
Derate your battery to extend its lifespan
sudo tee /sys/class/power_supply/BAT0/charge_stop_threshold <<< 85
sudo tee /sys/class/power_supply/BAT0/charge_start_threshold <<< 80
Optimus systems end up with both intel_backlight and nv_backlight.
set acpi_backlight=video to let xfpm-power-backlight-helper use the
acpi_video0 interface instead, which also has a better curve.
ZSwap seems to be all-upside.
Compress pages before swapping, and leave them cached.
echo Y > /sys/module/zswap/parameters/enabled
echo z3fold > /sys/module/zswap/parameters/zpool
Handy one liners
grep -oP 'prefix \K\w+' filename # just print the stuff after the prefix. Handier than sed.
--Kai