/postroll

Links to interesting posts and news articles

Age encryption cookbook

blog.sandipb.net

age is a low-cost, efficient encryption tool. I started using it with resurrect.wezterm, and occasionally need reminders of how it works. This post is a great resource!

Using Kanata to remap any keyboard

shom.dev

This blog post did a nice job of spelling out the different options in kanata, which helped me understand how to define my keybindings in a way that would help prevent me accidentally triggering them when typing rapidly.

Everything is Work When Neurodivergent

post.lurk.org

Post is a screenshot, pointing out that everything is work when you're neurodivergent:

  • sleeping regularly
  • keeping up with hygiene
  • maintaining friendships
  • taking care of basic needs
  • doing your job
  • creative output

Skill Regression Following Autism Diagnosis

www.instagram.com

A neuroscientist details why adults who receive an Autism or ADHD diagnosis and begin unmasking or receiving medication report skill regression. The gist is that we learn skills within a context. If that context is one where we are masking, when we start letting our mask drop, we lose the context, and have difficulty accessing the skill. The same goes for memories.

Home row mods

www.youtube.com

I've heard Chris Hartjes talk about home row mods a few times, but thought you needed a special keyboard for them. However, it turns out that there are a number of system programs you can use to enable them, including kanata (which I've installed on my machine). Still getting used to them, but the ability to stay in the home row for common things like navigating between workspaces on linux is definitely amazing!

The linked video walks you through what they are and how to set them up with Kanata, and links you to a github repo with the configuration, as well as the system services you will need to setup to enable them.

Setting Up Mastodon Author Tags

rknight.me

Basic gist is add the following in your <head>:

<meta name="fediverse:creator" content="@your_handle@example.org">

You can use text-wrap: balance; on icons

shkspr.mobi

The CSS directive text-wrap: balance can be used to ensure that when lines are wrapped, you don't end up with an absurdly short trailing line. (This was something I used to do manually in a past life when I did book and catalog layout at a small publisher.) Even better: it will work even if there are inline objects in the line, allowing you to wrap lines of icons.

The Truth About ADHD and Hyperfocus

mstdn.games

This is a stellar (and comic!) explanation of ADHD hyperfocus, its ebb and flow, and the impact on our lives.

Bash Strict Mode

redsymbol.net

I've known about the flags to make Bash behavior more strict or predictable, but this one adds an extra dimension for making iteration over strings more predictable as well. In a nutshell, strict mode is:

set -euo pipefail
IFS=$'\n\t'

Read the post for an excellent write-up of why each of these is important, and what each accomplishes.

The 12:12:12 Decluttering Challenge

www.apartmenttherapy.com

This article references a decluttering/simplifying recommendation from Joshua Becker, where you identify:

  • 12 items to throw away
  • 12 items to donate
  • 12 items to return to their proper place.

Discovering features using HTTP OPTIONS

evertpot.com

Evert has a nice write-up demonstrating the different headers and content you can return for an OPTIONS request, and how doing so can improve API discovery and usability.

Object Oriented Programming in Lua Using Annotations

betterprogramming.pub

Fantastic guide to creating class definitions in Lua, which turns out to be a prototype language similar to JavaScript. Demonstrates using annotations to specify visibility, and links to resources for annotations.

vim: five tips to become a more mediocre vim user

gbh.fruitbat.io

Some oldies but goodies for vim users. Most of these were ones I use regularly or at least knew existed, but reading the list and the write-ups of each served as a good refresher.

One note for neovim users: !! does not work in neovim. You have to use :read !{cmd}.

Luacheck list of warnings

luacheck.readthedocs.io

I have Luacheck configured with coc.nvim, and started paying attention to warnings it is emitting. In some cases, I've realized that while the warning is valid, I might need to ignore it. You can do this by adding a comment of the form -- luacheck: ignore {pattern}. The pattern is most succinct when you can use the Luacheck warning code... and this link lists all of them.

Changing port maps in Docker Compose

akrabat.com

Rob details how to override and remove values in a Docker compose file when using a compose.override.yml or extending a value/service.

To just override it:

- ports: !override
  - "8081:80"

This is necessary, as otherwise if the value is already present in the original, the two settings get merged.

To remove:

- ports: !reset []

Magento Cron via systemd timers | bitExpert

