notifications for static site builds
--name-status is a great way to see what files have changed in a git diff
alongside the status code. I recently used this in a script to create a report
of new and modified files during a build.
git diff --name-status
git diff --name-status origin/main
git diff --name-status --staged
git diff --name-status 'HEAD@{3 days ago}'
fast changing dev server today
The Right Reasons To Run Kubernetes In Your Homelab
I learned to today that setting MEMORY on your minecraft server causes the
JVM to egregiously allocate all of that memory. Not setting it causes slow
downs and potential crashes, but setting INIT_MEMORY and MAX_MEMORY gives
us the best of both worlds. It is allowed to use more, but does not gobble it
all up on startup.
In this economy we need to save all the memory we can!
Here is a non-working snippet for a minecraft server deployment in kubernetes.
containers:
- name: dungeon
image: itzg/minecraft-server
env:
- name: EULA
value: "true"
- name: INIT_MEMORY
value: "512M"
- name: MAX_MEMORY
value: "3G"
and in docker compose
dungeon:
image: itzg/minecraft-server
environment:
EULA: "true"
INIT_MEMORY: "512M"
MAX_MEMORY: "3G"
One Year Of Shots
I found snow-fall component from zachleat, and its beautiful… to me. I like the way it looks, its simple and whimsical.
Install #
There is an npm package <a href="https://zachleat.com" class="mention" data-name="Zach Leatherman" data-bio="A post by Zach Leatherman (zachleat)" data-avatar="https://www.zachleat.com/og/opengraph-default.png" data-handle="@zachleat">@zachleat</a>/snow-fall if that’s your thing. I like
vendoring in small things like this.
curl -o static/snow-fall.js https://raw.githubusercontent.com/zachleat/snow-fall/refs/heads/main/snow-fall.js
I generally save it in my justfile so that I remember how I got it and how to update…. yaya I could use npm, but I don’t for no build sites.
get-snowfall:
curl -o static/snow-fall.js https://raw.githubusercontent.com/zachleat/snow-fall/refs/heads/main/snow-fall.js
Usage #
Now add the component to your page.
<!-- This belongs somewhere inside <head> -->
<script type="module" src="snow-fall.js"></script> <!-- Adjust the src to your path -->
<!-- This belongs somewhere inside <body> -->
<!-- Anything before will be below the snow. -->
<snow-fall></snow-fall>
<!-- Anything after will show above the snow. -->
Today I learned an important lesson that you should periodically check on your kubeconfigs expiration date. It’s easy to do. You can ask for the client-certificate-data from your kubeconfig, decode it, and use openssl to get the expiration date.
kubectl config view --raw -o jsonpath='{.users[0].user.client-certificate-data}' \
| base64 -d 2>/dev/null \
| openssl x509 -noout -dates
Note
This will only work for the first user, if you have more than one user or context defined in your kubeconfig you will need to adjust.
Not every print needs supports
reminder Include steps to reproduce
All I want for Christmas is, filliment
When using two GitHub accounts the gh cli gives very easy gh auth switch workflow from the cli.
from the docs
gh auth switch –help Switch the active account for a GitHub host.
This command changes the authentication configuration that will be used when running commands targeting the specified GitHub host.
If the specified host has two accounts, the active account will be switched
automatically. If there are more than two accounts, disambiguation will be
required either through the --user flag or an interactive prompt.
# list accounts
gh auth status
# switch accounds (interactive if more than 2, i've never seen this personally)
gh auth switch
gpus are awesome and I need one for Bambu Studio to be usable in a
distrobox. Adding the --nvidia flag to distrobox create bind mounts the
nvidia /dev/ devices and sets up the necessary environment variables. Once
we are in there are a couple of packages to install to make it work.
distrobox create --name bambu-studio --image archlinux:latest --nvidia
distrobox enter bambu-studio
sudo pacman -S nvidia-utils lib32-nvidia-utils vulkan-icd-loader
nvidia-smi
glxinfo | gprep OpenGL
sudo pacman -Syu --needed base-devel git
git clone https://aur.archlinux.org/paru-bin.git
cd paru-bin
makepkg -si
paru -S bambustudio-bin
bambu-studio
distrobox-export --app bambu-studio
git worktrees are needed
The Wrong Reasons To Run Kubernetes In Your Homelab
my home row
I got the kubernetes in my basement autism
The k3s system-upgrade controller is a fantastic tool for upgrading k3s automatically. It has done a fantastic job for me every time I’ve used it. Today I ran it on a cluster that needed to upgrade several minors and I learned that the controller does not pick up on changes to the channel url if you change from minor to minor.
The solution I came up with was to name the plan with the version it supports. Then on each patch upgrade, change both the plan name and the channel. I use gitops with argocd, it automcatically cleaned up old plans, created new plans, and the system-upgrade-controller picked up the plan and started applying immediately.
# Server plan
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: server-plan-v1.33 # <- This is important if you want to change the channel name
namespace: system-upgrade
spec:
concurrency: 1
cordon: true
nodeSelector:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: In
values:
- "true"
serviceAccountName: system-upgrade
upgrade:
image: rancher/k3s-upgrade
channel: https://update.k3s.io/v1-release/channels/v1.33
---
# Agent plan
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: agent-plan-v1.33 # <- This is important if you want to change the channel name
namespace: system-upgrade
spec:
concurrency: 1
cordon: true
nodeSelector:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: DoesNotExist
prepare:
args:
- prepare
- server-plan
image: rancher/k3s-upgrade
serviceAccountName: system-upgrade
upgrade:
image: rancher/k3s-upgrade
channel: https://update.k3s.io/v1-release/channels/v1.33
I’d love to see a better way if you have a way to upgrade through minors, or manually control the minor of your cluster let me know.