RSSAmplifier

Blog

lambda.cx blog

Recent content on lambda.cx blog

blog.lambda.cxRSS feed ↗39 posts

Latest posts

Creating a "What Is My IP" website in four lines with nginx

I recently wanted to create an endpoint on a development machine that could return my external IP address. Normally I would use one of a handful of services https://canhazip.com/ or https://ifconfig.ca/, but I wanted to see how easy it would be to make my own. As it turns out, it's incredibly easy, and doesn't even require leaving the reverse proxy.
Using nginx, we can just create a block like…

OpenBSD Weechat Question Mark Message Separator Fix

I just solved what was becoming a very aggravating issue thanks to the help from the folks in the #weechat channel in Libera.Chat.
On OpenBSD, my weechat client would put a question mark to separate the nicks and the messages sent with a question mark instead of a pipe-looking character like it should.
It looks like this was caused by opening weechat without having the correct locale set.…

Adding a Second Encrypted Drive to Fedora

This post will cover creating a second encrypted drive on Fedora that automatically decrypts on boot and mounts to a set location.
I had finally run out of room on my SSD. I went to the store to buy another so I could increase the amount of storage space in my PC. I got home and installed it. Then I thought.
My main drive in encrypted and setup by the Fedora installer, so my second should…

Converting Old Camcorder MOD and MOI files to MP4 Video

I recently found a bin of SD cards from a JVC camcorder I used years ago for school projects. I wanted to import the videos into DigiKam to catalog them with the other photos and videos I've taken with other cameras. When trying to complete this I quickly ran into an issue. The camcorder recorded videos into a combination of MOD and MOI files, which most software doesn't recognize.

Creating an OpenBSD Wireguard VPN Gateway

A couple of years ago I published a blog post about creating an OpenBSD VPN gateway using OpenVPN.
I've recently switched from an OpenVPN-based VPN provider to one that uses Wireguard. As a result I've had to redo my VPN gateway.
I'll only be highlighting the things I've changed since the last setup in this post, so please refer to the previous post for more details.
One advantage this…

Bash Incremental Directory Completion

I was just working on a bash completion for my repo management tool and came across a completion problem I couldn't find an answer to.
In my tool, all repositories are stored under a root source directory ~/src, and are three directories deep under that.
The top directory is the website, the second is the user, and the third is the repo itself. For example github.com/zig/ziglang.
My…

Dynamic Tracing on OpenBSD 7.3

A couple years ago a new device silently entered the OpenBSD source tree.
The dt(4) device first appearing in OpenBSD 6.7 with very sparse information. In the releases since, it's gained quite a bit of functionality and now has tools to manipulate it properly.
The documentation has gotten better over the last couple years, but there isn't much info about how to leverage it to do anything…

Lesser Known IRB Features

While poking around in IRB and looking at the autocompletion results, I found some functions that I didn't recognize and decided to take a look at what they do. I found some pretty interesting stuff.
It looks like some of these commands have been added recently to come up to par with pry, and others have been kicking around for a while and just flying under the radar.
You can find them all…

Testing Rails Components That Require Cache

If you're in the default testing environment your rails cache is ActiveSupport::Cache::NullStore which will always succeed but it doesn't actually store or return anything.
There's an almost completely undocumented method called with_local_cache on NullStore that lets you run a block with a MemoryStore instead of a NullStore for the duration of the block. This happens because it prepends the…

Mounting FreeNAS Shares on OpenBSD

This is something that took me a while longer to figure out than I'd like admit, and I was only able to figure it out because of a forum post.
For whatever reason, I'm only able to mount the share if used the TCP option. I'm not sure if this is a me issue, an OpenBSD issue, or a FreeBSD issue, but I'm putting it out there in case anyone else runs into the same problem.

Creating a High Quality GIF with Transparency

I spent quite a bit of time trying to figure out the process to create the gif at the top of my How BSD Authentication Works blog post, so I thought I'd share it.
Here's how to create a small, high quality gif with transparency using a video and an image as source material.
I'd wanted to combine the image of puffy (the blowfish) and the spinning gears to represent the OpenBSD internals.

Exploring OpenType Font Features

I just bought a new font to use as my primary face in Emacs. It's a cool one called MonoLisa, I think it looks great.
It has a nice looking script variant that lets you turn your italics into a cursive looking font. Unfortunately it's a fancy OpenType feature that most things, including Emacs don't support properly yet.
In their FAQ they mention that you can use a tool called OpenType…

How BSD Authentication Works

History The way OpenBSD authenticates users is quite different from other Unix-like operating systems. Most other systems like AIX, Solaris, Linux, the other BSDs, and MacOS, use a framework called Pluggable Authentication Module (PAM). The two main implementations are Linux PAM and OpenPAM. PAM modules are created as dynamically loaded shared objects, which communicate using a combination of…

