· 9 min read

My Second Brain

A Decorative Image

Library Science is the key to all science, just as mathematics is its language – and civilization will rise or fall, depending on how well librarians do their jobs.

Robert A. Heinlein, Have Spacesuit, Will Travel

When a single brain is not enough

I remember, when I was a young whippersnapper fresh out of highschool, that vivid sensation of my brain being a sponge. Just pour knowledge into it, any type of knowledge - facts, formulas, the steps of disassembling a rifle - and it would just stay there. Get catalogued, cross-referenced, ready to sound off at the drop of a hat. Ah, youth…

A couple of decades (and sleep deprivations, and mind-altering substances, and life-altering meds) later, my brain feels more like a bucket with a hole near the bottom. Things are retained for a while, and some things are retained for an even longer while, but most days trying to “pick up where I left off” is not really an option because I. Just. Don’t. Remember.

A Decorative Image

To be absolutely frank, this is not really a recent development, although it did become worse after the chemo. The main culprit, I think, is my own young whippersnapper. There is really nothing like a few (hundred) nights of interrupted sleep to mess up your brain. When I pivoted into research two years ago, and started having new and exciting information poured into my bucket of a brain, I realized I needed help, something like another bucket to put underneath my leaky one. A second brain, if you will.

What follows is an elaboration on how I came up with my current system, some history, anecdotes from highschool and other fluff. If you are just here for the tips and tricks, feel free to hop to the actual tips section.

A Zettel in my Kasten

Around that time, a brainy friend of mine introduced me to the concept of Zettelkasten, an overclocked version of note taking. I won’t get into the particulars of the method here, mainly because there are much better resources online, and also because I’m not really well-versed in said particulars. As I often do, I skimmed some blogposts, installed Logseq, and immediately assumed I can figure everything out on my own. My first few months were a mess, the remains of which I sometimes encounter when browsing my current notes - trains of thought, interspersed with tasks and TODOs, useful commands and other bits and bobs. It didn’t do much for my research, my daily task management, or my learning process. I did introduce a couple of tags which I’m still using to this day (and on which I will elaborate later).

After leaving my job and starting a new learning journey, I once again defaulted to the regular note-taking method: now that I was taking more formalized courses, it made sense. I did, however, make some changes to better fit my own work process. As I was going through the cycle of reading -> writing down -> trying to apply what I've learned -> scrolling back to see how to actually do things, I began noticing small adjustments that could make things a bit easier for me. Since the cycle was often interspersed with extra steps like getting sick -> forgetting everything or even waking up with brain fog -> forgetting everything, the entire process was inching forward extremely slowly.

A Decorative Image

Working backwards

These days my brain fog situation is much better (owing to my body being rid of its silicon-based augmentation, and possibly of residual THC), which has allowed me to analyze my existing learning process, figure out the parts worth keeping, and getting rid of busywork. Up to that point, my system had only a couple of principles:

  • All the daily writing is done in a Journal format, with a new entry for each day.
  • Entries consist of hierarchical blocks, or bullets. The main bullet indicates the subject (HackTheBox/Android), then module, then whatever information I wish to write down, in any order.
  • Some entries get #tagged with one of a few tags:
    • #tools for when a tool is mentioned
    • #TIL for a command/factoid/one-liner I might want to go back to
    • Various tags for platforms, languages and other “categories”

A Decorative Image

The system was very simple and easy to apply, but at the end of the day it wasn’t much more than a glorified notebook, of the type you read and memorize once before an exam, then promptly forget everything. This was decidedly not what I needed.

Essentially, I looked at it from the tail end: once the notes are there, what do I do with them?

Question: What purpose do my notes serve after they have been written?

That’s been answered already: I write down things I learn so that I can refresh my memory when I need to apply that knowledge. I tend to forget the small-but-important things, like names of tools used for a particular purpose; I misremember commands and operators (is it xxd or xdd to encode in hex???); I usually miss a step if a process involves more than 4 of them.

A Decorative Image

Question: What prevents my notes from being as useful as they can be in serving that purpose?

