RSSAmplifier

Blog

Ellie's Notes

Personal site of Ellie Huxtable

ellie.wtfRSS feed ↗60 posts

Latest posts

Advancing bookmarks with jj

A bunch of people read my post about using jj yesterday! In that note I pointed out that I found jj not automatically moving bookmarks when a new commit is created to be really frustrating. Well... turns out there is a really simple command that will do that! It's not automatic, but it's better than manually moving the bookmark jj bookmark advance # or for short jj b a So you can make a…

Getting started with jj

Over the past few weeks, I have been using jj! This is not the first time I have tried it, but it is the first time it has stuck. For years, my git workflow has used "make a change, then git commit --amend --no-edit && git push --force-with-lease ", while on a branch. This meant that my changes would be up to date on the remote with very little latency. PRs would rarely be more than a small number…

Spegel for p2p docker registries in k3s

I was recently setting up a new k3s cluster for running Atuin . Since I wrote my last note on the subject, a few things have changed! I definitely need to do a v2 of my post, but in the meantime I learned a bit about Spegel , an optional integrated registry included with k3s. If server nodes are started with --embedded-registry , then they will setup + run a Spegel registry. This means they host a…

1290

Ellie's 1290 Superduke R Evo I moved to the US and bought a superduke yay Here I am making some notes. I will likely also track torque specs, services, etc. Specs A collection of useful specs Spec Value Factory recommended rear pressure 42 Factory recommended front pressure 36 Ellie's preferred rear pressure 36 Ellie's preferred front pressure 32 Torque specs I'll note them…

Fixing ingress-nginx ConfigurationSnippet validations

Today I found myself needing to configure ingress-nginx. I needed to write a bit of nginx config to rewrite status codes for certain routes. Something like nginx.ingress.kubernetes.io/configuration-snippet : | - location /metrics { return 404; } I've done this many times in the past, but today I received the following error Error: UPGRADE FAILED: cannot patch "xyz" with kind…

Fixing drag events with Tauri

I've been working on a desktop app with Tauri, and had issues for a while with the "draggable" prop on some elements. Instead of them dragging as I expected, I'd just get a plus icon. The fix was pretty easy I added app: { window:[{ ...snip, "dragDropEnabled": false }] } to my tauri.config.json . This is mentioned in the Tauri docs:…

Amending the author of a Git commit

It&#x27;s pretty common that I&#x27;ll accidentally use the wrong email for a commit. I have a few emails that I like to use for different purposes, so getting it correct is important :) Amend author of last commit This one is nice and easy! git commit --amend --author= " Example Name <name@example.com> " Using interactive rebase git rebase -i on whatever base you want Mark the commits you&#x27;d…

How to split a Git subdirectory into a new repo

First, install git-filter-repo . This is a python script, with no dependencies. It&#x27;s easy to install. Just drop the script somewhere in your PATH. For me: curl " https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;newren&#x2F;git-filter-repo&#x2F;main&#x2F;git-filter-repo " -o ~&#x2F;.local&#x2F;bin&#x2F;git-filter-path An important thing to note is that git-filter-repo will replace all other…

Custom keybinding with react-codemirror

I&#x27;m currently using uiwjs&#x2F;react-codemirror for a project, and needed to add a custom binding to cmd+enter The documentation didn&#x27;t quite show what I needed, but with the following you can bind custom keys import React from ' react '; import CodeMirror from ' @uiw&#x2F;react-codemirror '; import { keymap } from ' @codemirror&#x2F;view '; import { defaultKeymap } from '…

Show dd copy progress

A super short note, but I forget this all the time. If you&#x27;d like to see progress while dd-ing something, add status=progress , like so dd if=&#x2F;input of=&#x2F;output status=progress

Get the first day of the week with JavaScript

I&#x27;m currently building a calendar data display for Atuin , and wanted to ensure that the week started with the correct day. While I&#x27;m a big fan of things being configurable and flexible, I don&#x27;t want to introduce a new config option unless it&#x27;s required! Luckily browser localisation exposes plenty of options. Get a Locale object First we need a Locale! They&#x27;re created like…

HDZero Freestyle V2 VTX with my Pavo25 V2

Recently I&#x27;ve been playing around with FPV drones - I now have a Pavo25 V2. I had an old set of DJI goggles lying around, but the latency&#x2F;buffering just didn&#x27;t work for me. I was set on HDZero. Putting the Freestyle V2 in place of the O3 wasn&#x27;t too difficult, though a bit fiddly. Sharing this in case it can help anyone else. The main issue I had was with the connector. Naively,…

Search for a string across all git branches

