Fix Relative Paths in NodeJS Apps

Most NodeJS apps consist of hundreds of .js files which are included wherever needed using require. While this makes the dependencies of modules really obvious, most of the paths look like this in the end: const createUuid = require('../../../support/utils/create_uuid'); The problem is that by default NodeJS uses relative paths for local modules (not stuff that’s inside the node_modules folder). Not only does this look really strange, it’s also hard to read and if you ever want to move files around you have to fix all paths in your application to make it work again (and since this is lazily evaluated, you’ll probably miss some for code paths that are not tested).

Move Docker Volumes using rsync

I’m running a Docker host on a Hetzner Cloud server. Since my GitLab instance grew quite big, I bought some additional storage that’s mounted to the machine as a additional device. All my Docker stuff uses local volumes located in /var/lib/docker/volumes. The question now was: How to move those volumes to the new storage? Docker volumes are basically just subdirectories in a special folder. For some applications it’s important to copy over all the extended attributes and other metadata like permissions, ownership and change dates.

Creating a Fever API for Nextcloud News Part 1: Exploration / Mocking

In this series of screencasts I will create a Fever-compatible API layer for Nextcloud News, since I want to use this as my primary news reader. This API will be used to connect Nextcloud News to my Newsreader Apps on macOS and iOS. The API itself will be a separate application written in NodeJS that just uses the Nextcloud News database to query and write data. Later on I will probably create a Nextcloud App, but for now this series focuses on reverse engineering, functional programming and test-driven development in NodeJS.

byeCloud: Hosting Notes with Nextcloud

Notes, besides photos, are the pieces of data I care most about. I want to review them even after years, have them available on the go and make sure I never lose them. Up until now, I stored my Notes in iCloud alongside Apples Notes app. This article is part of the byeCloud series in which I try to replace iCloud with self-hosted services. The Apple Approach To Notes Initially, I wanted to retain this app and thought of going with IMAP Notes, which is what Apple does: They basically devote one IMAP folder to a list of mails with special headers.

Build a blog with Hugo I: Getting started

In this little series I’d like to show you how to set up a blog, or in fact any website, using Hugo, a static site generator written in Go. I’ve used many static site generators from Jekyll to Octopress but in the end I got stuck with Hugo. As a evidence for how awesome Hugo is you can have a look at this very site (just kidding), which is also built using Hugo.

Install Ubuntu on FreeBSD with byhve (Update Ubuntu 18.04)

For some reasons I needed a Linux installation on my NAS. byhve is a lightweight virtualization solution for FreeBSD that makes that easy and efficient. However, the CLI of bhyve is somewhat bulky and bare making it hard to use, especially for the first time. This is what vm-bhyve solves - it provides a simple CLI for working with virtual machines. The only requirement seems to be VT-x CPU support or whatever it may be called on AMD CPUs and ZFS as a file system.

Docker: MongoDB connection slow

I’m working on an application where I use Docker and docker-compose to orchestrate a NodeJS container running my backend and a MongoDB container for my database. Using Docker for Mac, I’ve seen drastic slowdowns when initially establishing the database connection. When I used a Linux host, everything was extremely smooth. Since Docker for Mac creates a xhyve-based virtual machine running a Linux with the Docker daemon inside, I initially thought that this is just the usual slow in-VM performance compared to running Docker natively on the host system.

Convert MKV to MP4 on macOS

I recently started to convert all of my movies from MKV to MP4. The main reason for this is that I want to be able to play back videos from all my Apple devices without the need for additional software, like VLC or IINA. For many people not that deep into video file formats I want to explain what the supported formats for video on macOS are and how to get there from almost any source material.

NodeJS: Interactive shell with hot reload

I’m currently working on a project in NodeJS. It’s an REST API server for a web application. Since it supports multi-tenancy but all tenants are created manually, I needed a quick and easy way to be able to call the createTenant method whenever I need it. I could have written a command-line tool that would do it for me, but actually I needed something like rails console for Ruby on Rails apps: A shell where I can just execute code in the context of my app.