4 ms·
This is neat, and there's a lot of interesting comments and pointers elsewhere in these comment threads. What I've been doing (for the last 25 years or so) is
by Diederich 9y ago
This is neat, and there's a lot of interesting comments and pointers elsewhere in these comment threads.
What I've been doing (for the last 25 years or so) is simple. I always keep a window open, visible in all virtual desktops, on the bottom right of my screen, with: vi ~/notes/notes
For somewhat less than the last 25 years, ~/notes is an encrypted git repo. I have a cron that, minutely, adds, commits, pulls and pushes to a couple of my servers on the Internet.
I generally have one of these for each company I work for, and another one that I've used for all things personal.
- perryprog 9y agoDo you have code for this on GitHub?
- Diederich 9y agoThere's really not much involved. For the encrypted git repo, I use this: https://github.com/AGWA/git-crypt https://github.com/AGWA/git-crypt The cron points to a shell script: #!/bin/sh cd ~/notes git add -A . git commit -am wip git pull git push So with that, I have the same directory, ~/notes/ syncd on all of my computers automatically, as long as I don't do conflicting edits within the space of a minute, which has never happened.
- nastygibbon 9y agoThis looks interesting. I'm going to assume that you add whatever temporary buffer you use while editing the files to your gitignore? E.g. Vim will use .swp files. Does this get annoying if you want to commit something specific? Let's say you edit an old note and save the file. Then, in the time it takes for you to write a commit about this new edit, your cron script has added your change as a 'wip'. Also, is there a nice way to set this up with a cron script so that you can use git via ssh (rather than https) but still keep a passphrase on the key? I seem to remember having problems with cron and git regarding ssh keys.
- Diederich 9y agoYes, I always have .sw? at the top of .gitignore. I never do manual commits here; every single commit is always 'wip'. I'm basically not using that feature of git. I'm just using it for (dumb) history/backup and distribution. I always setup the git repos with ssh, not https. The central (for each environment) git repo is a bare checkout on my personal account on a linode or tektonic VPS. In short, since I can ssh from my various client machines to these central servers with no password, the git pull/push just works.