blog.bitexpert.de

Debian and Ubuntu are no longer shipping cron by default, and instead recommending setting up systemd timers. Stephan details how this is done, which requires both a systemd service file, and a systemd timer file.

The service file looks like this:

### Goes into /etc/systemd/system as a file with a .service extension
[Unit]
Description=Description of the service here
Wants=service-name.timer

[Service]
Type=oneshot
ExecStart=/path/to/executable/to/run/here
User=user-to-run-as
Group=group-to-run-as

[Install]
WantedBy=multi-user.target

You then create a timer, which is a systemd service defining a Timer section with an interval specified:

### Goes into /etc/systemd/system as a file with a .timer extension

[Unit]
Description=Executes every minute
Requires=service-name.service

[Timer]
Unit=service-name.service
OnCalendar=minutely

[Install]
WatnedBy=multi-user.target

The OnCalendar property can use "natural language" shortcuts like "minutely" or "hourly", or you can define date/time-based interval such as *-*-* *:*:00.

Once done, you need to start the service and enable the timer (usually as root):

systemctl start service-name.service
systemctl enable service-name.timer

and trigger it manually any time using:

systemctl start service-name.service

Prevent the Docker container from taking 10 seconds to stop

akrabat.com

Rob Allen details how the exec form of a Docker CMD is the better form to use. The reason the string form invokes bash first, and thus bash gets PID 1, which is what Docker will terminate when the container is terminated. The problem is that bash doesn't then send a termination signal to the actual process invoked, forcing the Docker host to wait 10 seconds before force killing all processes in the container.

Chesterton’s Fence: A Lesson in Thinking

fs.blog

There is an adage attributed to G.K. Chesterton called "Chesterton's Fence" that can be abbreviated to this:

Do not remove a fence until you know why it was up in the first place.

I've read this article after a number of recent articles decrying the idea of "Founder's Mode" and other crappy entrepreneurial beliefs, and it struck a note with me. So many "disruptors" do not stop to understand why things operate as they currently do: what does having a taxi license solve for the community? what do environmental regulations solve for ecosystems? what additional regulations do hotels and other commercial lodgings need to abide by to protect consumers and employees? etc.

Where Are Harris’s Policies? Trapped in the Supreme Court

newrepublic.com

A number of legal and political scholars are noting that the reversal of the Chevron deference has essentially made the US Supreme Court a super-legislative body, and will hamper any legislative advances Democrats might make, even in the case where they control the executive and legislative branches.

Wezterm Quick Select Mode

wezfurlong.org

Quick select mode in Wezterm allows you to identify patterns in the current visible screen; Wezterm then highlights each and provides a key to each allowing you to copy and/or paste the associated value. Activate it with Ctrl-Shift-Space.

As examples:

  • It matches sha1 and md5 values. Use these to match a git ref in a log so you can then inspect it.
  • It matches Docker container identifiers; use these to match a container identifier so you can run a command in it or copy a file from or to it.
  • It matches URLs; use it to identify a URL to pass to HTTPie.
  • It matches paths; use it to match a path to perform a file operation on.

gron

github.com

gron is a tool for working with JSON. It chunks things into key-value pairs where the key is a dot-separated hierarchy. This allows you then to use grep or ack to search for strings of interest.

It can also reassemble these back into JSON. This can be useful for adding or removing portions of a JSON structure. It becomes really interesting then when you pair it with jq in order to retrieve data back out.

As an example, I can get the list of development requirements from a composer.json with the following:

gron composer.json | ack "require-dev" | gron -u | jq '."require-dev" | keys[]'

(They'll still be in quotes, but that's easier to deal with than JSON keys!)

Use your own user @ domain for Mastodon discoverability with the WebFinger Protocol

www.hanselman.com

This was the article I used to allow using @matthew@mwop.net as my public fediverse account. Webfinger aliases it to the actual account I use, but this allows me to have a single, public address I provide, and gives me the option of future portability.

Finding Terminal Utopia

www.daveyshafik.com

Davey does a stellar job here of detailing a number of different tools he uses to cobble together an optimal terminal experience for himself. I personally found starship, eza, and fd to be great finds, and have incorporated them in my own terminal setup.

Library - A short story by Ben Brown

benbrown.com

Great short story detailing a library... but it's not what you think...