<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Z Space Blog - Organization</title><link href="https://zlg.space/blog/" rel="alternate"/><link href="https://zlg.space/blog/feeds/t/organization.atom.xml" rel="self"/><id>https://zlg.space/blog/</id><updated>2024-07-16T02:35:00-07:00</updated><entry><title>Refactoring My File Hierarchy</title><link href="https://zlg.space/blog/refactoring-my-file-hierarchy.html" rel="alternate"/><published>2020-06-20T21:06:00-07:00</published><updated>2024-07-16T02:35:00-07:00</updated><author><name>zlg</name></author><id>tag:zlg.space,2020-06-20:/blog/refactoring-my-file-hierarchy.html</id><summary type="html">&lt;p&gt;When I returned to mkbak&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt; in order to give it better options for custom
backup naming, automatic date tagging, preservation of permissions, etc., I
noticed that I was writing complex and tricky rsync filter files. I ran with
this for a while -- and still have them as I write this -- but the problem
stewed in my mind. Something bothered me about the organization of the files
under my $HOME. Eventually, I felt there was a way for me to shorten my rsync
filter files &lt;em&gt;and&lt;/em&gt; reduce the stress I felt about my files. I just needed to
figure out what the core problem was. To answer that, we need to understand what
hierarchy's purpose is, or what its use introduces to your data.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;When I returned to mkbak&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt; in order to give it better options for custom
backup naming, automatic date tagging, preservation of permissions, etc., I
noticed that I was writing complex and tricky rsync filter files. I ran with
this for a while -- and still have them as I write this -- but the problem
stewed in my mind. Something bothered me about the organization of the files
under my $HOME. Eventually, I felt there was a way for me to shorten my rsync
filter files &lt;em&gt;and&lt;/em&gt; reduce the stress I felt about my files. I just needed to
figure out what the core problem was. To answer that, we need to understand what
hierarchy's purpose is, or what its use introduces to your data.&lt;/p&gt;