I&#x27;ve been working across a few branches lately, and couldn&#x27;t remember the name of a git branch containing some work I&#x27;d done. I did, however, remember the name of an interface I&#x27;d defined. Seach all git branches for a specific string, with this git rev-list --all | xargs git grep ' SEARCH STRING ' If a result is found, you&#x27;ll be given the git SHA Get info for the sha git…

Debugging slow PostgreSQL queries

Earlier today I was trying to figure out why I was getting the occasional latency spike. I suspected I had some slow queries that needed optimising, but in order to check I needed to enable slow query logging. If you wish to log all statements that take longer than 100ms with postgres, add this to your config file log_min_duration_statement = 100 Then reload the postgres config with select…

Block AI crawlers

I have very mixed opinions on LLMs, as they stand. This note won&#x27;t be digging into my thoughts there - I don&#x27;t want to have that discussion. However, while I&#x27;m not exactly doing cutting-edge research here, I do put effort into publishing for humans . I like knowing that the 10 minutes I spent writing here might save a few people time in the future. I don&#x27;t do this so someone…

My experience switching to Zed from NeoVim

I&#x27;ve been using Vim&#x2F;NeoVim for the past decade, at least. I converted from Sublime Text after my workflow became more terminal-heavy. In the years since, I&#x27;ve tried a great many editors - and always fell back to Vim. VSCode was cool, but the Vim emulation just wasn&#x27;t quite right. I kept tripping up over myself, and the experience was very jarring. I also felt that the editor…

TypeScript import path aliases

I&#x27;ve been working on some more frontend code recently, and got quite tired of my import paths looking like this ..&#x2F;..&#x2F;foo&#x2F;bar&#x2F;etc How horrible! If I ever change directory structure, things are liable to break. That won&#x27;t do! The internet suggested adding the following to my tsconfig.json " compilerOptions " : { " paths ": { " @&#x2F;* ": [" .&#x2F;src&#x2F;* "] } } ,…

Ignore a folder with ripgrep

Recently I&#x27;ve had the need to ignore a folder while searching with ripgrep. Normally rg will ignore anything specified by .gitignore , but I couldn&#x27;t set that in this case. You can specify files or directories to exclude with the -g flag, quoting the docs: -g, --glob GLOB ... Include or exclude files and directories for searching that match the given glob. This always overrides any other…

Profiling zsh and fixing my slow shell

My zsh has been a little slow to start for a while. Never enough to be a significant bother, but always something I&#x27;ve been meaning to get around to. Thorsten Ball had a great writeup about this here . Maybe I&#x27;ve had weights in my shoes for too long! Recently I&#x27;ve been messing with the atuin init command - this is ran at shell startup. I want to ensure it&#x27;s fast, and we…

Using SQLite extensions on macOS

I was playing with sqlite-zstd , and upon trying to load the extension... .load libsqlite_zstd Error: unknown command or invalid arguments: "load". Enter ".help" for help Sorry? Turns out, the sqlite install on macOS is built without the ability to load extensions. Luckily, Homebrew has a version that&#x27;s much more useful brew install sqlite Note that this is not linked by default. You&#x27;ll…

I quit my job to work full time on my open source project

Atuin supercharges your productivity by enabling you to rapidly retrieve any command you&#x27;ve ran, at any time, from anywhere. It stores your shell history in a database, recording additional command context and syncing it (e2e encrypted) across devices. The 22nd of December was my last day leading the infrastructure team at PostHog . Going forwards, I&#x27;m starting a company and working full…

Backing up mastodon

I&#x27;m the administrator of https:&#x2F;&#x2F;bikers.social, a mastodon instance for bikers 🏍️ Postgres is the most important part of an instance backup. If you lose your db, it&#x27;s game over. My secrets are also backed up. My old mastodon backup policy consisted of regular pg_dumps , and scp to another machine. This was totally good enough, as that machine was also backed up to my local…

Upgrading to macOS 14 Sonoma broke my network connection

I upgraded my mac to macOS 14, Sonoma earlier today. Upon first using it, my internet wouldn&#x27;t connect! Wifi or ethernet, nothing I tried work Even ping 8.8.8.8 I did some searching, and it turns out the version of Little Snitch I had installed wasn&#x27;t supported. The issue here is that without internet, I couldn&#x27;t update it The fix wasn&#x27;t too difficult. Go to System Settings ->…

Social media and social life

Over the past year or so, I&#x27;ve been scaling back how much time and energy I put into social media. For a long time, I&#x27;d keep my Instagram story "up to date", regularly post on TikTok, and spend far too much of my day scrolling various feeds. Lately, I&#x27;ve been scaling that back. I know a number of people who&#x27;ve totally deleted their accounts, but for me that wasn&#x27;t quite…

Exporting Prometheus metrics from HAProxy

