Obtain a wildcard Let’s Encrypt certificate

Use the manual plugin and DNS challenge in certbot to obtain a wildcard Let’s Encrypt TLS certificate.

Subdomains only. You can only use this wildcard certificate on subdomains (e.g. www.example.com, mail.example.com). You cannot use it for the apex domain (e.g. example.com). Obtain a separate certificate for the apex domain.

$ certbot certonly --manual --preferred-challenges dns -d '*.example.com'

Create the TXT record as instructed by certbot. Before continuing, use dig
or Google’s Dig tool to confirm the records is applied.

$ dig txt _acme-challenge.example.com

Wait until dig shows that the record is applied. You may want to refresh/re-run it a couple times to ensure the record is updated on a few different servers.

Once you’re confident the record update is applied, press Enter to continue the certbot process and continue following the instructions it provides.

Use a graphical diff tool with Fossil

You can configure Fossil‘s gdiff command to launch your favorite graphical diff tool. Below are examples configuring some popular diff tools.

All the examples below include the --global option. If you want to configure this setting only for the current repository, omit that option.

Beyond Compare:

$ fossil settings --global gdiff 'bcomp'

Git:

$ fossil settings --global gdiff 'code --diff --wait'

vimdiff:

$ fossil settings --global gdiff 'vimdiff'

Visual Studio Code:

$ fossil settings --global gdiff 'code --diff --wait'

Resolve Fossil login failures after changing your password

After changing your password on a remote Fossil repository, you will receive login failures when trying to sync your local repository.

$ fossil sync
Sync with https://blachniet@example.com/test
Round-trips: 1   Artifacts sent: 0  received: 0
Error: login failed
Round-trips: 1   Artifacts sent: 0  received: 0
Sync done, sent: 420  received: 285  ip: 192.168.0.10

$ fossil commit
Autosync:  https://blachniet@example.com/test
Round-trips: 1   Artifacts sent: 0  received: 0
Error: login failed
Round-trips: 1   Artifacts sent: 0  received: 0
Pull done, sent: 446  received: 287  ip: 192.168.0.10
Autosync failed.
continue in spite of sync failure (y/N)?

The error occurs because your local repository is still trying to use your old password to sync with the remote.

To update the password in your local repository, run fossil sync <url>. When provided with a URL, this command will prompt you for a password. Enter your new password and instruct Fossil to save it.

$ fossil sync https://blachniet@example.com/test
password for blachniet:
remember password (Y/n)? Y
Round-trips: 1   Artifacts sent: 0  received: 0
Sync done, sent: 456  received: 305  ip: 192.168.0.10

Future syncs will use the new password.

Remove leaf and dependencies in Homebrew

A leaf in Homebrew is a formula that is not a dependency of another installed formula. You can list the currently installed leaves using the brew leaves command. See thoughtbot’s brew leaves post for more information on this command.

Removing a leaf in Homebrew can suddenly introduce many more leaves; the dependencies of the formula you removed. In this post I will show you how to remove a leaf as well as all its dependencies not used by any other formulae. These steps will work in Bash and Zsh.

Create a text file containing regex patterns for all the leaves. We’ll use this file later as input to grep.

$ brew leaves | xargs -I {} echo "^{}$" > leaves.txt

Edit leaves.txt, removing any that you want to uninstall.

Get the list of applications to remove, then remove them. Repeat this process until brew leaves | grep ... output is empty.

$ brew leaves | grep -v --file leaves.txt
gcc
$ brew remove gcc
Uninstalling /usr/local/Cellar/gcc/10.2.0_4... (1,465 files, 339.5MB)
$ brew leaves | grep -v --file leaves.txt
isl
libmpc
$ brew remove isl libmpc
Uninstalling /usr/local/Cellar/isl/0.23... (72 files, 5MB)
Uninstalling /usr/local/Cellar/libmpc/1.2.1... (13 files, 423.6KB)

Alternatively, you can perform the list and remove in one step:

$ brew leaves | grep -v --file leaves.txt | xargs brew remove
Uninstalling /usr/local/Cellar/mpfr/4.1.0... (29 files, 5.1MB)