Hello again, Hugo

You'll notice that baty.net is back to using Hugo[1]. I really like Kirby, but every time I use a platform that's not fully static, I get twitchy, and I got twitchy.

I'm using a new theme, Anubis2, which I find to be easy to read and just the right amount of boring. It doesn't have all the features of the PaperMod theme I was using, but it's simpler, and simpler is what I was after.

I copied over all of the original Journal posts, but I don't know if I'll continue to treat those separately. I'm kind of digging how everything is just a post here. We'll see.

For years, I've been dragging around old broken images and image folders from various platforms, so I took the opportunity to fix as many of those as I could find. That was tedious, but felt good.

It was refreshing posting at copingmechanism.com for a few days, without years of baggage tagging along. In the end, though, baty.net is my home on the web. It's established. (A few) people know it and follow it. Better not to throw it all out on a whim, just because I was uneasy about it not being fully static.

Anyway, we're back. 👋


  1. For those keeping score, I was with Kirby for 34 days. ↩︎

Permalink #

Prevent Org-todo from messing with windows

When I have two Emacs windows split side-by-side in a frame, calling org-todo opened a full-width window at the bottom of the frame. This would be fine, but then when dismissing the selection window, it would wipe my previous window layout and I'd be left with a single giant window.

I found this to work:

(setq org-use-fast-todo-selection 'expert)

The default, I think, is "auto"

Permalink #

Self care

Sometimes what looks like selfishness is really just self care.

Permalink #

Sunday, February 2, 2025

I wasn't planning to put journal posts here. I don't like how they fill up the archives with a list of dates. Yet, here I am.


The news and my feeds have become a stream of terrible things. I don't know how to stop it, or how to help, or even how to survive it all. I feel helpless.


As much as I like how Kirby manages baty.net, I still can't get confortable not having a fully static website. I know it doesn't actually matter. Millions of blogs run on WordPress, Ghost, whatever. It's fine, but it bothers me and that low-grade annoyance takes a toll. That's probably why I'm here in Hugo again today.


I'm planning to leverage Flickr a bit more when posting to social media. My Mastodon posts aren't forever, so relying on a 3rd-party image hosting service is no big deal. Plus, I've been using Flickr since 2004, so I'm counting on Mr. Lindy[1].



  1. There is no Mr. Lindy, but that's what I'm calling the Lindy Effect here :). ↩︎

Permalink #

Zoxide and Fish Shell

I'm happy using Fish for my shell. One thing I'd not gotten around to after switching is finding a good directory jumper. The original z doesn't work well with Fish. I used to use fasd and autojump, but thought I'd look around for something new.

For some reason, I'd never heard of zoxide: A smarter cd command. Combined with zoxide.fish: Tab completion and initialization for zoxide in fish shell, zoxide does the job nicely.

Installing zoxide on macOS is simple: brew install zoxide.

Then I installed zoxide.fish using Fisher. fisher install icezyclon/zoxide.fish.

zoxide.fish automatically aliases cd as z so my muscle memory is still useful.

That's it. Now I can more easily jump around the file system in a terminal.

Permalink #

When everything is a Post

I've spent a lot of time over the past couple years forcing various blogging platforms to behave the way I want them to. That is: Daily notes grouped by day, with stand-along posts scattered between.

With this new blog and Hugo theme, I've forced myself to leave things alone (other than some CSS tweaks). It's a relief.

Everything is a Post, here.

If I want to publish something, it's a new post. I don't get to (or have to) decide where it fits. It's a Post. Short or long...it's a Post.

It's kind of liberating. I'll tire of it, but for now I'm enjoying the constraint.

Permalink #

Adding Pagefind search to Hugo

Pagefind makes me happy. It is a static search library that is so easy to configure and use that I can hardly believe it. Here's a quick summary of how I implemented Pagefind search here in the Anubis2 Hugo theme[1].

I first created content/search.md as content for the search page. In that document I pasted the default code from the Getting Started with Pagefind docs...

<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
<script src="/pagefind/pagefind-ui.js"></script>
<div id="search"></div>
<script>
    window.addEventListener('DOMContentLoaded', (event) => {
        new PagefindUI({ element: "#search", showSubResults: true });
    });
</script>

To build the search index, I run it via NodeJS like so:

npx -y pagefind --site public

That's it! That's all that is technically necessary. Running the indexer creates the index and puts the necessary support (css/js) files in public/pagefind/. Just deploy the site[2] and visit /search.

By default, Pagefind indexes everything in the <body> element. That's too much, so I added data-pagefind-body to the element containing only the post content in the "single.html" template.

<div data-pagefind-body class="content e-content">
   {{ .Content }}
</div>

For titles I needed data-pagefind-meta="title" in the <H1> element:

<h1 data-pagefind-meta="title" class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title  " " | markdownify }}</h1>

I put a little search icon in the navigation.All this took me less than 30 minutes. It's crazy.

I'm sure I'll tweak things further, but the out-of-box experience is pretty great.

Try it yourself.


  1. Pagefind works with any static website. I'm using Hugo here. ↩︎

  2. I also added the indexing step to my deployment script so that the index is always up to date. ↩︎