&lt;h1&gt;Establishing the Branch Points&lt;/h1&gt;
&lt;p&gt;Academics can give you a more elegant explanation, but I understand hierarchy
to be the way we divide and group objects of a type. Each split in the tree
should be a meaningful distinction between groups of data. This distinction then
facilitates easy browsing or finding of files. Of course, this is in theory,
and to a certain point of nesting. If you're drilling down 17 levels, maybe try
tagging! :P&lt;/p&gt;
&lt;p&gt;So, to start with my backup file lists were getting complex. I added
dot-folders, excluded cache folders and other transient files, made exceptions
for in-git config files or in-mkbak, and mixed the origins of the files I was
managing. That's when it hit me: I care about "I made this" or "someone else
made this". That was the first meaningful division in my refactor. I treat files
made by me as MUCH more important than those by others, though I still have
local git copies of a lot of software I use, and distfiles for everything else.&lt;/p&gt;
&lt;p&gt;Suddenly I noticed there was a lot to sort through. I had books and RFCs and
specs mixed in with my articles, notes, and Ledger journals. I had icons
mixed in with Pixel Art instead of being at the top level of Artwork. Some
directories, like my music, weren't clear "Am I allowed to have this file?"...
so there was another good distinction.&lt;/p&gt;
&lt;p&gt;Next, I remembered that some music albums, games, or even software was bought by
me, and due to the Copyright Act of 1976, one may keep a single archival backup
of media, but only for personal use to protect your purchase. That meant I
needed a place to put my dumped cartridges, Humble Bundle games, SoundCloud
albums, retail albums, etc.&lt;/p&gt;
&lt;h2&gt;A Brief Breakdown&lt;/h2&gt;
&lt;p&gt;By this point I had four "buckets":&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mine&lt;/li&gt;
&lt;li&gt;Others&lt;/li&gt;
&lt;li&gt;Disallowed&lt;/li&gt;
&lt;li&gt;Purchased&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I couldn't think of another distinction that was big enough to belong at the
top level, so I went with the four to start with.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Mine&lt;/strong&gt; tree covers files created or maintained directly by me. Stuff like
family albums, projects, artwork, prose, etc.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Others&lt;/strong&gt; tree is for files made by others that are legal to have a
personal copy of and/or are free to distribute in unmodified form. This includes
code repositories, software binaries of freeware, etc.&lt;/p&gt;
&lt;p&gt;Naturally, &lt;strong&gt;Disallowed&lt;/strong&gt; just shows me what I need to delete, or purchase a
copy if I liked it. Good to have separate. It was surprisingly much smaller than
I expected.&lt;/p&gt;
&lt;p&gt;Lastly, &lt;strong&gt;Purchased&lt;/strong&gt; is an attempt to catalog and account for my purchased
digital files, to prove their legitimacy.&lt;/p&gt;
&lt;h1&gt;Improving the Hierarchy's Usability&lt;/h1&gt;
&lt;p&gt;These initial groups already gave me insight into my file collection, but I
thought about further classification or "features" I wanted in my hierarchy. I'm
still shopping for a new OS; Where would I put VMs and their scripts? What about
WINE-compatible installer binaries? I also wanted a "scratch area" that would
store files that need to persist between boots&lt;sup id="fnref:2"&gt;&lt;a class="footnote-ref" href="#fn:2"&gt;2&lt;/a&gt;&lt;/sup&gt;, but aren't yet ready to be
added to the hierarchy.&lt;/p&gt;
&lt;p&gt;This part is actually much simpler for me, because I already organized my files
by their type. Well, generally anyway. This was an opportunity to improve it. It
wasn't that bad to basically swap directories around, rename a few things,
update a few configuration files... With each directory I had sorted, I felt
like the files were reaching a meaningful location for me that I didn't need to
think too hard about.&lt;/p&gt;
&lt;h1&gt;Enter GNU Stow&lt;/h1&gt;
&lt;p&gt;That's when it hit me: "Didn't I hear about some way to map or merge
directories, or manage symlinks?" I did, actually. &lt;a href="https://www.gnu.org/software/stow/"&gt;GNU Stow&lt;/a&gt; is exactly that:
you manage a set of 'packages' that roughly match up to directory trees and then
merge them into wherever you want, to make it appear as if the files from all
the others are in one place. &lt;em&gt;Exactly what I needed.&lt;/em&gt; As a bonus, you can setup
a given directory as STOW_DIR (I used /usr/local/stow) and then symlink your
packages from there, so you aren't needlessly copying files or moving dirs
around.&lt;/p&gt;
&lt;p&gt;As a test of GNU Stow, I took music that was freely available and music I had
purchased, which were in two different directories, symlinked to them in the
STOW_DIR, merged their contents with GNU Stow, then hooked that directory up to
real software to make sure it worked. Here's what it looked like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/usr/local/stow/
  ├── music_others -&amp;gt; /home/zlg/others/music/
  └── music_purchased -&amp;gt; /home/zlg/me/purchases/music/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then, I just ran a single command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;stow&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;/usr/local/stow&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;~/music&lt;span class="w"&gt; &lt;/span&gt;-S&lt;span class="w"&gt; &lt;/span&gt;music_others&lt;span class="w"&gt; &lt;/span&gt;music_purchased
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After that, I did an &lt;code&gt;ls ~/music&lt;/code&gt; and... son of a bitch, it worked! I
double-checked by opening ncmpcpp and updating the mpd database, which was
pointed to look at ~/music. The database looked the same as it did before.
Playing files worked as if the data was never split. That's what sold me on GNU
Stow's ability to produce the merged directories I'll need to pull off more fun
stuff with this hierarchy.&lt;/p&gt;
&lt;p&gt;The careful reader already knows there's a caveat coming: synchronization. How
does one keep them synced? The first solution that came to me is a cronjob that
runs stow with the &lt;code&gt;--restow&lt;/code&gt; (-R) flag:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;*/15 * * * * stow -d /usr/local/stow -t /home/zlg/music -R music_others music_purchased
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You would repeat this for each stow target you want to work with. Doing it every
fifteen minutes can be a bit too often for your use case. I used a five minute
interval during testing and it didn't seem to tax my system.&lt;/p&gt;
&lt;h2&gt;Tidying Up&lt;/h2&gt;
&lt;p&gt;With these changes and automation in place, I needed to go correct a bunch of
my existing symlinks to suit the new hierarchy. It was mostly manual work, but
with a few &lt;code&gt;find&lt;/code&gt; pipelines it was trivial to find the broken links. if I were
to repeat this, I would instead have a stow package dir containing symlinks
to other files, but with the filenames that I need in $HOME for everything to
hook up nicely. I'll need to test that case a little more, because the links
would need to be relative to the target directory instead of the stow package
directory. If I pull this off, I can name it 'integration' or 'homedir' or
something, and my dotfile management will be a solved problem.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;I'd be remiss if I didn't share the structure that I ended up with! I did
the vast majority of brainstorming in a neat piece of software called
&lt;a href="http://strlen.com/treesheets"&gt;TreeSheets&lt;/a&gt;. It was the first time I'd used this software, but I enjoyed it
quite a bit and will definitely use it for my next big brainstorming session.
Hierarchical spreadsheets are a wonderful idea!&lt;/p&gt;
&lt;p&gt;&lt;img alt="an exported PNG image of my Personal File Hierarchy" src="https://zlg.space/blog/images/pfh_ts.png"&gt;&lt;br&gt;
&lt;a href="https://files.zlg.space/s/eszExeFfJQaeBZH"&gt;Click to download the original TreeSheets file (.cts)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I'm quite pleased to have mostly solved my organizational stress problem. It's
relieving to know things are filed away in a sane and predictable manner. I'm
also happy to have another tool at my disposal that will save me time.&lt;/p&gt;
&lt;p&gt;Thanks for reading,&lt;/p&gt;
&lt;p&gt;-z&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;(mkbak is) A bash script that's a thin wrapper around rsync. It takes a
 single rsync filter list (to allow both including and excluding) and backs
 files up to a given location, preserving their permissions and mtime, etc.
 Maybe I will release it some time.&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Due to my living situation, I no longer run the desktop all day, to
 save on electricity costs. Thus, I needed some spare "scratch" space.&amp;#160;&lt;a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Software"/><category term="Organization"/><category term="GNU Stow"/><category term="TreeSheets"/></entry><entry><title>Zettelwhat?</title><link href="https://zlg.space/blog/zettelwhat.html" rel="alternate"/><published>2020-06-06T01:03:00-07:00</published><updated>2022-06-21T21:52:00-07:00</updated><author><name>zlg</name></author><id>tag:zlg.space,2020-06-06:/blog/zettelwhat.html</id><summary type="html">&lt;p&gt;I checked out the &lt;a href="https://zettelkasten.de/"&gt;Zettelkasten method&lt;/a&gt;, which appears to be German for
