How To Make A Todo App With Erlang

󰃭 2024-12-08 | #erlang #web

Todo apps, despite being cliche, are great learning projects. They can exemplify a basic CRUD web app architecture with a minimal amount of code. For years, I’ve felt Erlang was a little heavy handed in making small web projects compared to other ecosystems. Now, through some effort of my own, Erlang has the tools to make a competitive developer experience for making web applications.

This post will assume a basic understanding of Erlang and Web applications in general. By the end, we will have built a web JSON API backend to a todo application. Since frontend doesn’t have much to do with Erlang, and security is a bit too complex for the purpose of this post I am explicitly leaving all of that out.

Continue reading 


Run a FreeBSD VM Locally

󰃭 2024-11-20 | #freebsd

For a while I gave FreeBSD a good run as my daily driver on a laptop, but due to hardware support I eventually grew tired of it. I needed a dongle for everything. The real disadvantage being the wifi driver was just slow. Laptop support for FreeBSD has a way to go. I am happy to see the FreeBSD Foundation is taking this seriously as something they want to actively improve. In the meantime, I would recommend FreeBSD on hardware for a standalone PC and an Ethernet connection. If you don’t have that option like me, you can run FreeBSD in VM on your local machine. This post will go through the basic steps to get that working. I did this on a Debian machine, your results may vary for other distro’s.

Continue reading 


erlpic

󰃭 2024-11-03 | #c++ #camera #erlang #opencv

Lately I’ve been interested in learning about satellites and got inspired to make a simple IoT project. I can’t make my own satellite, but I could at least make a device to take periodic pictures. My idea was that since I’m not up to see the sunrise I would have this bot take pictures out my window in the morning. This project turned out to be both easier and harder than I initially thought, and it was fun learning experience.

Continue reading 


How To Send and Receive Patches Like A Hacker

󰃭 2024-03-31

For the hackers who study the blade, the preferred method of collaborating is with email patches. Both git and email are decentralized. Git was initially designed around the idea of emailing patches. Then, the GitHub empire introduced the world to PR’s. Now, it dominates the way developers think about collaborating. The hacker art of email patches has nearly been wiped out. This blog post is meant to help other developers revive the lost art. More seriously, this is a workflow I have figured out while using SourceHut. In my experience, most blog posts focus on sending git patches while leaving receiving patches an exercise for the reader. In this post, I will dive into how you can use himalaya, the email client, to quickly receive patches and add them to your git log like a true hacker.

Continue reading 


A Guide on Generating Erlang Forms

󰃭 2023-04-21

An advanced feature of Erlang is to write code that generates a module. This feature is possible because the Erlang standard library exposes functions that work with Erlang AST. Generating forms is different from Elixir, Scheme, or Clojure macros. However, honing this skill allows Erlang developers to generate code they don’t have to write themselves. This technique is in erlydtl templates, parse_transform, etc. This feature is powerful but has a learning curve. For example, while thorough, the docs on Erlang’s abstract forms are opaque. This blog post will break it down and make it easier to understand.

Continue reading 


Erlquery: Native Query DSL's In Erlang

󰃭 2022-12-14 | #database #dsl #erlang #query

The Problem: ORMs and Static String Queries

Dealing with static strings when writing queries for a database is annoying. Historically, people have reached for ORMs to handle this problem. ORMs can be very convenient. However, in my experience, there is always a mismatch between the ORM and DSL. You must drop back into the DSL when you want to do something that the ORM API doesn’t support.

Over time, I’ve come to embrace the DSL. If I’m using Postgres, then I’m writing Postgres SQL. If I’m writing SQLite, then I’m writing SQLite SQL. If I’m writing neo4j, then I’m writing Cypher. You get the idea.

Continue reading 


zkc: My Zettelkasten Utility

󰃭 2022-12-14 | #c #zettelkasten

One of the goals of zkc was to be faithful to the original text of Zettelkasten. Despite all the different writings of Zettelkasten, the original version will always be the best reference point. You can find an English translation here.

My summary of that text is that your note system has to be a completely flat hierarchy. Forget about a million nested folders. This system needs to be easily searchable and focus on communication. I’ll go into more depth about that later.

Continue reading 


Greetd + Sway + Alpine

󰃭 2021-06-21 | #alpine #greetd #linux #sway

In this post, I’ll go step by step on how to install and use greetd with Sway on Alpine Linux. The greetd project is fairly new so documentation is sparse. Hopefully, this will help others on their journey towards a lightweight and modern desktop environment.

While there are other greeters/login managers that might work. Alot of them depend on their respective desktop environment frameworks. For example, the Alpine package for gdm3 will install 200 dependencies. Assuming you haven’t installed gnome yet. Well, I’m not running Gnome. I’m running Sway. I don’t want all those Gnome dependencies if I don’t really need them. Unfortunately, those extra packages are the backbone of the current modern Linux desktop experience. This post is part of my journey at providing a modern feel, without all of that extra stuff.

Continue reading 


Setup Yggdrasil on Alpine Linux

󰃭 2021-01-29 | #alpine #linux #yggdrasil

I love to use Alpine Linux because it is small and efficient. However, one tradeoff is that not everything works out of the box like on say Ubuntu.

When I was experimenting with Yggdrasil I had no problem with Debian, but Yggdrasil ran into some issues on Alpine.

Luckily, this is easy to fix. It took more digging than I would’ve liked so here is this post.

All of the steps below assume you are running as root, so make sure you can get root access of the machine you are working with.

Continue reading 


Basics of LMDB with C

󰃭 2020-09-06 | #c #database #lmdb

LMDB is a neat embedded key value database. It stands for Lightning Memory-Mapped Database. It is useful for small applications where you don’t have to worry about schemas or relations. Think of the usecase where you might use a hashmap but you want the state to be persistent. LMDB is written in C and is even able to be linked with pkgconfig. A lot of times people use a wrapper, but I wanted to see what it was like to use this directly with C. It isn’t difficult, but I found basic tutorials hard to come by. So in this post I’ll show you to store and retrieve string key value pairs.

Continue reading 