Posts

SystemD devops run and restart services

Getting an app to redeploy as fixes and upgrades are uploaded to a linux server For most webapps I oversee it is desirable to have a mechanism in place not only for having them start when the server reboots, but also to restart the app when I need to deploy an update or (most recently) a fix to the application.1 This process requires sudo access2 and five files for a full redeployment system3:

converting text to pdf

Intro I keep a store of some of my emails as PDFs which I later have print and bound. So, what to do when some of those emails are sent in plain text instead of pdf format? Convert to PDF so they can be bound uniformly. From xmodulo1, there is a two-step process (after dependencies are acquired). Probably there’s a nifty way to do this in one-line, but I haven’t figured it out yet.

One-line CLI mail to multiple recipients with inline content

Intro I found a one-liner that allowed me to test the outgoing mail setup on a remote server. The following one-liner worked, and introduced me to some new-to-me functionality with Bash and Mail. mail -s "Testing Not registration confirmation" -r from@address.com to1@example.com,to2@example.com <<< 'testing 4' Analysis mail The command assumes that you already have a working Mail1 aka PostFix setup on the server you are running on, which means a sendmail setup.

guix xscreensaver issue: file does not exist

Intro Trying to have xscreensaver load my images, I am getting error: xscreensaver-getimage: file does not exist: "~/wallpapers/angels-phonebox.png" No amount of changing file names, user permissions, etc seems to be effecting this. However, it is obviously seeing that that image (and the others in the directory) ARE there; they should be working. Answer: don’t use a tilde ~ in your file path Local is already presumed, so just setting wallpapers as the directory, rather than “~/wallpapers”, did the trick.

How to use-package :custom with a variable in an alist?

Intro What I’m trying to do should be obvious from this code: (use-package undo-tree :custom (undo-tree-history-directory-alist '(("." . (concat user-emacs-directory "Undo"))))) But I had trouble getting the syntax right, since use-package is already performing some types of quoting at certain levels. Solution the key was in the proper locations of the syntax-quoote ` and splice , operators. The syntax quote was easy; just swap the reqular quote for it. The splicing operator appears in the location of minimal change, just before the function call that is going to use produce code based on an external variable.

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:

Cloister bell alert notification from Dunst in Guix

Intro In Guix with EXWM I use Dunst for a system alert system. I got my Dunst to have a default audio alert so that when alerts fire, regardless of which of my three monitors I am looking at, I can hear a modest alert noise. I chose the Tardis cloister bell1, a favorite audio of mine. 1. Acquire the sound I located the sound I want on Soundcloud1 and then used one of the several online SoundCloud downloaders2 to grab the file, which came down as an mp3.

project local PostGres on GUIX with Clojure JDBC (2022)

Intro 🖼1 There are several copy-pasted articles2 out there on setting up project-local postgres instances. Which one came first or whether they are both copies of another, I don’t know; but in any case, I found the goals good, and was enlightened by the concept. There are several technical errors, but they served to get the juices flowing. I am using the Postgres software version I got from GUIX, which is postgres 14.

Apache websocket setup

Intro The need was to make sure that our apache was able to communicate with our Sente1 Apache config To the apacheconfig, under the :443 section (https) # Trying websockets here, c/o RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule /(.*) ws://127.0.0.1:8080/$1 [P,L] RewriteCond %{HTTP:Upgrade} !=websocket [NC] RewriteRule /(.*) http://127.0.0.1:8080/$1 [P,L] # END websockets Server shell, enabling the apache modules /sudo:root@devflats:/ $> a2enmod proxy_wstunnel # Considering dependency proxy for proxy_wstunnel: # Module proxy already enabled # Enabling module proxy_wstunnel.

Why does this command not print sometimes?

Problem: emacs isn’t passing on the command output My command doesn’t write when it’s executed by a keystroke or by `M-x`, but it does when I just evaluate it with `C-x C-e`. Nonetheless, both command actually WORK – they just don’t print. Why? (defun tsa/change-volume (amount-str) (interactive) (shell-command (concat "pactl set-sink-volume 0 " amount-str)) (shell-command-to-string "pactl get-sink-volume 0") ; "Volume: front-left: 55865 / 85% / -4.16 dB, front-right: 55865 / 85% / -4.