💾 Archived View for benjaminja.info › log › 2024 › feed.xml captured on 2024-05-10 at 10:50:48.

View Raw

More Information

➡️ Next capture (2024-07-08)

-=-=-=-=-=-=-

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
  <title>Benjamin Jacobs | Log - 2024</title>
    <link rel="self" type="application/atom+xml" hreflang="" href="gemini://benjaminja.com/log/2024/feed.xml" />
    <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2024/" /><id>/</id>
  <updated>2024-01-01T07:00:00Z</updated>
  <generator>Hugo 0.125.4</generator>
  <entry>
    <title><![CDATA[If You Give a Hobbyist a Harddrive]]></title>
      <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2024/01/16-upgrading_server/" />
    <id>gemini://benjaminja.com/log/2024/01/16-upgrading_server/</id>
    <updated>2024-01-16T07:31:00Z</updated>
    <summary type="gemini"><![CDATA[I recently bought a 2TB hard drive for my home server. I use this server to host NextCloud and you can never have enough storage space. This server is an Inspiron 560s from 2008. It only has two hard drive bays and already has two hard drives.
]]></summary><content type="gemini"><![CDATA[I recently bought a 2TB hard drive for my home server. I use this server to host NextCloud and you can never have enough storage space.

This server is an Inspiron 560s from 2008. It only has two hard drive bays and already has two hard drives. There is however a dvd bay and a SD-card bay. The new hard drive fits just perfectly in the SD-card bay, so that’s its new home.

=> drive_door.jpg đź–Ľ Hard Drive Door

### The hobbyist will need to try out a new file system

A few months back, I watched a video about ZFS and was convinced to give it a try. The only problem is that it is pretty daunting to even think about trying out.

> There must be so much extra stuff that needs to be learned just to access the file system. Since ZFS is designed to work with other drives, will every drive be required to use ZFS?

These fears are not founded though. It is true that there is some extra software that is required in order to manage ZFS, but it is honestly so much easier than having to deal with parted, or fstab. All I needed to do to format and setup the new disk under ZFS was

zpool create MyPool sda


For me, the strongest selling point of ZFS is that it makes storage work closer to RAM. When running a program, I don’t need to specify which ram stick I want to have my software run in. It just figures it out for me. ZFS has this idea of pools where each pool is made up of one or more hard drives. When I put a file in the file pool, I don’t know which hard drive the data is going into, just that it is being taken care of for me.

I migrated a second 1TB drive in the server to ZFS and added it to my main pool. So instead of having 3 drives to manage, I have the boot drive, and a 3TB storage space.

### While they’re at it, the hobbyist might as well upgrade the OS

I haven’t updated the OS since I originally setup the machine in 2018. I’m running Ubuntu 18.04 and it has recently gone out of long term support. There are still 4 years left of security maintenance, but I figure since I’m working on the machine now, I might as well upgrade to a newer OS. I would like to try out Debian 12.

I backed up the main drive to my newly created pool and got ready to upgrade the OS. There’s nothing like some spring cleaning where you can get rid of the residue from all your weird decisions you made in the past 6 years and start fresh.

Creating the installation medium was my first hurdle. For whatever reason, I always have trouble creating an USB installer. I primarily use Mac as my daily driver and I’ve pretty much always relied on the Raspberry Pi Imager for Mac. With newer updates to the software, it feels like it is a lot harder to burn a USB stick with anything that isn’t Raspbian. So I switched over to my windows machine and I went through several programs trying to find one that will actually burn an ISO and make the drive bootable. I settled for Rufus.

I don’t know why, but no matter what I have tried I just can’t get the BIOS to recognize my USB. The machine is old enough that it doesn’t know what UEFI is, but the one time I was able to get the machine to recognize the drive was when it was formatted with GPT which should be UEFI only. I have spent hours making tweaks and re-imaging that poor USB stick to no avail.

### The hobbyist is ready to sleep now

At this point, it might be better to just give up for now. It’s not necessary that I upgrade the OS (In fact I foresee that it would cause more heartache trying to get everything up and running again from a fresh start). There are still several years left of support for the current OS and I got everything done that I was originally intending to do.

I’m really happy with how ZFS has turned out and I should just see how it goes moving forward. The next thing to figure out is how to get docker volumes to live in my pool. But that’s a problem for another day.
]]></content>
    <category term="projects" label="Projects" scheme="gemini://benjaminja.com/tags/projects/" />
    <published>2024-01-16T07:31:00Z</published></entry>
  <entry>
    <title><![CDATA[Rewriting my Site Generator]]></title>
      <link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2024/01/13-rewriting_site_gen/" />
    <id>gemini://benjaminja.com/log/2024/01/13-rewriting_site_gen/</id>
    <updated>2024-01-13T21:30:00Z</updated>
    <summary type="gemini"><![CDATA[It’s a new year and a new me. Now that I have finally graduated, I feel that I have more time to work on my side projects. One of the first big things I have done is rewriting my site generator once again.
]]></summary><content type="gemini"><![CDATA[It’s a new year and a new me. Now that I have finally graduated, I feel that I have more time to work on my side projects. One of the first big things I have done is rewriting my site generator once again.

=> gemini://benjaminja.info/log/2023/09/03-simple_site_gen/ Simple Site Generator

Rather than creating my own templating engine, I decided to use [tera].
=> https://keats.github.io/tera/docs/ tera

Keeping similar vibes to my original site generator: any additional features is implemented through shell scripts. There are a few important features baked in with the generator and all of the very site specific features are python scripts I created.

It is inspired by [kiln]
=> https://kiln.adnano.co kiln

> ~~but from all of my research it seems that the site has gone down as well as the repo that was holding it.~~

> Update 2024-01-16:

> It turns out that source hut was hit by a DDoS attack and kiln was part of the cross-fire. Everything seems to be back up now.

## Configuration

Here is a copy of my configuration file for https.

Specify file structure content = "content"scripts = "scripts"templates = "templates"output = "www/html"static = "static"# file types that will be rendered in content directorytemplate_types = ["md", "gmi", "html", "xml"]

Where the output will live on the web root = "/"# The base url name for the websiteurl = "https://benjaminja.info"# Any scripts to run before renderingpre = [

"proc/pretty-url.py",

"proc/tags.py", # tags script creates the tag system for my log"proc/pretty-url.py",

]

Any scripts to run after renderingpost = [

"proc/proc_html.py",

]

After rendering a file, convert it using the provided convert for each file # type[converters]

md = { ext = "html", cmd = ["gmi-conv", "-i", "md", "-o", "html"] }

gmi = { ext = "html", cmd = ["gmi-conv", "-i", "gmi", "-o", "html"] }


As an example of what a file might go through, I will show you how this file gets rendered.

Let’s say that I have the text

{% raw -%}

The site was rendered at {{ now | ftime(fmt="%B %e, %Y @ %r %:z") }}

{%- endraw %}


Here is the output:

> The site was rendered at {{ now | ftime(fmt="%B %e, %Y @ %r %:z") }}

First, the `pretty-url.py` script will be run which renames this file from `content/log/2024/01/13-rewriting_site_gen.md` to `content/log/2024/01/13-rewriting_site_gen/index.md`. After that the `tags.py` script will be run which adds this file to the `capsule` and `projects` tags. The `pretty-url.py` script gets run again for any generated files, then the rendering starts.

Since this is an `md` file, it will get rendered. After being rendered it will be converted to html using `gmi-conv -i md -o html`. (There is another configuration rendering to gemini). After it is converted, the file will be passed through several templates. To be specific:

1. `templates/logs/2024/_root.html` which adds the title, date, and mentions.
2. `templates/_root.html` which adds the base html boilerplate.

We’re not done yet, finally the `proc_html.py` script gets run. This will use beautiful soup to find any code blocks and adds formatting to it as well as differentiates gemini links as gemini links.

――――――――――――――――――――――――――――――――――――――――


I have two configurations running. One for html and one for gemini. I only need to write my capsule once and it will be rendered to both endpoints which is pretty nice.

## Making this Publicly Available

There are still a few oddities about the software that I’m not very happy with. I also want to add a bunch of documentation so that you can actually know how to use it. So I won’t be releasing my site generator until it is in better shape.

This software is probably a bit into the “You need to be a computer wiz to use this software” territory, but If I were to add some sane 3rd party scripts and some good tutorials, I think it might could be usable by an average person.
]]></content>
    <category term="capsule" label="Capsule" scheme="gemini://benjaminja.com/tags/capsule/" />
    <category term="projects" label="Projects" scheme="gemini://benjaminja.com/tags/projects/" />
    <published>2024-01-13T21:30:00Z</published></entry>
</feed>