something like a box of (index) cards.&lt;/p&gt;
&lt;p&gt;The website for the method appears to be a marketing site, almost. It's not
simply and plainly spelled out for you what the method really is, and it lacks
clear, real-world steps and examples to get the most out of the method. I dug a
little and finally found the gist of it, being:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write a note on a card for a single topic&lt;/li&gt;
&lt;li&gt;Give it a permanent ID&lt;/li&gt;
&lt;li&gt;Link to this note from other notes, via this ID&lt;/li&gt;
&lt;li&gt;Maintain links via a master link list&lt;/li&gt;
&lt;li&gt;Use the link lists to form associations between knowledge&lt;/li&gt;
&lt;li&gt;(Multiple link lists may be used to map your knowledge in different ways)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The grand goal is to have a well of knowledge that you can, eventually, begin to
interact with and explore the limits of your own &lt;em&gt;documented&lt;/em&gt; knowledge, which I
think is an interesting distinction to make. One of the reasons we write notes
is to externalize information in a form we can recall later, to offset the
cognitive load of short-term memory. Then we only need to remember to come back
to our note(s) to be reminded of what we already know.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;I checked out the &lt;a href="https://zettelkasten.de/"&gt;Zettelkasten method&lt;/a&gt;, which appears to be German for
something like a box of (index) cards.&lt;/p&gt;
&lt;p&gt;The website for the method appears to be a marketing site, almost. It's not
simply and plainly spelled out for you what the method really is, and it lacks
clear, real-world steps and examples to get the most out of the method. I dug a
little and finally found the gist of it, being:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write a note on a card for a single topic&lt;/li&gt;
&lt;li&gt;Give it a permanent ID&lt;/li&gt;
&lt;li&gt;Link to this note from other notes, via this ID&lt;/li&gt;
&lt;li&gt;Maintain links via a master link list&lt;/li&gt;
&lt;li&gt;Use the link lists to form associations between knowledge&lt;/li&gt;
&lt;li&gt;(Multiple link lists may be used to map your knowledge in different ways)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The grand goal is to have a well of knowledge that you can, eventually, begin to
interact with and explore the limits of your own &lt;em&gt;documented&lt;/em&gt; knowledge, which I
think is an interesting distinction to make. One of the reasons we write notes
is to externalize information in a form we can recall later, to offset the
cognitive load of short-term memory. Then we only need to remember to come back
to our note(s) to be reminded of what we already know.&lt;/p&gt;


