<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Digital Garden</title>
    <link>/</link>
    <description>Recent content on Digital Garden</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>© Axel Neergaard</copyright>
    <lastBuildDate>Mon, 09 May 2022 20:59:00 +0000</lastBuildDate><atom:link href="/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Design tutorials as opinionated usage guides</title>
      <link>/posts/21c980a4/</link>
      <pubDate>Mon, 09 May 2022 20:59:00 +0000</pubDate>
      
      <guid>/posts/21c980a4/</guid>
      <description>Back in the day, Smartly.io hired a lot of Flowdock (now defunct chat application, like Slack) employees back in the days, for example my manager. According to my understanding, this lead to flourishing usage of the Flowdock application. One of the, alleged, reasons for this was that those who had both designed and implemented the product were able to guide and educate other employees within Smartly on how to use the application to its fullest.</description>
      <content>&lt;p&gt;Back in the day, &lt;a href=&#34;https://www.smartly.io/&#34;&gt;Smartly.io&lt;/a&gt; hired a lot of Flowdock (now defunct chat application, like Slack) employees back in the days, for example my manager.
According to my understanding, this lead to flourishing usage of the Flowdock application.
One of the, alleged, reasons for this was that those who had both designed and implemented the product were able to guide and educate other employees within Smartly on how to use the application to its fullest.&lt;/p&gt;
&lt;p&gt;I have also noticed that I would gain a lot from an opinionated guide on how to use a program/application.
Right now, as I am working on my Master&amp;rsquo;s thesis, I&amp;rsquo;m using &lt;a href=&#34;https://www.zotero.org/&#34;&gt;Zotero&lt;/a&gt; for managing research.
Zotero allows you to take both notes separately from a document (which then can be mapped to other notes with a &amp;ldquo;related-to&amp;rdquo; relationship) or straight into a PDF (annotations and highlights).
Balancing these two features are a bit tricky, and I would love for someone at Zotero to explain to me how to &amp;ldquo;actually&amp;rdquo; use the program.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: I do realize that having an opinionated guide might result in some usage data being lost, as users are now following your guide more heavily.
This could be mitigated by presenting the usage guide as a &amp;ldquo;design document&amp;rdquo; where the core workflow is presented.
How to actually implement this is not something I&amp;rsquo;ve given enough thought.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Digital Garden</title>
      <link>/posts/digital-garden/</link>
      <pubDate>Sun, 31 Oct 2021 11:59:00 +0000</pubDate>
      
      <guid>/posts/digital-garden/</guid>
      <description>A digital garden is an intersection between a notebook and a blog.
 I use Neuron for my notetaking to keep my ideas/notes in a Zettelkasten. Sometimes I write stuff that could be nice to share, other times not. However, Neuron supports tagging notes, so I got the idea that I could simply tag those notes I would like to share.
I got to work and got something up with the following setup:</description>
      <content>&lt;p&gt;&lt;a href=&#34;https://joelhooks.com/digital-garden&#34;&gt;A digital garden is an intersection between a notebook and a blog&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;I use &lt;a href=&#34;https://neuron.zettel.page/&#34;&gt;Neuron&lt;/a&gt; for my notetaking to keep my ideas/notes in a &lt;a href=&#34;https://zettelkasten.de/&#34;&gt;Zettelkasten&lt;/a&gt;.
