KBFS Scripts

kbfs-backup-revs (bash)

Make backups of all, or just the most recent, revision, of one or more KBFS TLF's (Top Level Folders).

Git Scripts

kbgit-backup (bash)

Make backups of all available Keybase git repositories. Uses git clone to download each repo for the first time, or git fetch to update the saved copy.

The backed-up directories will be usable as "working directories" if needed.

kbgit-backup-rsync (bash)

Make backups of all available Keybase git repositories. Uses rsync to download or update each repo's backup. This may be needed if kbgit-backup encounters errors, and may be useful if you need your backups to be "bare" repos instead of working directories.

The backed-up directories will be "bare" repos. They cannot be used as working directories, however you can git clone them to work with their contents.

kbgit-set-main (bash)

Check and possibly set the "main" branch of a Keybase git repo, i.e. which branch will be used if you git clone the repo without specifying a -b option.

The Keybase git software was written with the assumption that the main branch in every repo will have the name master. This is not always the case, and in fact many repos may not have a branch with that name. If you git clone such a repo without specifying a -b option, the command will fail and the files it will leave on your local disk will not be usable as a git repository.

This script will show you what the repo's main branch is, and can change it if needed. (I use this script to set my repos' main branches to main.)

HTML Scripts

make-index-html

When Keybase Sites started, the domain keybase.pub automatically served the contents of every user's /keybase/public/USER directory, and could automatically show a list of the files in a directory which didn't have an index.html file in it. It also had a way to host web sites on a domain which you own, but it doesn't generate index pages for directories which don't have them.

The service no longer uses the keybase.pub domain, but hosting pages using your own domain name still works. When the keybase.pub domain stopped working, I registered the domain jms1.pub and am using Keybase Sites to host the /keybase/public/jms1/ directory as the site.

I created this script to generate index.html files for directories which don't have them. If you're reading this on an https://jms1.pub/ page, you're probably looking at the script's output right now. You may also see a Makefile which lets me run make after updating files in or under the directory.