Drop #431 (2024-03-04): Mini-Monday

Today we have three bite-sized resources that are pretty diverse, so there should be something for everyone.

TL;DR

(This is an AI-generated summary of today’s Drop)

  • Daft Social: Introducing Daft Social, the “Anti-Social Social Network for Minimalists.” It offers a unique platform where users can post simple, constrained content directly via email without the need for passwords or account management. Images can be shared by providing a URL, and posts are limited to the subject line only.
  • Modd: Explore modd, a developer tool that manages daemons in response to filesystem changes. It looks for a modd.conf file in the current directory containing commands triggered by file changes. prep directives run and terminate commands like tests or compilers, while daemon directives keep processes running, suitable for tasks like starting databases or webservers.
  • PROMPT_COMMAND/precmd: Learn about PROMPT_COMMAND in Bash and precmd in Zsh, which run code before setting the prompt. These features are commonly used to customize prompts with information. Additionally, discover an innovative concept called Eternal Shell History that offers a unique approach to shell history management.

Daft Social

Blogging can be a super-heavyweight activity, especially if it’s in the context of a newsletter, and social media got pretty complex thanks to the incompetence of a billionaire, and an utter invasion by rightwingnuts on almost every platform. Video content can be a bear to crank out, and there are already too many podcasts in existence.

What if there was a way to go back to simple, constrained posts that do not require an app (not even a web app) that others can consume via direct introspection or RSS (like OG Twitter).

Enter: Daft Social, the “Anti-Social Social Network for Minimalists”. Its creators are all about simplification and reduction.

Your “client” is your email app, and they only accept posts that fit in the subject line (bodies are ignored). If you have an image you want to show the world, it has to have a URL, and you just need to provide the URL to it, and Daft Social will render it.

Signup is easy. You go here to claim a username, and it generates a random XYZ@daft.social email address. No passwords. No account management. And, no deleting. Just send an email to that addy and you can post away.

Here’s my nascent page there.

Read their FAQ, sign up, and (optionally) drop me a link so I can add it to my Inoreader RSS folder for Daft Social posts!

modd

Photo by Andrea Piacquadio on Pexels.com

We’ve covered devd back in 2022, but forgot to cover it’s sibling modd. We’re rectifying that mistake right now.

Fundamentally, modd is a “developer tool that triggers commands and manages daemons in response to filesystem changes.” On startup, it looks for a file called modd.conf in the current directory. These configuration files contain one or more blocks of commands, each of which can be triggered on changes to files matching a set of file (glob) patterns.

The modd directives serve two purposes:

  • prep directives will run and terminate the command. These are suitable for tasks such as running tests, linters, or even compiling programs. These are run in order of occurrence.
  • daemon directives execute and keep running. These are well-suited to firing up databases or webservers. When these blocks are triggered, the components that are running are sent a SIGHUP (this is changeable). They’re also restarted if the processes ever exit.

The devd utility used modd under the hood.

There are some examples to help get you started with this simple, yet powerful, filesystem watcher.

PROMPT_COMMAND/precmd

Photo by Engin Akyurt on Pexels.com

Many readers likely use or at least know about Bash’s PROMPT_COMMAND or Zsh’s [precmd](https://github.com/rothgar/mastering-zsh/blob/master/docs/config/hooks.md). They power many of the “cool” prompts you either see or use yourself.

If you aren’t familar with them, the TL;DR for them is that the code in them will run before the PS1 prompt is set. While this capability is often used to provide information that will ultimately go into PS1, you are not limited to just that functionality.

I came across this Eternal Shell History the other week and thought it was a pretty clever idea, and felt I should pass it on, if only to inspire you to come up with an equally clever hack or two of your own.

FIN

Remember, you can follow and interact with the full text of The Daily Drop’s free posts on Mastodon via @dailydrop.hrbrmstr.dev@dailydrop.hrbrmstr.dev ☮️