A privacy focused note-taking and PKM setup
With an overwhelmingly increasing number of productivity tools and note-taking applications on the market, it has become increasingly difficult to settle on one particular application/workflow for taking notes. Over the years, I've experimented with a wide range of setups, from pen and paper to completely offline solutions like txt files, VimWiki, Zettlr and MarkText, Joplin and SaaS products like Roam and methods like Zettelkasten (which didn't work for my programming notes). For the past few months, however, I've settled on a simple workflow that I'll explain below.
First, let's look at the high level overview of what my notes consist of (yet). There are typically 3 kinds of notes that I take:
- Links (websites, go-to guides/articles/blog posts/lists online)
- Snippets of code or information (notes from books: programming + non-fiction, courses, MOOCs, mathematics, pieces of objective information)
- Temporary stuff (project ideas, short term todos, grocery list, scratchpad, etc)
For all types of notes, I like to use a lightweight markup language, namely Markdown, except math, where I use LaTeX/KaTeX. Markdown is supported by all major static site generators which makes it convenient to publish my notes to the web and learning Markdown takes virtually no time. Many static site generators now support MDX, an advanced version of Markdown that allows importing React components inside markdown files, KaTeX support, and other advanced extensions.
Secondly, here are the features I'm looking for in my workflow:
- I can edit notes quickly, ideally within a tmux pane on my terminal using Vim.
- I can sync and edit all my data across devices.
- My private notes must be end-to-end encrypted if on cloud.
I like collecting websites. As of now, there are more than 5000 websites in my collection.
For this, I have a bunch of markdown files in a folder with filenames matching the top level category that each website goes into. Inside each of those files, there are sub-categories and nested hierarchies of lists with more and more specific criteria for categorization.
I have a few bookmarklets, vim macros, and scripts that do the formatting for me. I wrote an addon that recursively exports a specific folder from my bookmarks on Firefox to properly formatted Markdown (Sidenote: I am working on publishing this addon with added functionality) and copy those links into whatever files they should go to. While browsing, I drag new websites to that folder on my Bookmarks Toolbar and at the end of the week, load the extension and export the data. Then, I push the updates to GitHub and use Travis to build the website (I use mdBook for this) and deployment is done via GitHub Pages.
Update: I have moved to Netlify for CI/CD.
I have always been a Firefox user. I use Firefox Developer Edition as my primary browser. For links that I'd rather not share with the world, I use Firefox Sync. There are multiple folders and hierarchies that I personally use to sort my bookmarks. For example, I use it to store:
- YouTube playlists + custom playlists (as opposed to YouTube's "Save to Library" and "Liked videos" features),
- Reddit threads/memes (as opposed to Reddit's "Save" feature,
- IMDb links (instead of IMDb's "Lists"),
- Twitter posts (instead of Twitter's "Likes"),
- Interesting Instagram profiles (e.g. @electricpants),
- Spotify/YouTube Music links
- Resources that I should check later,
- Other temporary links, tutorials to follow, etc.
This approach might seem time-consuming and unnecessary but as a privacy conscious person, I find it to be the best solution that aligns with my personal threat model.
This way, I don't have to log into big corporate websites to view something. I can store my data in as many nested folders and tags as I can think of, encrypted and synced across all my devices. This helps me minimize my digital footprint and leaves less amount of PII tied to big companies.
To export all my bookmarks to Markdown, I can use Firefox's Export Bookmarks to HTML feature and use a tool like pandoc to convert HTML to Markdown.
For links that I want to check out later on my laptop while on my phone, I use Pocket (This isn't open source, but it's owned by Mozilla and these folks seem to be more trustworthy than most other companies). I am thinking of eventually switching to a self-hosted alternative like wallabag. Some useful features of Pocket are Tagging and Export tool which allows me to import the links to Firefox with ease.
I also use Pocket as an alternative to YouTube's "Watch Later" and IMDb's "Watchlist" features.
Update: I have deleted Pocket and moved to Firefox for temporary links as well.
These consist of information I extract from reading (non-fiction) books, articles, watching YouTube videos, quotes, etc.
These notes consist small snippets of code, shell scripting and programming tips, Linux commands that I frequently use, IRC commands that I tend to forget all the time, etc. Essentially, these are little pieces of random information for personal use that aren't tied to me personally or summaries of books I read and that I think someone will benefit from reading.
This is where my most personal data and notes reside. I use an open-source note-taking service called Standard Notes for this. This provides automatic end-to-end encryption for my notes, free sync across my devices and the "Extended" tier has some nice features like code editor, vim mode, spreadsheet, etc. I open Standard Notes web in a new browser window when I am reading an information-dense piece on the internet or non-fiction books. It also has clients for Linux and other OSes. The free tier has all the core features. It is privacy focused, lightweight, has a simple intuitive interface and is a breeze to write my notes on.
On my phone, I use Standard Notes for both public and private notes that I can later sort out on my computer.
I manage highly sensitive information like recovery codes, paper keys, API keys, etc with KeePassXC - my password manager.
For this blog, I use Gatsby with
gatsby-transformer-remark gatsby-plugin-mdx and gatsby-source-filesystem plugins, among others, that allow me to read Markdown files from the filesystem and generate HTML pages. You can read more details on this here.
Update: I have moved my blog over to Next.js.
I use Standard Notes for these as well. A better solution for more ephemeral notes and todos would be something like Tasks.org or todo.txt but this just adds one more application to my setup. For temporary grocery list and stuff, I use the default Notes app that comes with my phone (in offline mode) and for long-term todos, I use Standard Notes.
In a nutshell, most of my notes are stored in Markdown files inside folders on my hard drive. I use Neovim to edit these notes and Git for version control and sync. I share some of them with the world. For private notes, I use end-to-end encrypted services: Firefox, Standard Notes, and KeePassXC. I use Firefox Sync to save and sync links that I want to read later.