Here you may find answers or direction to a wide range of topics. I don’t post regularly, but when I find something particularly vexing and the answers out there thin or useless, a post often results.
Posts
Explaining LiveView with diagrams by Claude.ai
elixir mermaid au claude.aiIn considering AI use cases and capabilities, I set Claude.ai on the task of describing the life cycle and events for PhoenixLiveView LiveComponent. The prompt, including my typo:
Coding with Claude.ai, a short journey
erlang elixir ai claude.aiUnderstanding the uses, limits and pitfalls of AI as your “coding buddy” requires some work and investigation. I’ve chosen to investigate with Claude.ai and compare coding solutions in Elixir, Erlang and Javascript. My goal here is to evaluate idiomatic style and forecast how the approaches may hold up. Let’s start with the claude.ai chat interface, nothing fancy like cursor.
TrueNAS midclt examples
truenasA compilation of examples on how to use midclt and interpret the API documentation
function spec from anonymous function type spec
erlang elixirA possible OTP feature request: syntax for declaring a function spec using a typespec for an anonymous function.
No plural tables
database opinionSome opinionated database frameworks have made a point of using pluralized names for database tables. I disagree with this opinion and will explain why.
First deployment at Hetzner with CDKTF
infrastructure cdk hetznerHaving a small project to deploy at Hetzner, I decided to try using CDK for the first time outside of AWS. Hashicorp’s CDKTF rolls AWS CDK with Terraform for doing IAC with the many TF providers available.
Publishing Jetenv to HEX
elixirAnnouncing that today a new package
Jetenv
will be published to hex.Emacs: mini-buffer input that conflicts with completion
emacs company-mode completion
In Emacs, using input that conflicts with completion choicesWhy HMAC
crypto
Need to generate a constant hash key from an ID, or compound ID, but don't want it to be too easy for a 3rd party to brute force generate (assuming they know the ID domain and in a compound the right ordering, and other transformations)?
NixOS PXE install
nixos linux
A stab at installing NixOS over a networkSigned OpenSSH keys
openssl ssh
Background and references on signed ssh keysRSA Crypto for JS and Elixir
elixir javascript
Encryption between JS and Elixirnginx config for acme challenge
nginx acme certificates
To more transparently support Let's Encrypt and the acme-challenge for http, here is a config that can be used with nginx. In the case all traffic showing up as HTTP gets redirected to HTTPS, it's easiest to respond to challenges without the redirect.
SSH keys in Docker
docker ssh
One way that I use docker is to encapsulate all the configuration of a remote site. By using docker-compose and a container that just runs /bin/sh, running commands in a controlled environment is easy as exec. One issue I had is how to use my ssh identity. The most flexible answer is to use secrets with docker-compose.
docker network conflict?
docker routing networking snaps ubuntu
Docker uses 172.17.0.0 as the first network and increments the second octet for each new network. If your network happens to use internal networks in the range, you'll have routing problems. Here's how to change what docker uses for numbering networks.
iocage networking with vlans
freebsd jails iocage
Solving traffic routing problems with iocage and VLANsgit color in docker container
git docker
If you run
git
interactively in a docker container colors may not display if alpine and busybox is in use. This is becauseless
is mapped intobusybox
and doesn't have color capabilities. The solution is toapk add less
.SSH and keytab case sensitivity
kerberos ssh
Getting SSH to work consistently well with Kerberos seems to run into one thing consistently: problems. It does work, but when it doesn't the messages are not helpful and only one's imagination and persistence remains. The documentation is not great in this area and searching the internet for clues results in slim pickings. Here's the latest problem:
An interactive approach to writing Elixir macros
macros elixir
Bitstring binary matching is hugely powerful to parsing fixed data. It does lead to considerable repetition and depending on the data, converting different fields different ways leads to more repetition, shadowing variables and so on. For my particular situation it seemed worth the time to try a macro. In the process I developed an approach that made writing the macro easier and interactive.
ACE for Drop Folder
ACE SMB TrueNas
An ACL for write-onlySMART service fails to start on FreeNAS
Dell Server iDRAC SMART GEOM
Disable the virtual floppyA little WebCrypto
openssl WebCrypto RSA Javascript
Using SubtleCrypto to encrypt in the browserAbsinthe: Passing unresolved fields through resolvers
elixir absinthe graphql
Passing extra data between resolvers.ExUnit: Sharing support modules
elixir testing ExUnit mix
Changing dependency compilation environment to run dependency tests.Don't use localhost if you want Kerberos to work
samba kerberos samba-tool
Steering clear of host naming problems with Kerberos.mix configuration cycle
elixir mix releases
Controlling import_config and cyclical import problems.Postgres now() and Testing within a transaction
ecto elixir testing postgresql
What is now() in a transaction.Corrupting a struct in Elixir
elixir ExUnit struct
ExUnit errors involving degenerate structsThe Elixir Module attribute @compile
elixir erlang compiler testing ExUnit
Testing private functionsEmbedded schema for form validation and casting
ecto forms
Using embedded schemas for general validationUsing Flow Windows and Triggers on a Bounded Stream, Part 1
elixir
Batching insertions with triggerselixir macros that use module attributes
elixir macros
Attributes in MacrosAdding Gerrit to our development process
gerrit git
Configuring a user to use GerritGerrit: Converting from HTTP Auth to LDAP
LDAP gerrit authentication
How to transition users from HTTP to LDAP authentication in Gerrithaproxy and ACME certificates
haproxy acme certs dehydrated
Setup haproxy to work with Let's Encrypt for issuing and using Acme certsnetstat, listeners, processes
netstat can tell you what is doing the LISTENhaproxy for redirect
haproxy
Setup haproxy as domain redirect switchboard
subscribe via RSS