Permalink #

Links browser

Twibright Labs: Links

It's a Lynx-like web browser. I don't quite understand why I would want to use it for everyday browsing, but it's fun to see what sites look like without all the hubbub. Here's this site in links:

copingmechanism.com viewed in links
Permalink #

Book: Gaslit ★☆☆

An absolutely gripping psychological thriller packed with a twist you won't see coming

Do you know why I didn't see it coming? Because the narrator is not only unreliable, he's a liar. Also, things like, and I'm (barely) paraphrasing here, "Does she like me? I think she likes me!" What is he, 15? I was bored.

Rating: ★☆☆

Permalink #

Unplatform

I wish I could quit social media. This seems like a good cause:

The definitive guide for escaping social media (and joining the indie web.)

Unplatform

Permalink #

Erin Kissane on social networks

The evidence of the past decade and a half argues strongly that platform corporations are structurally incapable of good governance, primarily because most of their central aims (continuous growth, market dominance, profit via extraction) conflict with many basic human and societal needs.

source: Bad shape

Permalink #

Moving to Hugo?

I came this close to moving my blog at baty.net back to Hugo. Even worse, I considered archiving all the content and starting fresh. I mean, completely fresh. No more dragging around years of images and posts that have been converted to and from several Markdown formats for various blogging engines. I still may, but I've given myself a reprieve this morning. Sort of.

Instead of doing that, I've fired up a brand new Hugo blog here. I'm calling it "Coping Mechanism". Mostly because I still own the domain and it was right there.

I've chosen a new theme, arubis2, which is the just the right amount of boring. We'll see if it sticks. It doesn't support featured images, which I'm counting as a positive, since every Hugo theme handles them differently, and most don't do it well. If I want a featured image, I'll put it at the top. Cover images for decoration are a blight, anyway.

So here we go, I guess. A new playground. For now.

Permalink #

Fixing my duplicate email fiasco with rmlint in Maildir

Remember my recent email fiasco, during which I ended up with tens of thousands of duplicate emails? I remember it. After storming off and ignoring the problem for a week, I decided I should do something about it.

Today, I fixed it!

Actually, a post from Edd Salkield fixed it: Removing duplicate emails from an mbsync maildir.

Basically, the duplicate email files aren't exact duplicates. Each has a unique X-TUID header line. So we remove that line on every file in a copy of the mail store so we can use rmlint to find the duplicates. rmlint generates a script for removing the duplicate files. We run the script on the original mail store, which still has the X-TUID headers intact.

My Steps:

  • cp -r ~/Mail ~/Mail_backup # Make a full backup, just in case
  • cp -r ~/Mail ~/Mail-workingcopy # Make another copy to work with
  • cd ~/Mail-workingcopy
  • find ./ -type f -exec gsed -i -e '/X-TUID/d' {} \; # Strip the X-TUID header, which is the only differing line in otherwise duplicate files (Needed gsed on my Mac)
  • rmlint -g --types="defaults -ed -dd" # Run rmlint on working copy
  • Check the generated rmlint.sh file to confirm paths are absolute (mine were)
  • gsed -i -e 's/-workingcopy//g' rmlint.sh # Find and remove working copy suffix, making it the "real" path
  • mv rmlint.sh ../Mail/ # move the script into the real mail store
  • cd ~/Mail # get ready to de-dupe
  • ./rmlint.sh -x -n # Do a dry run of the script
  • ./rmlint.sh -x # Go!
  • mbsync -a # Sync with server (be sure that --expunge-far is set)

It worked for me. I may give it a second before trying the whole muchsync thing again, but it's good to know that if I foul things up, there's a way out of it.

Permalink #

Bringing Apple Passwords into Pass

I have a soft spot for Pass: The Standard Unix Password Manager, but Apple's new Passwords app has been working fine. I use Safari, so the whole thing is very convenient.

Sometimes I get twitchy about having things in only one place, so today I decided I'd like to import my Apple Password passwords into Pass. It took me a minute, so I'm jotting down some notes here, for next time.

First, install pass-import. Pass-import is "A pass extension for importing data from most existing password managers". There's a lot of Python going on, which always seems to trip me up, but thankfully there's a Homebrew recipe, so...brew install pass-import.

pass-import supports many password apps out of the box. It doesn't yet support Apple Passwords, apparently. It handles Keychain exports, but that's not what I needed. I used the generic CSV option.

I exported the passwords to a CSV file (pass.csv) from Passwords.app.

I ran a test pass import foo.csv command but got an error. The pass command didn't recognize the import option. After some digging, I learned that the Homebrew recipe installs a script named pimport. Confusing, but OK fine.

After much trial and error, this is finally the command that worked.

pimport  -o .password-store/ \   # where to import to
             pass \                  # destination format
             csv \                   # Source format
             pass.csv \              # Source csv file
             --cols=title,url,login,password,comments,otpauth \  # Map columns
             -p apple-import/        # put in subfolder .password-store/apple-import

Now I have a backup. I don't know of a way to do this incrementally, so I suppose I'll just delete the apple-import/ folder and redo the export/import once in a while to catch up.

Permalink #

An email fiasco