Sometimes I write stuff that could be nice to share, other times not.
However, Neuron supports tagging notes, so I got the idea that I could simply tag those notes I would like to share.&lt;/p&gt;
&lt;p&gt;I got to work and got something up with the following setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Neuron can query your notes for tags with &lt;code&gt;--tag&lt;/code&gt;.
&lt;ul&gt;
&lt;li&gt;There also exists a Docker image for neuron.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt; is a static site generator that I&amp;rsquo;ve wanted to try out for a while.
&lt;ul&gt;
&lt;li&gt;I&amp;rsquo;ve been eyeing the &lt;a href=&#34;https://themes.gohugo.io/themes/hugo-theme-terminal/&#34;&gt;terminal&lt;/a&gt; theme for a while.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://python-markdown.github.io/&#34;&gt;Python-Markdown&lt;/a&gt; has a &lt;a href=&#34;https://pypi.org/project/markdown-full-yaml-metadata/&#34;&gt;plugin for reading YAML metadata of Markdown files&lt;/a&gt;.
&lt;ul&gt;
&lt;li&gt;Use this to manipulate Neuron metadata into something compatible with Hugo.&lt;/li&gt;
&lt;li&gt;Wrote a &lt;a href=&#34;https://themes.gohugo.io/themes/hugo-theme-terminal/&#34;&gt;Python script&lt;/a&gt; to do this.
&lt;ul&gt;
&lt;li&gt;Reads Neuron query data from &lt;code&gt;stdin&lt;/code&gt; and manipulates metadata.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/c00k133/ansible/blob/a82050eaaf9e8d5311f3882f045bfc3fc48fea52/digital-garden.yml&#34;&gt;Deploy everything with Ansible&lt;/a&gt;.
&lt;ul&gt;
&lt;li&gt;Automation would be great in the future, but since I sync my notes with &lt;a href=&#34;https://syncthing.net/&#34;&gt;Syncthing&lt;/a&gt; for realtime reading between my devices I&amp;rsquo;ll have to find a file watcher.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Source code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/c00k133/ansible&#34;&gt;Ansible for my server on GitHub&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/c00k133/digital-garden&#34;&gt;Digital garden on GitHub&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Limitations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No easy automation as of now.&lt;/li&gt;
&lt;li&gt;This setup does not support &lt;a href=&#34;https://neuron.zettel.page/linking&#34;&gt;Neuron zettel links&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
</content>
    </item>
    
    <item>
      <title>Troubleshooting NixOS and ZFS</title>
      <link>/posts/nix-zfs-space-issue/</link>
      <pubDate>Fri, 22 Oct 2021 20:50:00 +0000</pubDate>
      
      <guid>/posts/nix-zfs-space-issue/</guid>
      <description>Incident on 21/10/2021. NixOS ZFS partition on laptop reported 0 available bytes on all pools.
Teardown:   Tried to setup Android Studio with emulator capabilities on my NixOS machine
 Installed a bunch of packages. Nix the package manager sucks up a lot of storage if not properly scrubbed. Installed and built so much on my machine that suddenly nothing worked anymore.    du reported 100% full on everything.</description>
      <content>&lt;p&gt;Incident on 21/10/2021.
