Hello World: Migrating to a High-Performance Stack
Photo by Florian Krumm / Unsplash

Hello World: Migrating to a High-Performance Stack

Welcome to the New derekmolloy.ie

I’ve finally made the leap. After years of running on WordPress, I’ve migrated my content to a Dockerised Ghost CMS instance running on a local home server, alongside a Starlight/Astro setup for my upcoming interactive book.

The goal? A faster, more streamlined experience tailored for technical readers.

The decision was driven by both security and simplicity. WordPress was becoming high-maintenance; between constant cyber-attacks on plugins and rising hosting costs, it was time for a change. My new Markdown-based workflow utilises Obsidian, allowing me to write on any machine and publish updates instantly.

Powered by the Sun: Beyond the technical perks, this setup is much more sustainable. My home runs on a solar array with battery storage, and we usually generate a surplus of energy—even with the Irish weather! By hosting my own site on the same server that manages my smart home, I’m able to keep my digital footprint as green as possible.

The site uses photographs from Unsplash and AI-generated image throughout. Where possible, all AI images are generated using local generation with ComfyUI, LM Studio and open local models, such as Ernie, Z-Image, Qwen, Gemma and Flux. Claude Code was used in building interactive elements with React and Tailwind CSS frameworks.

Starlight is a documentation framework built on Astro that achieves its high energy efficiency by reducing the weight of the data transferred and the processing power required by the user’s device. Starlight ships zero client-side JavaScript by default, converting components into raw HTML. This approach (aka "partial hydration") means that a user's device doesn't have to parse and executing heavy scripts. Asset optimisation and caching strategies mean that a typical page visit generates as little as 0.01g of CO2, making it cleaner than approximately 98% of all websites tested.

Testing C++ Syntax Highlighting

Since most of my work involves embedded C++ and Rust, let's verify that the code blocks render correctly. Here is a simple GPIO toggle using the libgpiod library:

#include <iostream>
#include <gpiod.hpp>
#include <unistd.h>

int main() {
    std::string chipname = "gpiochip1";
    unsigned int line_num = 18; // Example GPIO

    gpiod::chip chip(chipname);
    auto line = chip.get_line(line_num);

    line.request({ "Blink", gpiod::line_request::DIRECTION_OUTPUT, 0 }, 0);

    while (true) {
        line.set_value(1);
        usleep(500000);
        line.set_value(0);
        usleep(500000);
    }
    return 0;
}

Similarly, here is a Rust section of code:

// Derek's annotation:
// Ensure safe memory access at the edge
pub fn read_sensor_data(address: u16) -> Result<f32, Error> {
    let mut buffer = [0u8; 4];
    
    match hardware_bus.read(address, &mut buffer) {
        Ok(_) => Ok(f32::from_le_bytes(buffer)),
        Err(e) => {
            log_error!("I2C failure at node");
            Err(e)
        }
    }
}