Reverse engineering a thermal printer's WiFi setup commands

Introduction I recently purchased a thermal receipt printer off of AliExpress for a project. It features both WiFi and USB connectivity which I thought was really cool for the price.
To my dismay, I realized after purchasing that the drivers and configuration application only run on Windows.
This wasn't a huge deal, as thermal printers generally use the somewhat kinda standardized command…

An Improved Emacs Frame Title Format

I've often found that the default Emacs frame title is a little bizarre. emacs@host Seems a little useless at describing what's going on in the actual window in my opinion, and I believe the space could be put to much better use. Perhaps it's designed for environments where X11 forwarding is common practice, or where GNU Emacs shares a system with XEmacs.
Taking inspiration from both Emacs and…

How to get all Emacs daemon buffers from a shell script

A while back I posted a response to someone's question on reddit about how to get a list of all Emacs daemon buffers from a shell script. It was a pretty interesting problem so I thought I'd explain my answer here.
The question was 'Is it there a way to export the list of opened buffers to STDOUT?'.
In the comments I left a rather byzantine looking snippet of code that I'd managed to…

Versioning FreeCAD files with git

I've been working a lot with FreeCAD since I got my 3D printer. It's been a mostly excellent experience, but I've run a couple issues.
Between the MacOS and Linux version of FreeCAD (both 0.19, maybe different builds?), and transferring files between machines using Nextcloud, a project that I'd been working on for a couple days became broken to the point where I could no longer modify the…

Aligning columns in Emacs

I've been writing a lot of GraphQL resolvers in ruby at work recently, and frequently run into a situation where I have to align many columns of text by hand. I figured this isn't a very unique problem, and that there was probably already some code within Emacs to handle it.
As it turns out I was correct in my assumption. There's an excellent built-in package called align that takes care of…

Creating an Always On E-Ink Org Agenda

I recently made a post about how I was able to configure the new tab page in my browser to display my org agenda. Since then I've been working on another project similar to that, trying to take the concept even further.
A while ago I purchased an Inkplate 6 during its crowd funding stage on Crowd Supply, with the exact intention of creating something like this.
At the core of the Inkplate…

Org Agenda As My New Tab Page

I absolutely love org mode. I use it extensively almost every day to keep track of tasks and due dates, both for my personal life and at work. A lot of this workflow centres around the org agenda, which compiles all the current and upcoming tasks and due dates from several files into a single view.
The only gripe I had with it was that I had to be within Emacs to use it.

How I Keep Track of My Servers

I manage a lot of servers. Some are serving static content like this blog, with others running services like Nextcloud, ZNC, Shadowsocks, or Mumble. I also have one or two game servers to play with my family and friends. These are spread across two providers for cost and geographic reasons.
In addition, I have several machines running in my house, one running FreeNAS with some jails, another…

My Emacs on Android Setup

Not too long ago I purchased a Samsung Galaxy Tab A. I bought it mostly for browsing the internet and reading PDFs, but I've been using it a lot more for working in Emacs recently.
With the help of Termux, I've gotten more or less a fully functional development and writing environment which has both a small physical size, and long battery life. With the use of a bluetooth keyboard, I have…

Installing Hak5's Cloud C2 on Alpine Linux

I recently purchased some products from Hak5, some of which integrate with their self-hosted service for monitoring your equipment called the Cloud C2. I decided to run it on one of my servers which runs one of my favourite Linux distributions, Alpine Linux.
You have the option to purchase the community edition for free from their shop, after which you'll receive a product registration code…

Creating a VPN Gateway with OpenBSD 6.7

The Problem Say you have an account with a VPN provider. Maybe there are a limit to how many connections you can have with one account. Maybe you want to put more machines than you have connections on the account. Or maybe you want to put a large number of machines of the connection, maybe some FreeBSD Jails, LXC containers, or VMs, and you don't want to download the VPN profiles, sign in and…

Fixing OpenBSD 6.7 httpd MIME Types

On OpenBSD's httpd, there are only a select few MIME types that are recognized by default. According to httpd.conf(5), those types are: ext/css, text/html, text/plain, image/gif, image/png, image/jpeg, image/svg+xml, and application/javascript. Everything else is said to be of type application/octet-stream by default.
This is OK for most static hosting situations, but can be challenging for…

Talk: An Introduction to OpenBSD

I recently gave a talk at work to help introduce OpenBSD to my colleagues. It's a broad introduction to the fundamentals of security in OpenBSD, as well as some basic system administration tips and suggestions anyone coming from a Linux background might find useful.
It's roughly split up into four sections; the history of OpenBSD, what sets it apart from other operating systems, a guided…

Compiling Rakudo Star on OpenBSD 6.7