NixOS ZFS partition on laptop reported 0 available bytes on all pools.&lt;/p&gt;
&lt;h2 id=&#34;teardown&#34;&gt;Teardown:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Tried to setup Android Studio with emulator capabilities on my NixOS machine&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installed a bunch of packages.&lt;/li&gt;
&lt;li&gt;Nix the package manager sucks up a lot of storage if not properly scrubbed.&lt;/li&gt;
&lt;li&gt;Installed and built so much on my machine that suddenly nothing worked anymore.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;du&lt;/code&gt; reported 100% full on everything.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Started getting so weird that my command line prompt started printing random stuff since it couldn&amp;rsquo;t create a &lt;code&gt;tmp&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;I could not collect garbage with &lt;code&gt;nix-collect-garbage&lt;/code&gt; since it couldn&amp;rsquo;t create a lock file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rebooted the machine, wrong call.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Most services enabled at boot reported failure to start.&lt;/li&gt;
&lt;li&gt;Got to login screen.
&lt;ul&gt;
&lt;li&gt;Non-existent users very denied entry.&lt;/li&gt;
&lt;li&gt;Existing users (&lt;code&gt;root&lt;/code&gt; and my &lt;code&gt;cookie&lt;/code&gt;) passed the login, but due to no available space were thrown back into a login.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Troubleshooting with built-in tools.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Laptop firmware settings unable to help.&lt;/li&gt;
&lt;li&gt;Lenovo has SMART tools available.
&lt;ul&gt;
&lt;li&gt;Did not report hardware error on disk.&lt;/li&gt;
&lt;li&gt;All &lt;a href=&#34;https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes&#34;&gt;SMART attributes&lt;/a&gt; seemed in order.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Nikola flashed a USB with an ISO of NixOS.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Able to access a command line with my system.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;smartctl -a/x&lt;/code&gt; confirmed no hardware errors present.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Also tried to use&lt;/em&gt; &lt;a href=&#34;https://www.finnix.org/&#34;&gt;Finnix&lt;/a&gt;, &lt;em&gt;did not assist me due to too old built-in version of ZFS (v23 vs v28 on Nix).&lt;/em&gt;
&lt;ul&gt;
&lt;li&gt;Thought NixOS wouldn&amp;rsquo;t have tools for ZFS, but both &lt;code&gt;zpool&lt;/code&gt; and &lt;code&gt;zfs&lt;/code&gt; are available.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tried to get access to my ZFS pool (&lt;code&gt;rpool&lt;/code&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Imported all ZFS pools available.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Loaded encryption keys for pool.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Mounted dataset through &lt;code&gt;mount&lt;/code&gt; as datasets were of type &lt;code&gt;legacy&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;zpool import -a
zfs list -a
zfs load-key -a
mount -t zfs rpool/home /mnt/rec
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Attempt to backup &lt;code&gt;/home&lt;/code&gt; to external drive.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;70GB of data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;External drive was connect with USB, so extremely slow.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Learnt that &lt;code&gt;cp&lt;/code&gt; does not have an internal mechanism for progress report.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can, however, get the &lt;code&gt;cp&lt;/code&gt; process ID and then watch the opened files and object reference from &lt;code&gt;/proc/&amp;lt;id&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pgrep -x cp            # -x gets exact and only the ID
cat /proc/&amp;lt;id&amp;gt;/fdinfo  # gets object reference
ls -l /proc/&amp;lt;id&amp;gt;/      # lists open files
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Due to enormous write size (and impatience) the external (NTFS) drive&amp;rsquo;s MFS got corrupted due to lazy &lt;code&gt;umount&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tried to salvage with &lt;code&gt;ntfsfix&lt;/code&gt; on NixOS command line, no success.&lt;/li&gt;
&lt;li&gt;Final option is to use &lt;code&gt;chkdsk&lt;/code&gt; on a Windows machine, but that can take around &lt;a href=&#34;https://qa.social.microsoft.com/Forums/windows/en-US/f363af20-da4d-4b8a-b0ae-df08a52c5d5a/disk-error-and-chkdsk-execution-time?forum=whshardware&#34;&gt;8 hours per TB&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Attempt to garbage collect &lt;code&gt;rpool/root/nixos&lt;/code&gt; manually.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;nix-env&lt;/code&gt; allows for defining system profile.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Idea was to delete old NixOS generations to free up space.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nix-env -p /mnt/rec/nix/var/nix/profiles/system
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Failed again due to no disk space.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Started reading up on ZFS snapshots.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;ZFS snapshots do not take storage space before something changes on disk.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;My machine has automatic ZFS snapshots by a monthly, weekly, daily, hourly, and &amp;ldquo;frequent&amp;rdquo; cadence.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;THEORY&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Due to the snapshots running in the background all of the referenced storage from &lt;code&gt;zfs list&lt;/code&gt; reported the full size.
&lt;ul&gt;
&lt;li&gt;Referenced storage &lt;a href=&#34;https://docs.oracle.com/cd/E27998_01/html/E48433/shares__space_management.html#shares__space_management__referenced_data&#34;&gt;&amp;ldquo;represents the total amount of space referenced by the active share, independent of snaphost &amp;hellip; the share would consume should all snapshots be destroyed&amp;rdquo;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Thus deleting files didn&amp;rsquo;t report more available space.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Deleted some of the newer snapshots to free 14.1 GB.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Deleting old generations now worked.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nix-env -p /mnt/rec/nix/var/nix/profiles/system --delete-generations 30d
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally able to login into system and GC.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Followed &lt;a href=&#34;https://nixos.wiki/wiki/Storage_optimization&#34;&gt;NixOS doumentation&lt;/a&gt; to GC properly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next steps are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;to implement the documentation steps for automated GC,&lt;/li&gt;
&lt;li&gt;setup proper backups to my server for critical files,&lt;/li&gt;
&lt;li&gt;invest in a proper harddrive that snapshots and larger files can be exported to.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</content>
    </item>
    
  </channel>
</rss>
