Ping 12
Ping 11
I'm being gaslit by the ai
I’ve been using this one for awhile now, I have a post type that I only edit from my phone, but I have all the post numbered. I set up a template in obsidian for using templater, the template goes right in the static site repo, I point templater to the templates directory and this has been working pretty seamlessly for awhile.
---
date: <% tp.date.now("YYYY-MM-DD HH:mm:ss") %>
templateKey: myposttype
published: true
tags:
- myposttype
<%*
const folder = "pages/myposttype";
// get all files in the vault, keep only those inside the folder
const files = app.vault.getFiles().filter(f => f.path.startsWith(folder + "/"));
// extract numeric suffixes from filenames like myposttype-123.md
const nums = files.map(f => {
const m = f.basename.match(/^myposttype-(\d+)$/);
return m ? parseInt(m[1], 10) : null;
}).filter(n => n !== null);
// next number (start at 1 if none exist)
const next = (nums.length ? Math.max(...nums) : 0) + 1;
// include the .md extension when moving
const newPath = `${folder}/myposttype-${next}`;
await tp.file.move(newPath);
%>
---
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"