Writing things down in my own words facilitates better understanding and retention, but not everything I write down is useful to the same degree. If my notes follow the structure of the module I’m taking, I end up with blocks of theory (i.e. what an information schema is in a DB) intermingled with blocks of useful commands (i.e. how to retrieve the names of all columns in a table using the information schema) and names of useful tools (i.e. what to use to automate SQLi discovery). In order to find the exact command I need to solve an exercise at the end of a module, I have to remember when I learned that command, scroll down to my notes from that day and look for something formatted as code, because that’s how I usually write down commands (as well as chunks of code, output examples etc.).

At this point, I was reminded of something from highschool. I was taking advanced maths and majoring in chemistry, two formulae-heavy subjects. Looking back, I was faced with the exact same problem: class notes would include important and useful information, sometimes spread out over several lessons, and intermingled with exercises and doodles, making it challenging to find the important parts. My solution was to make a separate notebook, with just the important parts. I’d take my class notes as usual, and then at the end of the day or the week I’d go over them, locate all the useful stuff, and write them into a small hard-backed notebook, taking the time to make it legible, color coded, illustrated where necessary. It was a hit! Half my classmates had photocopies of those notebooks. I kept them throughout, using them to refresh my memory when I was in Uni, and even started a new one for some new subjects, at least until I moved on to typing all my notes (yay for LyX!).

This was exactly what I needed now, with one caveat: I don’t want to do things twice. Since my studies are online and all the course information is already available and searchable, I don’t actually need the regular note-taking, other than for the aforementioned understanding and retention assistance. What I need is a system that would allow me to generate that “only the useful stuff” notebook on the go, within the Logseq framework.

“Only the useful stuff” - Logseq edition

The system needs to cover two processes - insertion of information, and its subsequent retrieval - such that the insertion is done in a way that supports the retrieval. Logseq has some convenient features for browsing and searching, as well as more elaborate querying:

  • Backlinks: The most basic hyperlinking tool. Type [[My Page]] to reference an existing page or to create a new one. A page can hold blocks of text, and a list of all blocks referencing the page.

  • Tags: Facilitate hyperlinks much like a backlink. Each tag has its own page, created automatically when you use it for the first time, simply by typing #MyTag.

  • Properties: A way to add metadata to a page. Type category:: MyCategory in a page to add a beautifully formatted metadata block. The categories can then be used in queries.

  • Queries: Searching content by tags, properties etc. For instance, finding all tools used for fuzzing:

Inserting

Following my existing principles, most of the content is typed in the daily journal, ordered hierarchically as indented blocks/bullets. Each block undergoes a triage of sorts, to figure out what tags it should get.

A Decorative Image

Suppose today I’m learning about SQL injection on HackTheBox. The first module talks about DBs in general, describing types of databases and the basics of SQL, including some command examples, and mentions a CLI tool called MySQL, used to interact with a DB locally. The next module dives into types of SQL injections, first in broad strokes, then with concrete examples and various payloads. Then there’s a module about automating the discovery process using SQLMap. My notes on this subject will look something like this:

A Decorative Image

Since SQLMap is a tool I expect to use in the future, I give it its own page with some properties:

A Decorative Image

Retrieving

Now that all the information is tagged and ordered, finding what I need can be done in a few very simple methods:

To quickly find a command I wrote down recently, I can go directly to the #TIL or #howto pages to quickly scroll through the Linked References section.

A Decorative Image

To find a command or a #howto related to a specific subject, I can use a query to include, for instance, all #howto blocks related to #XSS.

A Decorative Image

I can also use a query to find all tools with password bruteforcing capabilities, assuming both #passwords and #bruteforcing have been added as properties of the tools.

A Decorative Image

And since property-based queries yield such pretty table results, why not place a table of all tools and their uses on the #tools page?

A Decorative Image

So there you have it. Even though my tools got upgraded from paper and colorful pens to hypertext, markdown and queries, the basic need for a second brain has always been part of my life. I sincerely hope my system can inspire other leaky buckets out there to find their own system. Or just copy mine, I’ve been using it and I turned out OK…

Peace and love.