linux

Renewing gpg keys and subkeys

Intro My encrypted orgmode file in which I store my sensitive information suddenly could be opened, but not edited. When I attempted to save I received: gpg: D664BA060CCB9D32: skipped: Unusable public key gpg: [stdin]: encryption failed: Unusable public key A search online indicated that it was probably due to my gpg keys expiring. With a quick update to the process in 2022 and a belief in the value of limited duplication, here is the winning strategy:

locking repos to avoid installation with zypper dup

** Especially on a rolling distro you sometimes want to avoid certain package updates that might break your system. Note that I’ve aliased sudo zypper to z (which I highly recommend). z addlock Mesa-dri-nouveau

Split/shorten a PDF with pdftk

You can use pdftk to reduce a 150-page PDF to a just the pages you care about. pdftk ORIG_FILE.pdf cat 1-5 output NEW_FILE.pdf

Debug Cron

Suddenly Cron wasn’t running my mail script; I verified that the script itself was still working, so than I began the venture into the unknown: how to debug Cron? Serverfault has a good answer. Everything seemed to checkout, and I verified that it was working to write to a tmp file. The file was being written. Finally, by removing the line that smothers output to /dev/null I was able to find the problem: the need for an absolute path name (as evidently the Cron user couldn’t run getmail without a full path).

Building custom x11 cursors for Linux

I wanted to use the sort of Starcraft game cursors I enjoyed on my windows machine as a teenager, and this was my first thought of custom cursors in Linux. Note that I use EXWM as a low-level window manager, so these instructions should work for most any Linux system. Spoiler: I got it working, but it took a good deal of time that I hope you might be saved. Here is my story.

Printing from the Command Line (and emacs)

Helpful Resource: https://www.cyberciti.biz/tips/linux-unix-sets-the-page-size-to-size.html Command Note lp print with good defaults lpc status all See printer settings lprm clear print jobs export PRINTER='Sharp-MX-2700N’ Set the target printer before printing lpoptions See available options I generally print PDFs, using the excellent pdf-tools. This provides C-c C-p which will print with the $PRINTER and settings you’ve configured, but sometimes you need more customization.

Easily add something to linux system startup

This info worked from the Simplified guide: https://www.simplified.guide/linux/automatically-run-program-on-startup I wanted to start postgresql at startup, because I always end up starting it anyway. As a main-stream application I found it on the list: sudo systemctl list-unit-files --type=service Then I enabled it. sudo systemctl enable postgresql Done! If it hadn’t been on the list I suppose I would have had to make my own unit file for it, thereby adding it to the list.

Gif screencasts from Linux CLI with Byzanz

Wanting to demonstrate the power of emacs M-x butterfly, I needed to make the sort of gif-screen-capture I’ve seen others put to good work. Extra snag: I use emacs itself for a window manager, so the first online recommendation of Peek didn’t work. Instead I found the open-source byzanz to record; however, it requires knowing the screen-portion and length of the gif beforehand. Other than that, though, it worked great even on my exwm (GUI-resistant) system.

Getmail failure: invalid syntax

getmail -rmymail.conf File “/usr/bin/getmail”, line 64 except ImportError, o: ^ SyntaxError: invalid syntax It turns out, the service I use to collect my email, getmail, requires python 2; I’d forgotten this (if I ever knew it) and made python 3 my system default (I rebound the “python” command to 3 instead of 2) and so it failed. I didn’t realize this until 16 hours later wondering why I wasn’t getting my mail, and digging into my scripts, evaluating line by line, I finally got the above error.

New Screenshot tool: Flameshot

Flameshot is an excellent new screenshot tool to replace Spectacle, the default KDE tool that served me for years until the latest round of software updates. Suddenly out a screenshot utility for my exwm setup, Flameshot more than impressed me with its rapid editing functionality in addition to the nuts-and-bolts screenshots. Then implementing it into my exwm and binding to my printscreen key was easy: (exwm-input-set-key (kbd "<print>") (lambda () (interactive) (start-process-shell-command "flameshot gui" nil "flameshot gui")))