&lt;p&gt;So as a habit and idea, it's nice. But when you think about it, this is exactly
how a wiki works, minus the "write once, link forever" aspect of Zettelkasten.
It's also how you would more or less add tags to data in a well-normalized
database. You would implement it using a lookup table, like "genre_lookup"
below:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;      t_game                                          t_genre

+----+------------+                             +----+-----------+
| id | title      |                             | id | genre     |
+----+------------+                             +----+-----------+
| 3  | Beep Boop  |         genre_lookup        | 8  | Action    |
+----+------------+                             | 9  | Adventure |
  |                       +------+------+       +----+-----------+
  |                       | t_id | g_id |         |
  |                       +------+------+         |
  &amp;#39;---------------------&amp;gt; |  3   |  8   | &amp;lt;-------&amp;#39;
                          |  3   |  9   |
                          +------+------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This lookup table means 'Beep Boop' is Action/Adventure. (We should add Sci-Fi
too, but I digress. ;) If this were a Zettelkasten, it would be called "Game
Genres" and link games to their respective genres. It would just be in a less
verbose form, like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;game3 -&amp;gt; genre8, genre9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The exact field names aren't important, it's just an illustration. One could
have a convention for fields so you can fit more on one note. Something like
"capital G for game, lowercase g for genre" would be enough:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;G3 -&amp;gt; g8, g9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then if you really cared you'd look up g8 and g9 to find Action and Adventure. A
more pragmatic person would create a note that has the list of genres on it, and
update it (with permaIDs) as they go along in similar fashion. That way you only
look up one "note" to find all genres. Then our link card could be:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;G3 -&amp;gt; 8, 9
(see: genre_table)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then the 'genre_table' note would have a simple numeric list of genre names.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;This little mental exercise helped me conclude that Zettelkasten as a way of
approaching one's knowledge is interesting and maybe useful, but the tech is
more or less already implementable in traditional forms, like wikis, static
HTML, vim-wiki and org-mode, etc. Even Gophermaps can be "zettel". I think their
site could benefit from pragmatic, real-world examples of using this stuff and
a focus on how to apply the method to various media. There are apps for it, but
they all seem to have various warts, so it would be more wise to use extant
technology to try the method.&lt;/p&gt;
&lt;p&gt;Zettelkasten strikes me as a mindset or an idea rather than a method, because
it's not clear how long a zettel should be, if they should be edited or changed
over time, if links can be deleted or modified as you refine the knowledge base,
etc. An effective method has answers for these finer points, presented in a form
that's digestable in a single webpage instead of a series of blog posts waxing
philosophical about a method that amounts to tagging cards.&lt;/p&gt;
&lt;p&gt;Neat idea, but it talks itself up way too much. Just my two cents.&lt;/p&gt;
&lt;p&gt;-z&lt;/p&gt;</content><category term="Software"/><category term="Organization"/><category term="Zettelkasten"/></entry></feed>