EDIT: After writing this post, tyil, the maintainer of rakudo star, reached out to me and added proper OpenBSD compatibility. The portion of this post dedicated to working around the failing downloads can now be ignored, and rstar now includes a warning if the user doesn't have a login class set.
EDIT: The development version of Rakudo Star targets Rakudo 2020.07 instead of 2020.02, which has…

Setting up a DHCP server on OpenBSD 6.7

OpenBSD makes a great router. It's simplicity and ease of configuration makes it perfect for network infrastructure applications. Everything you need to build a network of any size is built into the base system, plus its man pages and examples cover everything you'd need to know.
While I've been an OpenBSD user for years, I'm finally in the process of replacing the router provided by my ISP…

Installing OpenBSD 6.7 on a PC Engines APU2

If you're interested in the PC Engines APU2 line and what the differences are between models, I've covered it in a previous post here.
I recently purchased a new PC Engines APU2E4 to use as a home router. I purchased the kit, which includes the board, case, and power supply from CorpShadow. I also ordered the DB9F to USB adapter (Silicon Labs CP2104), so I don't need to get a separate null…

Installing Bitwig Studio on Fedora 32

Bitwig Studio is an amazing cross platform digital audio workstation (DAW). One of its best features, at least for me, is that it works on Linux, which is pretty rare in the professional audio world.
While they say on their website that they support 'Linux', what they mean is that they support Debian-based distributions like Ubuntu, as they only provide .deb packages. Fortunately for Fedora…

Expanding a Directory With Tab in Dired Mode

dired mode is one of my favourite features of Emacs. I use it so often, it's pretty much my go-to file browser. I use it both on my local machine, and on remote machines via TRAMP. One feature of dired is the ability to enter sub-directories in the same buffer by inserting the contents under the current directory. While this is useful, I often want something quicker to check the contents of a…

How To Set An Image Title In Hugo Using Org-Mode Markup

One of the differences between using markdown and org-mode markup for writing Hugo pages is how you set the alternative text and title of an image.
In markdown, you would write it as
![alt text](dummy-image.png 'Image Title') Where in org-mode, typically you would use a caption like this
#+CAPTION: Image Title [[file:dummy-image.png]] and that would be the end of it. However in Hugo,…

Hugo Org-Mode Default Archetype

I love using Hugo to write. Their org-mode markup support is absolutely top notch. The only real problem with it is that while it's well supported, the Hugo docs don't cover it very much, as Markdown and TOML are the main markup and configuration languages.
One of the basic building blocks for Hugo blogs are Archetypes. Archetypes get used as the templates for new posts, and get automatically…

Using emacsclient on MacOS

Emacs is an amazing editor, but it can be a little slow to start sometimes. That's why emacsclient lets you run Emacs as a daemon and connect to it as a client, negating the startup time and letting you jump directly into editing.
The two primary ways of getting Emacs onto your Mac are by either downloading it from Emacs For MacOS X or by installing it through homebrew using brew cask install…

How To Stop mg From Littering

If you've been an OpenBSD user for any period of time, you probably know what mg is. For those who don't know, mg stands for MicroGnuEmacs. It's a small clone of Emacs maintained by the OpenBSD team that's included with the base system.
Being an Emacs user, I love that mg is part of the OpenBSD base system. It's great to have an editor that has familiar keybinds on a system that I haven't had…

PC Engines APU Comparison

I've been looking at the PC Engines APU line for a while. They're a line of medium size single board PCs with a DB9 serial connector, no VGA output, and multiple gigabit Ethernet ports. Because of this they're often used as firewall machines.
I want to get one and use it as either the home router, or an experimental server to mess around with. Quite a few OpenBSD folks use them and recommend…

Let's Encrypt on OpenBSD 6.7

So I have an OpenBSD server serving a static website using httpd(8). I've been thinking for a while I should add an SSL certificate, but never got around to it because it was just a small hobby website and it didn't require any real attention.
Today while watching one of the OpenBSD tutorials at BSDCan, I thought it was finally time. Since configuring everything else in OpenBSD is so easy,…

About

Hello! My name is Dante Catalfamo. I'm a developer at Shopify. I live in Ottawa, Ontario, Canada.
I'm a big fan of OpenBSD and Emacs, hacking on both regularly. In fact, this blog is written in Emacs and hosted on OpenBSD using httpd.
I enjoy learning new languages and paradigms and have have written projects in, or am currently using:
C Common Lisp Emacs Lisp Forth FreeCAD Go…

Issues with OpenVPN on OpenBSD 6.7

EDIT: (August 22, 2020) Theo Buehler has kindly reached out to me and informed me that this issue has just been fixed in a syspatch, and that OpenVPN now works correctly.
Hi.
Regarding https://blog.lambda.cx/posts/openvpn-issues-openbsd/, the issue you describe in this post should be fixed in 6.7-stable.
It boils down to this:
ProtonVPN appears to require clients to use P-521 for…