Thursday, January 29, 2026
- Indigo macOS home automation software actions that are assigned to a
Trigger,Scheduledor web UI element are not executed sequentially. Design accordingly to avoid race conditions.
This is a running list of things that I’ve learned. Sometimes they are particular technical facts. I’m a neophyte in a lot of areas; so of these things will seem quite mundane. Sometimes they are more conceptual. Maybe someone will find them useful. Maybe that someone is my future self.
Trigger, Scheduled or web UI element are not executed sequentially. Design accordingly to avoid race conditions.When you run a script as a systemd service, you have to define its environment variables in the service filem, e.g.
# Set your environment variables here
Environment="OJISAN_INCREMENTAL_UPLOAD_API_KEY=YOUR_ACTUAL_API_KEY_VALUE"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_USER=your_db_user"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_PW=your_db_password"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_NAME=your_db_name"
Environment="DB_HOST=your_db_host"systemd running services as a listsystemctl list-units --type=service --state=running --no-pager
In Vim, to jump to a specific character on a line, you can use the following commands:
f{char} - Jump to the next occurrence of {char} on the current lineF{char} - Jump to the previous occurrence of {char} on the current linet{char} - Jump until (one position before) the next occurrence of {char}T{char} - Jump until (one position after) the previous occurrence of {char}For your specific example of “go to first #”:
f# to jump to the first # character on the current lineAdditional tips:
; - Repeat the last f, F, t, or T command in the same direction, - Repeat the last f, F, t, or T command in the opposite directionThese are extremely useful for quick navigation within a line without having to use arrow keys or other movement commands.
This was not obvious to me (or Claude.ai) - but search turned it up.
vG$d
Explanation
v enters visual modeG moves to the last line of the document$ moves to the end of that lined deletes everything selectedThis combination selects from the current cursor position all the way to the end of the document and then deletes it.
A couple of terms that deal with perceptual distortions and cognitive bias:
Pareidolia is a specific form of apophenia.
With oh-my-zsh, you can store custom aliases in multiple (?per application) file under .oh-my-zsh/custom giving them .zsh file extensions.1
¶For example, in my hugo.zsh file, I have:
alias hnewtil="/Users/alan/Documents/blog/ojisan/scripts/newtil.sh"
alias gtojisan="cd /Users/alan/Documents/blog/ojisan; ls -l;"It’s possible using the -c command.2
python -c 'import foo; foo.bar()'Unix shell scripting is not one of my better-know areas of programming, but it’s on my list of things to learn. Some interesting bits about the date function.1
date +"%A, %B %d, %Y"date +"%A, %b %d, %Y"#!/bin/bash
tz=$(date +"%z" | sd '(\d{2})(\d{2})' '$1:$2')
echo $tztz=$(date +"%z" | sd '(\d{2})(\d{2})' '$1:$2')
md_date=`date +"%Y-%m-%dT%H:%M:%S"`date +"%Y-%m-%d"In the UNIX shell, slurping the output of the command into a variable is done this way:3
OUTPUT=$(ls -1)
echo "${OUTPUT}"
MULTILINE=$(ls \
-1)
echo "${MULTILINE}"You can either append to a file or overwrite the contents from the shell.4
To append to a file, it’s echo "hello" >> file.txt whereas to overwrite the contents of a file, it’s echo "hello" > file.txt
| Function | Symbol |
|---|---|
| Append | >> |
| Overwrite | > |
This all pertains to the macOS flavour of the Unix shell. There are important differences, seemingly in the date function, for example. ↩︎
I should know what that format is called, but I don’t. I think it’s ISO 8601. Also, this requires sd. If you don’t have it, you’d need sed instead. ↩︎
Source - Stack Overflow ↩︎
Source - Stack Overflow ↩︎
W3schools.com has a CSS library that’s quite nice. I often use Bootstrap; but I like some of the visual features here better. For example, I like their tags because they have more flexible use of colour.
If you want to fetch from a Python dictionary, but you need a default value, this is how you do it:
upos_badge = {'noun': 'lime','verb': 'amber', 'adv': 'blue',}
badge_class_postfix = upos_badge.get(value.lower(), 'light-grey')I recently learned about DeepL as an alternative to Google Translate. It seems really good.