2024 Blogging Intentions
Later: In Praise of Small Shell Scripts
Earlier: Practices for Software Projects
I can't believe I haven't written anything here in over a year.
I increasingly want to move my experimental, art, hobby, and professional content away from platforms that exist to extract value from me and my friends. I'd also like to be less precious with this space, to treat it in the casual, experimental fashion I would treat Instagram or Facebook. So I'm going to be playing around with posting shorter posts, unfinished things, and worrying less about writing complete articles (like I did at times while traveling to the Pole).
This is partly inspired by recent efforts along somewhat similar lines by my friend Stephen Starkey.
Emacs, Continued
A few years ago I started using the static site generator Hugo for this site. I think that's still going reasonably well.
I use Emacs less than I used to, using VSCode for most programming tasks recently (because Copilot). But there are three things I still use Emacs for habitually:
Writing prose
Plain text is king, completely platform agnostic. And though I'm not sure why, I find it's actually nice to use a different platform for writing than for writing large amounts of production code.
Git operations
Magit is such a huge time saver. I typically commit and push code several, or dozens, of times a day – with Magit, these operations are streamlined to the point where they are essentially frictionless.
"Literate Devops"
Very often I want to record what I'm doing on some system in a
reproducible way without necessarily going through the process of
coding it up in a full-fledged infrastructure-as-code system like
Ansible, Terraform, etc. Often the main thing is to record my
intentions (see "Writing prose," above) and record the command-line
invocation required. Org Mode and Org Babel are great for this. I
also rely on yasnippet
to make this frictionless. Here, for
example, is the snippet I use to create a Bash command:
#+BEGIN_SRC bash :exports both :results pp replace :eval never-export :prologue "exec 2>&1" :epilogue "true" # Locally, on my laptop: ... actual shell command goes here ... #+END_SRC
This snippet is bound to the abbreviation begsh
: when I type that
prefix plus TAB
I get the above Org-Babel snippet inserted directly
at point. Then, to actually execute the command, typing C-c C-c
within the code block runs it and displays the results in the
document I'm writing.
Here's a slightly more complex snippet for executing code remotely on my Raspberry Pi 4:
#+BEGIN_SRC bash :async :exports both :results pp replace :eval never-export :prologue "exec 2>&1" :epilogue "true" :dir /ssh:4pi: ... actual shell command goes here ... #+END_SRC
In this case, C-c C-c
actually runs the command remotely, on my Pi, and injects the
results directly into the document, as before. The :async
option allows me to continue
editing elsewhere and wait for the results to be inserted when the command completes.
Future Work
It would be nice to make adding images easier. I still haven't solved the "post an image quickly or insert it into a document without friction" problem (one of the things Instagram accomplishes… along with a lot of extra stuff I wish they wouldn't accomplish). Ideally adding images would be a drag-and-drop kind of operation, and would handle any needed Bash, Emacs or Hugo operations automagically.
Summary
I'm trying to use a set of simple tools to make blogging frictionless and less precious… without indenturing myself to companies to whom I am the product.
Later: In Praise of Small Shell Scripts
Earlier: Practices for Software Projects