5 ms·
I went through a bunch of note-taking apps before I settled on a git directory that's auto-synced once an hour. This bash script is all it takes. cd ~/no
by pkulak 2y ago
I went through a bunch of note-taking apps before I settled on a git directory that's auto-synced once an hour. This bash script is all it takes.
cd ~/notes
if [[ ''$(git status --porcelain) ]]; then
git stash save
git pull --rebase
git stash pop || true
git add .
git -c "user.name=Phil Kulak" -c "user.email=nope@kulak.us" commit -m "''$(date)"
git push origin main
else
git pull
fi
- darknavi 2y agoAnd sensible merge conflict resolution vs normal cloud saves.
- pkulak 2y agoYeah, every year or so I get a merge conflict, and then the whole things stops syncing and it takes me a week to notice before I go in and resolve it. It's not perfect, but I can't be assed to fix something that happens once a year. :/
- darknavi 2y agoMaybe you can beep the motherboard if it happens. Would only take a few hours to notice then :)
- tomsmeding 2y ago> it takes me a week to notice before I go in and resolve it Perhaps the `|| true` on the `git stash pop` could have a bit more handling :)
- mattstrayer 2y agohonestly love the simplicity of this
- dvt 2y agoAh yes, the classic HN Dropbox response :) On a more serious note, I'm not into note-taking apps as much as your average HN'er, but there's probably a business here. If anything, Obsidian has at least been wildly successful these past few years (my dad loves it).
- mike_ivanov 2y agoI'm doing the same with ZimWiki, except for running the sync script as a custom tool in the UI.
- bartvk 2y agoWhat about mobile? Or don't you take notes there?
- escapecharacter 2y agoFor me, this is always the gap that feels missing. - I want to take and view notes on various devices: mobile, personal computer, work computer, randomly logged in ad-hoc machine. - I want notes to not require me to be online all the time while writing (I work a lot on plans, or in remote locations without reliable internet) - I want notes to make reasonable assumptions about syncing, biasing on the side of avoiding data loss over the appearance of magically "just working" - I want to be able to search across all notes at the same time as any device's file system. Simplenote used to solve this. Then, recently, they started to become less reliable at the same time as having a very large subscription price increase. Apple Notes is now okay, but awkward to log in or sync with a non-Apple device. I tried having a bunch of .txt files synced via Dropbox, but while the Dropbox mobile app will let you view offline files, it won't let you edit them unless online.
- bobbylarrybobby 2y agois iCloud.com really that bad?
- insane_dreamer 2y agoit used to be; pretty decent now
- jen729w 2y agoBear is the app you need. It’s paid, your notes are in a database (easily exportable as .txt), but I’ve used it for years and years and it’s one of those rare apps that ‘just works’. And it’s something like $25 a year. Utterly reasonable.
- phero_cnstrcts 2y agoAll subscriptions are unreasonable.
- teaearlgraycold 2y agoWhy the two single quotes before the subshells?
- pkulak 2y agoOh, that's my bad. I copied this from my Nix config and that's how you escape. https://git.sr.ht/~pkulak/nix/tree/main/item/home/default.nix#L56 https://git.sr.ht/~pkulak/nix/tree/main/item/home/default.ni... https://git.sr.ht/~pkulak/nix/tree/main/item/home/default.nix#L121 https://git.sr.ht/~pkulak/nix/tree/main/item/home/default.ni...
- laurels-marts 2y agoBut what do you use to actually take the notes? After trying a bunch of apps I settled on VS Code with a custom Profile that has all the settings, extensions and UI states that I need for taking markdown notes. I realised that I already spend at minimum 8-10 hours a day in VS Code, why learn another app with all the different quirks, UI and key bindings...
- dv35z 2y agoI'm on a similar path (VSCodium + FOAM plugin, and then using MkDocs & Roam-links plugin to export as HTML). Can you share some of the VSCode plugins / settings / color schemes / etc which have been working well for you?
- pkulak 2y agoNeovim
- hu3 2y agoOften I need to consult notes on my phone, is there an app to comfortably browse and search notes in phone? Preferably offline with syncing. Today I use Joplin but it has custom file format.
- bgood456 2y agoI like markor
- khimaros 2y agoand git synchronization with MGit on Android
- nevf 2y agoClibu Notes is a note-taking and Personal Knowledge Management (PKM) app that works on desktop, tablet, and smartphone. Local first, fast with first class editing, backlinks etc. Simple, effective note taking, always accessible everywhere. See Clibu.com
- enasterosophes 2y agoTo this, it works well to add inotifywait to detect when files are saved. You can pipe the save detections to a loop that git-commits only that one file, providing a more granular history with very little cost.
- _wire_ 2y ago> if [[ ''$(git status --porcelain) ]]; then > ... "''$(date)" What is the purpose of the '' syntax?
- deleted 2y ago[deleted]
- pkulak 2y agoSorry. Nix. And it’s too late to edit.
- _wire_ 2y agoThx, just wondering if that was an arcane bash idiom. Very tricky to get anything useful from the web about ''.
- DemocracyFTW2 2y agoBash and Perl, where any number of punctuation marks in a row could plausibly mean something
- Diederich 2y agoI've been running this for about 15 years now: ddiederi@ddiederi-mac notes % while [ 1 ] do git add -A . git commit -am wip;git push;git pull sleep 6 done
- dotancohen 2y agoSame here. After going through different formats (Zim, Markdown, org-mode) I settled on org-mode and haven't looked back. I think that other note-taking systems only exist because whoever wrote them hasn't tried org-mode. I also use vdirsyncer with DavX to sync my phone's calendar and contacts to my notes directory, so that is backed up as well - all in the same syncing script. #!/usr/bin/env bash cp -a ~/.vdirsyncer/calendars/ ~/Notes/pim/ cp -a ~/.vdirsyncer/contacts/ ~/Notes/pim/ git add \* git commit -am "$(hostname)" git pull git push echo '' git status
- deleted 2y ago[deleted]