J
Conky is a lightweight system monitor that can display system statistics on the desktop. While it was originally built for X11, recent versions have added experimental Wayland support. Since I use GNU Guix and run a Wayland-based environment (Sway), I wanted to get Conky building with Wayland support. This post explains how I achieved that. Guix is a functional package manager that allows you to define software packages declaratively. Since Conky is not in the official Guix repository with…
J
For the past month or so, I’ve been running Guix system on my Framework laptop, turning it into what I like to call a modern Lisp machine. I have affectionately also started calling it a Legendary Lisp Laptop - LLL I chose the Framework Laptop 13,5" since it is big enough for me and it is really lightweight and portable. I mostly have external monitors anyway, at home and at work. Technical specifications # AMD Ryzen™ 5 7640U (up to 4.9GHz, 6-core/12-thread) Memory: DDR5-5600 - 32GB (2 x 16GB)…
J
Riastradh’s Lisp Style Rules Copyright (C) 2007–2011 Taylor R. Campbell CC BY-NC-SA 3.0 This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License: http://creativecommons.org/licenses/by-nc-sa/3.0/. This is a guide to Lisp style, written by Taylor R. Campbell, to describe the standard rules of Lisp style as well as a set of more stringent rules for his own style. This guide should be useful for Lisp in general, but there are [or will be in the final…
J
Note: There is a better way to go about this, Guix now contains rootless-podman-service-type which will take care of it all pretty much for you. This article is thus outdated, and explains how we did things before that! Thanks Hugo Buddelmeijer for alerting me to that, he wrote a blog post here: https://entropynaut.com/post/guixpodman/ Have you ever heard about Docker ? Containerization has revolutionized the way we deploy and manage applications. By isolating processes and their dependencies,…
J
Are you someone that enjoys Emacs and the amazing built-in package Eglot, which enables Emacs to provide intelligent completions and error reporting, linting, and more with language servers ? Are you ocasionally editing YAML files and would like to use JSON Schemas for YAML, get some feedback from Emacs, the right completions for a configuration file ? Almost a type system for YAML 💚 # Let me introduce yaml-language-server (easily installed from Nix too). By the way if you want to see advanced…
J
Ever had to work very long files, in projects that you are not familiar with, and felt very lost, without an anchor point? Enter Emacs and its registry system, which allows you to “bookmark” locations of a file (buffer) and return to them, and much much more! Registers # Emacs registers are places you can save text or positions for later use. Text and rectangles saved in registers can be copied into the buffer once or many times; you can move point to a position saved in a register. Each…
J
Lieve Joe, Jij en ik weten dat levend zijn pieken en dalen betekent. Alles wat je heb meegemaakt heeft dit een volle, veelzijdige, maar gezellige bus. In deze bus zitten heel veel Joe's: doelgerichte Joe, aan de kant duwen Joe, vechter, niet-empatisch, idealistisch, hoge verwachtingen, hoge lat, inspirerend, hulpzaam, creatief, chill, zal goed komen, etc. Het is waar, vaak staat gladiator Joe voorin de bus, vooral als iemand of iets in de weg zit van doelgerichte Joe. Vaak wurgt ie zijn weg en…
J
Free monads based on from intuitions from the Data types à la Carte paper. Combine functors and make embedded DSLs in Haskell. See the original paper, by Wouter Swierstra: https://webspace.science.uu.nl/~swier004/publications/2008-jfp.pdf . See the Haskell library I built around it: https://codeberg.org/jjba23/free-alacarte . How do you use this ? # This section gives a brief demonstration of using free monads to model effects. Four effectful functions are defined, categorized into two separate…
J
Testing software at a high level means freedom of implementation and refactoring, while maintaining guarantees of correctness. This is something all good engineers love 💘 Black-box testing is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. In my opinion, for complex systems and system interactions, one should default to writing a lot of black-box tests, and some unit tests where it makes sense, and leave…
J
OpenVPN 3 on NixOS with Web-based SAML # Recently at work we migrated from a simple OpenVPN profile with AWS credentials to a profile that authenticates based on SAML via your browser. Worth noting, SAML web-based authentication for OpenVPN only works with OpenVPN 3. This means that we need OpenVPN 3 now running, and also that you can’t run the VPN as a systemd service unfortunately. I got it working previously with Void Linux, but I have since moved to NixOS, my love 💘. I was struggling for a…
J
Below is the procedure for creating a bootable USB flash drive with Windows 11. The same process should also work with any HDD/SSD connected to your system. Download Windows 11 image # https://www.microsoft.com/software-download/windows11 sha256sum Win11_English_x64v1.iso 4bc6c7e7c61af4b5d1b086c5d279947357cff45c2f82021bb58628c2503eb64e Win11_English_x64v1.iso copy Plug your USB flash drive # Linux detected /dev/sda as the USB stick, in your case it will most likely take a different name. Format…
J
OpenVPN 3 on Void Linux # Recently at work we migrated from a simple OpenVPN profile with AWS credentials to a profile that authenticates based on SAML via your browser. This means that we need OpenVPN 3 now running. At the time of writing there was no package in the Void Linux repos for v3 so I decided to build from source, since otherwise this would mean I cannot do my work, from Void Linux. ⚠️ Note: looks like the build process for OpenVPN 3 now uses Meson. See:…
J
In this article, I’m going to give you exactly what you need to get started using Emacs and understand the basic concepts and key bindings of the editor. I know this article might seem long, but I promise you will come out with a plethora of knowledge about Emacs. I have taken lots of parts and inspiration from the excellent guide made by System Crafters. Watch the great introductory video too on YouTube ! Installation # Emacs can be installed on GNU/Linux, macOS and Windows and more. It is one…
J
In this post I want to show you how to setup your favourite text editor, Emacs, as a super powerful and capable Scala IDE (integrated development environment) with the latest and most performant approach. You might think I am crazy and I make my life more difficult than it needs to be. Let me tell you this already, my development experience in Emacs with Scala is 5 star ⭐. I use this setup at work extensively and cannot think of a better way to be productive. I see VSCode and IntelliJ…
J
Stackage is a neat tool to use when developing Software in Haskell. It’s integrated with the Hoogle search engine that can search on type signatures (and function names) which lets you find almost any function easily. One of the downsides of Hoogle is that it can be slow for people with some slower connections and so looking up any kind of documentation becomes a really frustrating experience. The other issue with using Hoogle is that when you look up documentation for a function of a library…
J
Taken from the brilliant post of Matt Parsons. Types are a powerful construct for improving program safety. Haskell has a few notable ways of handling potential failure, the most famous being the venerable Maybe type: data Maybe a = Nothing | Just a copy We can use Maybe as the result of a function to indicate: Hey, friend! This function might fail. You’ll need to handle the Nothing case. This allows us to write functions like a safe division function: safeDivide :: Int -> Int -> Maybe Int…
J
A really nice explanation from the Tweag team, that reflects exactly how I think about the subject. People keep asking me, “What’s the point of Haskell, why do you folks even use it?”. How can you answer this? Most of us Haskell practitioners would start talking about strong static types, the elegance of abstractions, and ease of refactoring—but we would be missing the bigger picture. That’s because we are programmers, and programmers typically think about the technical details. Let’s take a…
J
One day, I decided on a whim to try Guix in a VM on a M3 Mac. It seemed like a good idea at the time, but I’d never used Guix before and it ended up being quite a grind to figure out how to get it running. The initial issue for me was that Guix doesn’t provide iso installer images for aarch64. Yes, you can build one yourself, but after I’d put in the time to figure out how to do that, though, the iso installer would just hang. The serial console would say waiting for partition…
J
This is a step by step guide to installing Arch Linux on UEFI with full disk encryption. It deliberately contains no unnecessary words or bling. It is heavily based on the Arch Linux wiki’s installation guide so if you’re ever stuck, just refer to it and the rest of the awesome Arch wiki. Download ISO # Download the latest ISO from the Arch Linux website. Create Bootable USB Stick # You can skip this step if you just want to run Arch Linux in a VM. In that case, just run the ISO from your…
J
FreeBSD uses the init system, and system services must be made as rc.d scripts. You can find more detailed information and examples in the handbook: Practical rc.d scripting in FreeBSD. CLI options choice for daemons # Find below the options we normally use for any /etc/rc.d script as daemon. See more options by in the terminal issuing: man daemon -f: Redirect standard input, standard output and standard error to /dev/null. When this option is used together with any of the options related to…
J
This is a very interesting learning experience written originally by Mat Ryer. The way I have written services has changed over time, so I wanted to share how I write the services today—in case the patterns are useful to you and your work. A Server struct # A Server struct is an object that represents the service, and holds all of its dependencies. All of my components have a single server structure that usually ends up looking something like this: type server struct { db *someDatabase router…
J
In this post I will try to give an explanation to the project structure I follow commonly while making Go projects. This is a basic layout for Go application projects. It’s not an official standard defined by the core Go dev team; however, it is a set of common historical and emerging project layout patterns in the Go ecosystem. Some of these patterns are more popular than others. It also has a number of small enhancements along with several supporting directories common to any large enough…
J
Table of Contents Expect the Violent Psychopath Naming Tropes It’s All Greek To Me German / Dutch Naming Convention Isomorphic Naming There’s one thing that could make our life as software engineers much easier: better naming convention. Expect the Violent Psychopath # You’re trying to tell a story with your code. Your code should tell that story clearly, not cryptically, for an audience besides yourself. A good yardstick for deciding what kind of audience you are writing for is to imagine…
J
Table of Contents What I prefer Package (pkg) Benefits Port Benefits FreeBSD is bundled with a rich collection of system tools as part of the base system. In addition, FreeBSD provides two complementary technologies for installing third-party software: the FreeBSD Ports Collection, for installing from source packages, for installing from pre-built binaries. Either method may be used to install software from local media or from the network. For more detailed information you can refer to Chapter…
J
There are several advantages into using prepared statements and transactions in SQL, in my case mostly with MariaDB. I will explain some of the advantages, some of the caveats and handy tips to manage them, specifically with Go. Why SQL Transactions ? # We want our unit of work to be reliable and consistent, even in case of system failure. We want to provide isolation between programs that access the database concurrently. When you start an explicit transaction and issue a DML (Data…
J
In this document we will explain how to migrate to a newer FreeBSD version both on hosts and on jails. You can always refer to Chapter 24: Updating and Upgrading FreeBSD for more detailed information. Updating the host # FreeBSD is known for being reliable and to be painlessly upgradeable, even with custom setups, like I do, with manual partitioning, ZFS on root, FreeBSD can handle this easily. We should start by evaluating the current version we have installed, with: uname -mrs copy which in…
J
FreeBSD uses the init system, and system services must be made as rc.d scripts. You can find more detailed information and examples in the handbook: Practical rc.d scripting. CLI options choice for daemons # Find below the options we normally use for any /etc/rc.d script as daemon. See more options by in the terminal issuing: man daemon -f: Redirect standard input, standard output and standard error to /dev/null. When this option is used together with any of the options related to file or…
J
Javascript has a stranglehold on all Front End Development. If you write code for the browser, then it’s most likely written directly in Javascript or its very close cousin TypeScript. The problem is that Javascript is a terrible language. TLDR: You should break free from Javascript by learning PureScript which compiles to Javascript. Typescript and other attempts to curtail Javascript are about as effective as a band-aid on a puncture wound. One might argue that it’s better than nothing but…
J
Haskell is the first programming language we reach for when we build production software systems. This likely seems unusual to anyone who only has a passing familiarity with the language. Haskell has a reputation for being an advanced language with a steep learning curve. It is also often thought of as a research language with limited practical utility. While Haskell does have a very large surface area, with many concepts and a syntax that will feel unfamiliar to programmers coming from most…
J
There are some anti-patterns one should avoid when writing SQL queries. Sometimes these may seem like a shortcut, but in reality this can lead to bugs, problems, and brittle applications. It’s almost always better to use the explicit column list in the SELECT query than a * (star) wildcard. It not only improves the performance but also makes your code more explicit. It also helps you create maintainable code, which will not break when you add/remove columns from your table, especially if you…