I&#x27;ve recently started using haproxy after a lifetime of nginx, and I actually really like it! I needed to setup some metrics, when I discovered that haproxy supports prometheus out of the box - no exporter needed! 🥳 The documentation shows binding on whatever frontend you&#x27;re already using, but I wanted to make sure my metrics and stats were not visible to anyone outside of my network…

Postgres HBA with a Tailscale network

Following on with my postgres on zfs setup, I needed to configure the auth so that my PostgreSQL replica could securely connect to the primary. The constraints here are that I&#x27;m not using a cloud private network, so need a VPN of some kind! I&#x27;m using Tailscale , which is pretty much just wireguard made easy. Firewall First up, following Tailscale&#x27;s docs . Make sure you don&#x27;t…

Running bare metal PostgreSQL on ZFS

I&#x27;m setting up new postgres servers for Atuin ! We&#x27;re going with a hot replica this time, and making things much more reliable. Atuin has had no outages or database issues in a couple of years, but I don&#x27;t want to push my luck. You might also be interested in the hetzner k3s setup I did for the Atuin api images I&#x27;m going to be doing a fairly minimal setup to begin with, and…

Setting up k3s on Hetzner Cloud

I setup a HA k3s cluster for Atuin recently! I&#x27;m using HA etcd, which means we need to run an odd number of "server" nodes, and obviously more than one of them. That makes 3 the minimum. The servers are all setup in a private network, in their own subnet, and are ARM instances. The firewall is setup to disallow almost all ingress, and most egress. Honestly I&#x27;m shocked at how easy this…

Mt Shasta

I&#x27;m writing this one after a longggg day of riding, including heading home in the dark with a tinted visor 😬 Probably going to keep it brief. Today we rode 280 miles! Today I woke up around 6:30, made some tea, and went to sit outside while the world wakes up. There are so many woodpecker sounds here! We had planned to ride to Mt Shasta, which has been one of the things I really wanted to…

Fort Bragg to Weaverville

Carrying on from yesterday , we woke up early and got ready to ride the stretch up to Weaverville. The view from the hotel this morning was absolutely stunning - the fog was slowly burning off as the sun was brightening up, and the valley was echoing with seal calls. They were less atmospheric at 3am last night, though. I&#x27;ve entirely shaken off the jet lag at this point, and slept through to…

San Francisco to Fort Bragg

I&#x27;ve been in California for a few days now, staying with a friend in San Francisco. Today we left for the first day of a 6-day motorcycle trip! I&#x27;ve decided I&#x27;m going to write more on my own website, whereas I used to post much more about my travels to instagram. Today we did 257 miles, and rode for just under 6 hours. This post is pretty image heavy, and some of them are not…

Exporting Prometheus metrics with Axum

Observability is important! Generally I use Axum as my HTTP framework in Rust , as it&#x27;s pretty ergonomic to use + fast. tower-http provides a bunch of useful HTTP middlewares used in a lot of projects. At the moment it does not provide a metrics middleware. Someday it may do! Issue to track There are quite a few crates that do a lot of this automagically for you, but the Axum example suggests…

Husqvarna 701 Supermoto

I&#x27;ve had my 701 supermoto since June 2022, and absolutely love it. In 2022 I rode it for 2000 miles around Europe! Remap The bike runs super lean and hot from the factory. Decat + new headers + can will result in the bike being dangerously lean, and a remap is recommended. Besides, you won&#x27;t be making the most of the new parts without it! Power commander 6 required if you go the PCM…

Automatically load zfs keys at boot

I recently setup a new encrypted dataset. Ubuntu&#x2F;openzfs came with a systemd service to handle mounting it at boot, but not loading the keys - therefore, on reboot, it would fail to mount I did some googling and found this: https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;zfs&#x2F;issues&#x2F;8750#issuecomment-497500144 cat << 'EOF' >…

Git snippets

Remove untracked files git clean -fdx -f force -d include directories -x also remove ignored files Disable push to master&#x2F;main It&#x27;s pretty easy to accidentally push to main&#x2F;master (if for some reason you cannot enable branch protection), so putting [branch.main] pushRemote = [branch.master] pushRemote = in your git config sorts this out! If you would like to intentionally push to an…

Helmfile

