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.

Auto-add BCC address to notmuch/message-mode messages

I use GNUs for most of my email needs, but also have notmuch for rapid search of my inbox. Trouble is, when I choose a message in that notmuch search, it doesn’t open it with gnus but with its own message-mode spinoff called Message[Notmuch]. In GNUS I have an automatically added BCC address (my “sent-mail” inbox, which is downloaded across devices to sync what I’ve sent). How can I get the same automatic BCC added to anything I send in reply with Message[Notmuch]?

Helm-grep project refactoring: search and replace

With this you can readily search an entire project directory for some text, and then make whole-scale changes to any or all files containing that text. I assume you already have helm-projectile installed and you use it; if not, you’re missing out! First, install wgrep and helm-wgrep, for which I use use-package and my emacs.el init file: (use-package wgrep :ensure t :config (use-package wgrep-helm :ensure t)) Then, execute helm-projectile-grep for the text you desire.

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")))

Getting Twitter Media gif/videos to work

I was receiving the error “We cannot play the video in this browser. Please try a different web browser.” I noticed they worked in Chrome but not Firefox; in my experience this is because Firefox has some additional protections against non-free software that CHrome doesn’t care about. I identified that my browser was missing some codecs checking youtube and spotting the red-boxes under “what does this browser support?” Looking around I found this solution.

HP Printer disabled

Went to the cups interface (https://localhost:631) -> Printers -> TARDIS -> “Resume” I don’t know why it ended up paused. Trying all the system (non-cups) things to enable it, restarting many times, never fixed the problem.

Sweet Honeysql and Postgres

I thought I’d share a snippet of what I love about my HoneySQL + Postgres setup (this is plain Honey without the Postgres extras, which never seem to cover my needs). I don’t take any pride in the actual database model, which is in-use and was not well designed. Nonetheless, the two things that worked out nicely here are: table applications has a one-to-many relationship with validations, so PG’s “distinct on” was the perfect tool for just matching the most recent of an application’s validations.

Power Button management

https://www.reddit.com/r/i3wm/comments/58j1ui/how_to_intercept_the_power_button_to_avoid_brutal/ Note that you might want suspend instead of hibernate, if you want rapid resume. The power button isn’t handled by the window manager, it’s handled by systemd For example this is in my /etc/systemd/logind.conf [Login] HandlePowerKey=hibernate HandleLidSwitch=ignore IdleAction=suspend IdleActionSec=20min

Emacs multi-inbox Email Setup

I use the Emacs package Gnus (included in Emacs) to manage my email, and have used it this way for years. There are many reasons for managing your email locally, and even more for managing them in Emacs, but it took me years to make it through the obstacle course of actually figuring out how to do it. It requireed learning many new concepts that our day of webmail and Exchange-programs generally glosses over.

Extending HoneySQL with Array Intersection

Turns out that Postgres has beautiful support for “array” field types. In one database of mine, I use this to keep track of the recipients of emails: DROP TABLE IF EXISTS "email_log" CASCADE; CREATE TABLE "email_log" ( id SERIAL PRIMARY KEY, sender TEXT NOT NULL, recipients TEXT[] NOT NULL, message TEXT, sent_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, info JSONB); -- Note the recipients TEXT[] definition: that's an array of texts. Now for the use-case: a user might have multiple email addresses, and the email_log tracks recipient ADDRESSES not user-ids.