All I wanted was to use notmuch on my MBP to manage email, just like I do on my Mac Mini. The only viable solution I found was muchsync. There's no macOS installer for it[1], so I figured I'd compile it myself.

A few years ago I promised myself that if something required ./configure && make && make install I would skip it. Well, I really wanted to try it, so off I went. The make command failed immediately because it couldn't find notmuch.h. Great, path problems. After an hour of throwing things at the wall, adding some environment variables worked:

    export CPPFLAGS="-I/opt/homebrew/include"
    export LDFLAGS="-L/opt/homebrew/lib"

Cool. I built it on both Macs.

muchsync requires SSH access to the "server" machine, which was to be the Mini, so I figured I'd use the Tailscale IP. Not so fast. One needs to enable Tailscale SSH first by running tailscale set --ssh, so I did. Except that returned this:

"The Tailscale SSH server does not run in sandboxed Tailscale GUI builds."

Crap. I'd installed Tailscale from the App Store. I uninstalled it completely (not easy), and installed the standalone version. I confirmed it was the standalone version, but I still got the sandbox error. For the hell of it, I enabled "normal" SSH access on the Mini and for some reason was able to connect via SSH over the Tailscale IP. I've no idea why it worked, but after an hour of tripping over everything, I didn't argue.

I read the muchsync docs and still didn't quite understand how everything fit together, but the instructions said to do something like, where SERVER is the IP of my Mini:

    # First run
    muchsync --init ~/Mail SERVER
    
    # Subsequent runs
    muchsync SERVER

That took a while, but seemed to work. I had what looked like a copy of all my mail and notmuch DB in ~/Mail on my MBP.

The second run of muchsync SERVER took way longer than I expected, so I logged into the web UI of Fastmail and watched as duplicate emails poured in. What's worse, most of the emails in my account looked to have arrived at the same time, 9:15 AM, which was "now".

I obviously did something wrong. I re-read the docs, but couldn't figure out why it was happening. I changed a setting or two and re-ran muchsync several times. I also ran the usual mbsync -a on the Mini.

After all that, I ended up with four copies of most of my messages, and most of them were marked as unread. I used the unread status as an opportunity to delete the duplicates, since those were the only things unread.

I don't know why it happened, and I don't know how to fix it, but I wasted the better part of my day fighting with an email fiasco brought on simply because I wanted to read my email in a specific way on two machines.

This is why they invented IMAP. I should probably just use that.


  1. There is actually a MacPorts port, but I didn't want both that and Homebrew on the same system. Besides, there were over 200 dependencies, so nope. ↩︎

Permalink #

Journaling changes

Reading Jeremy's post about keeping his personal journal helped clarify some of the thoughts I've been having about mine.

Some Entries from My Personal Journal:

On Tuesday the 12th of November, 2024, I started what I hoped to be a new habit. That is writing a personal daily journal. Over the weeks, I expanded my aspirations to include a daily check list of activities I wanted to do.

I've been consistently keeping a personal journal for years. I write primarily using Org-journal, a Daybook.org file, and a paper notebook. My problem isn't that I don't journal enough, but rather that I can't decide where to journal.

I'll never give up paper notebooks, so let's not even consider that. I like how my brain feels when writing on paper. I love the resulting artifacts, too. Flipping through old paper notebooks is an experience that can't be replicated using digital tools.

However, I don't love writing by hand for too long. My hand cramps and I become impatient. I'm faster using a keyboard and it's easier. Also, it's much easier to read things I've typed :). Combined with the other benefits of digital, I doubt I'll ever give up my digital journals, either.

As for digital, my Daybook.org and my Org-journal files compete for attention. Sometimes I write an entry in my Daybook, then add a bunch of notes below it. Org-journal also gets longer notes, sometimes with very similar content. It's confusing.

I'm thinking I'll limit using the Daybook.org file to only include simple date-based headings that show up in my org-agenda as short, log-type entries. e.g. "Shoveled the driveway" or "Canceled my subscription to SomeApp". Org-journal will include more day-to-day narration, like "Went to grocery store for pop and coffee. I'm trying the local 'Rowsers' coffee for the first time." So, log-adjacent, but with more :). I'll think of it like this: Daybook is what happened, and Org-journal is about what happened and what I thought about it.

This means that my Org-journal will include a lot more mundane things from my day than it has been, but I think that's fine.

Permalink #

Vanilla to Doom to Vanilla

I'd been happily using Doom Emacs until just over a month ago, when I decided to start from scratch again.

It didn't take long before I started missing some of the niceties of Doom. I'm faster when using Doom/Evil, and sometimes it's good having things taken care of for me.

So, at the beginning of January, I switched back to Doom.

After a week using Doom, I was feeling pretty comfy. Too comfy, in fact. I couldn't shake the feeling that every Doom keybinding I internalized brought me closer to depending on Doom. It made me twitchy. Every time I typed something like SPC m a a or put a Doom macro like after! or map! in my configuration, I felt like I was spending time learning someone else's tool.

So, this morning I switched back to my vanilla config.

Now I feel better. I'm a little clumsier, and sometimes I wish I didn't have to do everything, but dammit it's MINE! 😄.

Permalink #