Helmfile Helm is totally adequate (I&#x27;m uncomfortable calling it good) for deploying an app, and potentially a small number of dependencies. It can quickly spiral out of control when there are many services that need deploying, with varying levels of dependency. Helmfile is great for describing a large set of charts to deploy, and their values. It&#x27;s nice to be able to set values per…

jq snippets

jq Just a collection of jq things I&#x27;ve found useful Arrays Get an array element by index echo '[1, 2, 3, 4, 5]' | jq '.[0]' # => 1 Get the length of an array echo '[1, 2, 3, 4, 5]' | jq 'length' # => 5

Kube State Metrics

Kube state metrics exposes kubernetes metrics in a way that they can be scraped by prometheus. It uses the kubernetes API to create a snapshot of the state of your cluster, and then exposes that on &#x2F;metrics , ready to be ingested by your monitoring.

Linux

Just a reference page for all the linux things I forget Filesystem types fd00 - Linux RAID Creating software RAID device mdadm --create --verbose &#x2F;dev&#x2F;md<NUMBER> --level=<RAID LEVEL> --raid-devices=<DEVICES> &#x2F;dev&#x2F;one &#x2F;dev&#x2F;two ... Get device UUID blkid Networking Interfaces Interface names must be <16 chars Create bridge ip link add br0 type bridge Add IP to bridge ip…

PostgreSQL

Some postgres snippets! Just a reference page for the things I forget a lot. pg_ctl init -D path - init new database + config at path pg_hba.conf - configure host based auth pg_ident.conf - map system users to database users postgresql.conf - all the other config changes Learnings It&#x27;s faster to create a table with no index, copy data in, then add indices Using random_page_cost=1.1 for SSD…

Python

My Python reference page I don&#x27;t spend as much time building actual large projects in Python any more (though I was paid to write Python for a few years in my early career). These days it&#x27;s mostly just for random glue scripts on a variety of systems. Quick s3 client Setup an S3 client, with credentials loaded from the env. You actually don&#x27;t need to explicitly list the creds, so…

Resizing PVC for a Kubernetes Statefulset

If you&#x27;ve ever tried to resize a kubernetes statefulset PVC for a database deployment (or similar), you have probably seen this error Internal server error StatefulSet.apps "es-cluster" is invalid: spec: Forbidden: updates to statefulset > spec for fields other than &#x27;replicas&#x27;, &#x27;template&#x27;, and &#x27;updateStrategy&#x27; are forbidden. Edit all the PVCs manually: kubectl…

Rust

My Rust reference page Projects Atuin Cargo Run just integration tests cargo test --test '*' Run just unit tests cargo test --lib --bins Code git sha as string in code Useful for distribution, to report what revision was built. In build.rs : use std :: process :: Command ; fn main () { let output = Command :: new (" git ") . args ([" rev-parse ", " HEAD "]) . output (); let sha = match output { Ok…

Scaling Kube State Metrics

With larger clusters, you might find that scrapes begin to take time - kube state metrics might be exposing millions of samples, depending on how many nodes&#x2F;pods&#x2F;etc you have! KSM supports sharding, both automatically and manually. Unfortunately the autosharding is still very much in development Automatic sharding allows each shard to discover its nominal position when deployed in a…

Systemd could not open shared memory segment

I spent a while operating PostgreSQL running on an EC2 instance. We had a weird problem where sometimes queries would fail, with the error could not open shared memory segment "&#x2F;PostgreSQL.271741757" . For non-system (UID < 1000) users, logind will by default clear shared mem files upon logout. For things like databases, this is not at all desireable. One thing to note is that it&#x27;s…

Trigger Alertmanager Manually

I was setting up Alertmanager and needed to manually trigger an alert to make sure it works Something like this will do it, depending on your port: curl -H 'Content-Type: application&#x2F;json' -d '[{"labels":{"alertname":"test-alert"}}]' http:&#x2F;&#x2F;alertmanager:9093&#x2F;api&#x2F;v1&#x2F;alerts -> {"status": "success"}

Tuning ZFS for Postgres

recordsize=128 not that bad, actually preferring a scan to index for some reason. random_page_cost = 1 sorted that worked after running analyze and a couple of queries

Keeping notes in public

An update I liked this so much that I actually replaced my whole blog with it! Now my blog is just a part of the whole. Quartz updated around the time I wrote this, and it solved a bunch of my frustrations, so I&#x27;m using it now. I first blogged about having a personal wiki more than three years ago now. It was a nice try at solving the "I&#x27;d like to keep notes in public" problem, but it…

2022, my year in review

2022 has probably been one of the best years of my life, so I&#x27;d like to do my best to document everything that has happened - away from social media, and on something a little longer form! I try to take the possibility that every day could be my last pretty seriously, and I&#x27;m really happy that I can look back on this year and feel like I&#x27;ve made the most of it. I&#x27;m starting…

An iPod for 2022

This also ended up getting picked up by Vice , Hackaday , Techspot , as well as a whole bunch of other publications! Thank you so much for your interest in my work I shared this on Twitter recently, and have had a bunch of people ask me for more details - so here they are! Just a heads up that this is pretty image-heavy, in case you&#x27;re on a limited data plan. I&#x27;ve always been the sort of…