The Missing Bit

Blog posts

From Ansible to plain script
2023-10-28

Introduction

I use Ansible to manage all my infrastructure. It's about 50 bare metal servers that sit in my basement.

It works well, but I have a few issues:

  • It can be very slow
  • YAML can be very tricky to edit
  • Sometimes, it takes ages to find how to do something that seems very simple
  • The output is not helpful, it is either not detailed enough, or a huge flow of debug information

The third one is the biggest pain point. I spent sometimes hours trying to get how to use some plugin to do something simple.

Read more »

 

Fix keychain ssh-agent helper with fish
2023-10-25

I use keychain from funtoo which helps re-using ssh-agent.

But I had an isssue from time to time, the $SSH_AUTH_SOCK would be unset.

It seems there is an issue with Universal fish variable which keychain uses.

The workaround is to copy those variables to global ones, like so in your config.fish.


if status --is-interactive
    keychain --agents ssh --eval --quiet --inherit any -Q | source
    # Make those variables global to avoid universal version override
    set -xg SSH_AUTH_SOCK $SSH_AUTH_SOCK
    set -xg SSH_AGENT_PID $SSH_AGENT_PID
end

This ensure that setting those variables in other terminals will not mess them up.

Read more »

 

Creating an elixir nif in zig
2022-11-26

Zig is a language that has excellent interoperability with C, and for this reason, I use it a lot to interact with C libraries. I also use elixir as a daily driver for server applications.

In this post, I'll detail the step to be able to call zig code from elixir.

Read more »

 

CRC 32 on STM32l0
2022-09-04

The goal is to do the same as zig's std.hash.crc.Crc32.hash(&buf) on STM32 hardware.

Read more »

 

Testing Zig for embedded development
2022-06-22

I have been using rust as embedded language for cortex M MCU for a while.

While I like rust, embedded dev in rust has some friction, and a few things are a bit hard to do. Especially C interop and direct memory manipulation.

I decided to give zig a try, and while it is still in very early stage compared to rust, I was able to get a working hello world program quite quickly. And I was able to get RTT working with the SEGGER C library.

In this post, I'll share what I learned and a few gotchas.

TLDR: The repo is here: https://github.com/kuon/zig-stm32test

Read more »