From 30db7379ba631618f58bef2dc3b91feef7397437 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 27 Jul 2025 23:05:54 +0300 Subject: Update content for html --- ...5-07-14-f3s-kubernetes-with-freebsd-part-6.html | 23 +- gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html | 632 +++++++++++++++++++++ gemfeed/DRAFT-totalrecall.html | 300 ++++++++++ gemfeed/atom.xml | 25 +- 4 files changed, 967 insertions(+), 13 deletions(-) create mode 100644 gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html create mode 100644 gemfeed/DRAFT-totalrecall.html (limited to 'gemfeed') diff --git a/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.html b/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.html index 374ec9a2..7963fb4d 100644 --- a/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.html +++ b/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.html @@ -1611,6 +1611,22 @@ STATE_FILE="/var/run/nfs-mount.state" touch "$LOCK_FILE" trap "rm -f $LOCK_FILE" EXIT +mount_it () { + if mount "$MOUNT_POINT"; then + echo "NFS mount fixed at $(date)" | systemd-cat -t nfs-monitor -p info + rm -f "$STATE_FILE" + else + echo "Failed to fix NFS mount at $(date)" | systemd-cat -t nfs-monitor -p err + exit 1 + fi +} + +# Quick check - ensure it's actually mounted +if ! mountpoint -q "$MOUNT_POINT"; then + echo "NFS mount not found at $(date)" | systemd-cat -t nfs-monitor -p err + mount_it +fi + # Quick check - try to stat a directory with a very short timeout if timeout 2s stat "$MOUNT_POINT" >/dev/null 2>&1; then # Mount appears healthy @@ -1634,12 +1650,7 @@ echo "Attempting to fix stale NFS mount at $(date)" umount -f "$MOUNT_POINT" 2>/dev/null sleep 1 -if mount "$MOUNT_POINT"; then - echo "NFS mount fixed at $(date)" | systemd-cat -t nfs-monitor -p info - rm -f "$STATE_FILE" -else - echo "Failed to fix NFS mount at $(date)" | systemd-cat -t nfs-monitor -p err -fi +mount_it EOF [root@r0 ~]# chmod +x /usr/local/bin/check-nfs-mount.sh diff --git a/gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html b/gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html new file mode 100644 index 00000000..7a359b19 --- /dev/null +++ b/gemfeed/DRAFT-kubernetes-with-freebsd-part-7.html @@ -0,0 +1,632 @@ + + + + +f3s: Kubernetes with FreeBSD - Part 7: First pod deployments + + + + + +

+Home | Markdown | Gemini +

+

f3s: Kubernetes with FreeBSD - Part 7: First pod deployments


+
+This is the seventh blog post about the f3s series for self-hosting demands in a home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution used on FreeBSD-based physical machines.
+
+2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage
+2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
+2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
+2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
+2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
+2025-07-14 f3s: Kubernetes with FreeBSD - Part 6: Storage
+
+f3s logo
+
+

Table of Contents


+
+
+

Introduction


+
+

Updating


+
+On all three Rocky Linux 9 boxes r0, r1, and r2:
+
+ +
dnf update -y
+reboot
+
+
+On the FreeBSD hosts, upgrading from FreeBSD 14.2 to 14.3-RELEASE, running this on all three hosts f0, f1 and f2:
+
+ +
paul@f0:~ % doas freebsd-update fetch
+paul@f0:~ % doas freebsd-update install
+paul@f0:~ % doas reboot
+.
+.
+.
+paul@f0:~ % doas freebsd-update -r 14.3-RELEASE upgrade
+paul@f0:~ % doas freebsd-update install
+paul@f0:~ % doas freebsd-update install
+paul@f0:~ % doas reboot
+.
+.
+.
+paul@f0:~ % doas freebsd-update install
+paul@f0:~ % doas pkg update
+paul@f0:~ % doas pkg upgrade
+paul@f0:~ % doas reboot
+.
+.
+.
+paul@f0:~ % uname -a
+FreeBSD f0.lan.buetow.org 14.3-RELEASE FreeBSD 14.3-RELEASE
+        releng/14.3-n271432-8c9ce319fef7 GENERIC amd64
+
+
+

Installing k3s


+
+

Generating K3S_TOKEN and starting first k3s node


+
+Generating the k3s token on my Fedora Laptop with pwgen -n 32 and selected one. And then on all 3 r hosts (replace SECRET_TOKEN with the actual secret!! before running the following command) run:
+
+ +
[root@r0 ~]# echo -n SECRET_TOKEN > ~/.k3s_token
+
+
+The following steps are also documented on the k3s website:
+
+https://docs.k3s.io/datastore/ha-embedded
+
+So on r0 we run:
+
+ +
[root@r0 ~]# curl -sfL https://get.k3s.io | K3S_TOKEN=$(cat ~/.k3s_token) \
+        sh -s - server --cluster-init --tls-san=r0.wg0.wan.buetow.org
+[INFO]  Finding release for channel stable
+[INFO]  Using v1.32.6+k3s1 as release
+.
+.
+.
+[INFO]  systemd: Starting k3s
+
+
+

Adding the remaining nodes to the cluster


+
+And we run on the other two nodes r1 and r2:
+
+ +
[root@r1 ~]# curl -sfL https://get.k3s.io | K3S_TOKEN=$(cat ~/.k3s_token) \
+        sh -s - server --server https://r0.wg0.wan.buetow.org:6443 \
+        --tls-san=r1.wg0.wan.buetow.org
+
+[root@r2 ~]# curl -sfL https://get.k3s.io | K3S_TOKEN=$(cat ~/.k3s_token) \
+        sh -s - server --server https://r0.wg0.wan.buetow.org:6443 \
+        --tls-san=r2.wg0.wan.buetow.org
+.
+.
+.
+
+
+
+Once done, we've got a 3 node Kubernetes cluster control plane:
+
+ +
[root@r0 ~]# kubectl get nodes
+NAME                STATUS   ROLES                       AGE     VERSION
+r0.lan.buetow.org   Ready    control-plane,etcd,master   4m44s   v1.32.6+k3s1
+r1.lan.buetow.org   Ready    control-plane,etcd,master   3m13s   v1.32.6+k3s1
+r2.lan.buetow.org   Ready    control-plane,etcd,master   30s     v1.32.6+k3s1
+
+[root@r0 ~]# kubectl get pods --all-namespaces
+NAMESPACE     NAME                                      READY   STATUS      RESTARTS   AGE
+kube-system   coredns-5688667fd4-fs2jj                  1/1     Running     0          5m27s
+kube-system   helm-install-traefik-crd-f9hgd            0/1     Completed   0          5m27s
+kube-system   helm-install-traefik-zqqqk                0/1     Completed   2          5m27s
+kube-system   local-path-provisioner-774c6665dc-jqlnc   1/1     Running     0          5m27s
+kube-system   metrics-server-6f4c6675d5-5xpmp           1/1     Running     0          5m27s
+kube-system   svclb-traefik-411cec5b-cdp2l              2/2     Running     0          78s
+kube-system   svclb-traefik-411cec5b-f625r              2/2     Running     0          4m58s
+kube-system   svclb-traefik-411cec5b-twrd7              2/2     Running     0          4m2s
+kube-system   traefik-c98fdf6fb-lt6fx                   1/1     Running     0          4m58s
+
+
+In order to connect with kubect from my Fedora Laptop, I had to copy /etc/rancher/k3s/k3s.yaml from r0 to ~/.kube/config and then replace the value of the server field with r0.lan.buetow.org. kubectl can now manage the cluster. Note this step has to be repeated when we want to connect to another node of the cluster (e.g. when r0 is down).
+
+

Test deployments


+
+

Test deployment to Kubernetes


+
+Let's create a test namespace:
+
+ +
> ~ kubectl create namespace test
+namespace/test created
+
+> ~ kubectl get namespaces
+NAME              STATUS   AGE
+default           Active   6h11m
+kube-node-lease   Active   6h11m
+kube-public       Active   6h11m
+kube-system       Active   6h11m
+test              Active   5s
+
+> ~ kubectl config set-context --current --namespace=test
+Context "default" modified.
+
+
+And let's also create an apache test pod:
+
+ +
> ~ cat <<END > apache-deployment.yaml
+# Apache HTTP Server Deployment
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: apache-deployment
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: apache
+  template:
+    metadata:
+      labels:
+        app: apache
+    spec:
+      containers:
+      - name: apache
+        image: httpd:latest
+        ports:
+        # Container port where Apache listens
+        - containerPort: 80
+END
+
+> ~ kubectl apply -f apache-deployment.yaml
+deployment.apps/apache-deployment created
+
+> ~ kubectl get all
+NAME                                     READY   STATUS    RESTARTS   AGE
+pod/apache-deployment-5fd955856f-4pjmf   1/1     Running   0          7s
+
+NAME                                READY   UP-TO-DATE   AVAILABLE   AGE
+deployment.apps/apache-deployment   1/1     1            1           7s
+
+NAME                                           DESIRED   CURRENT   READY   AGE
+replicaset.apps/apache-deployment-5fd955856f   1         1         1       7s
+
+
+Let's also create a service:
+
+ +
> ~ cat <<END > apache-service.yaml
+apiVersion: v1
+kind: Service
+metadata:
+  labels:
+    app: apache
+  name: apache-service
+spec:
+  ports:
+    - name: web
+      port: 80
+      protocol: TCP
+      # Expose port 80 on the service
+      targetPort: 80
+  selector:
+  # Link this service to pods with the label app=apache
+    app: apache
+END
+
+> ~ kubectl apply -f apache-service.yaml
+service/apache-service created
+
+> ~ kubectl get service
+NAME             TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
+apache-service   ClusterIP   10.43.249.165   <none>        80/TCP    4s
+
+
+And also an ingress:
+
+Note: I've modified the hosts listed in this example after I've published this blog post. This is to ensure that there aren't any bots scarping it.
+
+ +
> ~ cat <<END > apache-ingress.yaml
+
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: apache-ingress
+  namespace: test
+  annotations:
+    spec.ingressClassName: traefik
+    traefik.ingress.kubernetes.io/router.entrypoints: web
+spec:
+  rules:
+    - host: f3s.foo.zone
+      http:
+        paths:
+          - path: /
+            pathType: Prefix
+            backend:
+              service:
+                name: apache-service
+                port:
+                  number: 80
+    - host: standby.f3s.foo.zone
+      http:
+        paths:
+          - path: /
+            pathType: Prefix
+            backend:
+              service:
+                name: apache-service
+                port:
+                  number: 80
+    - host: www.f3s.foo.zone
+      http:
+        paths:
+          - path: /
+            pathType: Prefix
+            backend:
+              service:
+                name: apache-service
+                port:
+                  number: 80
+END
+
+> ~ kubectl apply -f apache-ingress.yaml
+ingress.networking.k8s.io/apache-ingress created
+
+> ~ kubectl describe ingress
+Name:             apache-ingress
+Labels:           <none>
+Namespace:        test
+Address:          192.168.1.120,192.168.1.121,192.168.1.122
+Ingress Class:    traefik
+Default backend:  <default>
+Rules:
+  Host                    Path  Backends
+  ----                    ----  --------
+  f3s.foo.zone
+                          /   apache-service:80 (10.42.1.11:80)
+  standby.f3s.foo.zone
+                          /   apache-service:80 (10.42.1.11:80)
+  www.f3s.foo.zone
+                          /   apache-service:80 (10.42.1.11:80)
+Annotations:              spec.ingressClassName: traefik
+                          traefik.ingress.kubernetes.io/router.entrypoints: web
+Events:                   <none>
+
+
+Notes:
+
+
+So let's test the Apache webserver through the ingress rule:
+
+ +
> ~ curl -H "Host: www.f3s.foo.zone" http://r0.lan.buetow.org:80
+<html><body><h1>It works!</h1></body></html>
+
+
+

Test deployment with persistent volume claim


+
+So let's modify the Apache example to serve the htdocs directory from the NFS share we created in the previous blog post. We are using the following manifests. The majority of the manifests are the same as before, except for the persistent volume claim and the volume mount in the Apache deployment.
+
+ +
> ~ cat <<END > apache-deployment.yaml
+# Apache HTTP Server Deployment
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: apache-deployment
+  namespace: test
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: apache
+  template:
+    metadata:
+      labels:
+        app: apache
+    spec:
+      containers:
+      - name: apache
+        image: httpd:latest
+        ports:
+        # Container port where Apache listens
+        - containerPort: 80
+        volumeMounts:
+        - name: apache-htdocs
+          mountPath: /usr/local/apache2/htdocs/
+      volumes:
+      - name: apache-htdocs
+        persistentVolumeClaim:
+          claimName: example-apache-pvc
+END
+
+> ~ cat <<END > apache-ingress.yaml
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: apache-ingress
+  namespace: test
+  annotations:
+    spec.ingressClassName: traefik
+    traefik.ingress.kubernetes.io/router.entrypoints: web
+spec:
+  rules:
+    - host: f3s.buetow.org
+      http:
+        paths:
+          - path: /
+            pathType: Prefix
+            backend:
+              service:
+                name: apache-service
+                port:
+                  number: 80
+    - host: standby.f3s.buetow.org
+      http:
+        paths:
+          - path: /
+            pathType: Prefix
+            backend:
+              service:
+                name: apache-service
+                port:
+                  number: 80
+    - host: www.f3s.buetow.org
+      http:
+        paths:
+          - path: /
+            pathType: Prefix
+            backend:
+              service:
+                name: apache-service
+                port:
+                  number: 80
+END
+
+> ~ cat <<END > apache-persistent-volume.yaml
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: example-apache-pv
+spec:
+  capacity:
+    storage: 1Gi
+  volumeMode: Filesystem
+  accessModes:
+    - ReadWriteOnce
+  persistentVolumeReclaimPolicy: Retain
+  hostPath:
+    path: /data/nfs/k3svolumes/example-apache-volume-claim
+    type: Directory
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: example-apache-pvc
+  namespace: test
+spec:
+  storageClassName: ""
+  accessModes:
+    - ReadWriteOnce
+  resources:
+    requests:
+      storage: 1Gi
+END
+
+> ~ cat <<END > apache-service.yaml
+apiVersion: v1
+kind: Service
+metadata:
+  labels:
+    app: apache
+  name: apache-service
+  namespace: test
+spec:
+  ports:
+    - name: web
+      port: 80
+      protocol: TCP
+      # Expose port 80 on the service
+      targetPort: 80
+  selector:
+  # Link this service to pods with the label app=apache
+    app: apache
+END
+
+
+And let's apply the manifests:
+
+ +
> ~ kubectl apply -f apache-persistent-volume.yaml
+> ~ kubectl apply -f apache-service.yaml
+> ~ kubectl apply -f apache-deployment.yaml
+> ~ kubectl apply -f apache-ingress.yaml
+
+
+So looking at the deployment, it failed now, as the directory doesn't exist yet on the NFS share:
+
+ +
> ~ kubectl get pods
+NAME                                 READY   STATUS              RESTARTS   AGE
+apache-deployment-5b96bd6b6b-fv2jx   0/1     ContainerCreating   0          9m15s
+
+> ~ kubectl describe pod apache-deployment-5b96bd6b6b-fv2jx | tail -n 5
+Events:
+  Type     Reason       Age                   From               Message
+  ----     ------       ----                  ----               -------
+  Normal   Scheduled    9m34s                 default-scheduler  Successfully
+    assigned test/apache-deployment-5b96bd6b6b-fv2jx to r2.lan.buetow.org
+  Warning  FailedMount  80s (x12 over 9m34s)  kubelet            MountVolume.SetUp
+    failed for volume "example-apache-pv" : hostPath type check failed:
+    /data/nfs/k3svolumes/example-apache is not a directory
+
+
+This is on purpose! We need to create the directory on the NFS share first, so let's do that (e.g. on r0):
+
+ +
[root@r0 ~]# mkdir /data/nfs/k3svolumes/example-apache-volume-claim/
+
+[root@r0 ~ ] cat <<END > /data/nfs/k3svolumes/example-apache-volume-claim/index.html
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Hello, it works</title>
+</head>
+<body>
+  <h1>Hello, it works!</h1>
+  <p>This site is served via a PVC!</p>
+</body>
+</html>
+END
+
+
+The index.html file was also created to serve content along the way. After deleting the pod, it recreates itself, and the volume mounts correctly:
+
+ +
> ~ kubectl delete pod apache-deployment-5b96bd6b6b-fv2jx
+
+> ~ curl -H "Host: www.f3s.buetow.org" http://r0.lan.buetow.org:80
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Hello, it works</title>
+</head>
+<body>
+  <h1>Hello, it works!</h1>
+  <p>This site is served via a PVC!</p>
+</body>
+</html>
+
+
+

Make it accessible from the public internet


+
+Next, this should be made accessible through the public internet via the www.f3s.foo.zone hosts. As a reminder, refer back to part 1 of this series and review the section titled "OpenBSD/relayd to the rescue for external connectivity":
+
+f3s: Kubernetes with FreeBSD - Part 1: Setting the stage
+
+All apps should be reachable through the internet (e.g., from my phone or computer when travelling). For external connectivity and TLS management, I've got two OpenBSD VMs (one hosted by OpenBSD Amsterdam and another hosted by Hetzner) handling public-facing services like DNS, relaying traffic, and automating Let's Encrypt certificates.
+
+All of this (every Linux VM to every OpenBSD box) will be connected via WireGuard tunnels, keeping everything private and secure. There will be 6 WireGuard tunnels (3 k3s nodes times two OpenBSD VMs).
+
+So, when I want to access a service running in k3s, I will hit an external DNS endpoint (with the authoritative DNS servers being the OpenBSD boxes). The DNS will resolve to the master OpenBSD VM (see my KISS highly-available with OpenBSD blog post), and from there, the relayd process (with a Let's Encrypt certificate—see my Let's Encrypt with OpenBSD and Rex blog post) will accept the TCP connection and forward it through the WireGuard tunnel to a reachable node port of one of the k3s nodes, thus serving the traffic.
+
+ +
> ~ curl https://f3s.foo.zone
+<html><body><h1>It works!</h1></body></html>
+
+> ~ curl https://www.f3s.foo.zone
+<html><body><h1>It works!</h1></body></html>
+
+> ~ curl https://standby.f3s.foo.zone
+<html><body><h1>It works!</h1></body></html>
+
+
+

Failure test


+
+Shutting down f0 and let NFS failing over for the Apache content.
+
+
+TODO: include k9s screenshot
+TODO: include a diagram again?
+
+Other *BSD-related posts:
+
+2025-07-14 f3s: Kubernetes with FreeBSD - Part 6: Storage
+2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
+2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
+2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
+2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
+2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage
+2024-04-01 KISS high-availability with OpenBSD
+2024-01-13 One reason why I love OpenBSD
+2022-10-30 Installing DTail on OpenBSD
+2022-07-30 Let's Encrypt with OpenBSD and Rex
+2016-04-09 Jails and ZFS with Puppet on FreeBSD
+
+E-Mail your comments to paul@nospam.buetow.org
+
+Back to the main site
+
+
+Note, that I've modified the hosts after I'd published this blog post. This is to ensure that there aren't any bots scarping it.
+ + + diff --git a/gemfeed/DRAFT-totalrecall.html b/gemfeed/DRAFT-totalrecall.html new file mode 100644 index 00000000..ee639103 --- /dev/null +++ b/gemfeed/DRAFT-totalrecall.html @@ -0,0 +1,300 @@ + + + + +TotalRecall: Learning Bulgarian with AI and Anki + + + + + +

+Home | Markdown | Gemini +

+

TotalRecall: Learning Bulgarian with AI and Anki


+
+Published at 2025-01-22T10:30:00+02:00
+
+Learning a new language is hard. Learning Bulgarian? That's a special kind of challenge. The Cyrillic script, the complex grammar, the pronunciation - it all adds up. But what if we could leverage AI to make flashcard creation instant and effortless? That's where TotalRecall comes in.
+
+TotalRecall on GitHub
+
+
+ ╔══════════════════════════════╗
+ ║  🇧🇬  TOTALRECALL  🧠        ║
+ ║  ┌─────────┐  ┌─────────┐   ║
+ ║  │ ябълка  │→ │  🍎     │   ║
+ ║  │ [audio] │  │ "apple" │   ║
+ ║  └─────────┘  └─────────┘   ║
+ ╚══════════════════════════════╝
+
+
+

Table of Contents


+
+
+

Why TotalRecall exists


+
+Two motivations drove me to create this tool:
+
+

Learning Bulgarian


+
+I've been fascinated by the Bulgarian language for a while now. It's the oldest written Slavic language, and Sofia has become quite the tech hub. But finding good learning materials? That's tough. Most apps focus on the big languages - Spanish, French, German. Bulgarian gets the short end of the stick.
+
+AnkiDroid has been my go-to for spaced repetition learning. It's powerful, customizable, and works offline. But creating cards manually? That's tedious. Type the word, find an image, record audio, format everything... By the time you've made 10 cards, you're exhausted.
+
+

Practicing agentic coding


+
+The second reason is more technical. I wanted to explore agentic coding - letting AI assistants help write and refactor code. TotalRecall became my playground for this experiment. Could I build something useful while learning how to effectively collaborate with AI coding assistants?
+
+Turns out, yes. The combination of human creativity and AI assistance is powerful. I set the architecture, made design decisions, and the AI helped with implementation details, test writing, and refactoring.
+
+

How it works


+
+TotalRecall is beautifully simple:
+
+ +
totalrecall "ябълка"
+
+
+That's it. One command, and you get a complete flashcard with everything you need. But there's sophisticated AI magic happening behind the scenes.
+
+

The AI pipeline


+
+When you run that command, TotalRecall orchestrates multiple OpenAI API calls:
+
+1. **Translation** - Bidirectional translation (Bulgarian ↔ English) to understand the word's meaning
+2. **Phonetic transcription** - IPA notation for precise pronunciation guidance
+3. **Scene description** - AI generates a culturally appropriate scene description for the image
+4. **Image generation** - DALL-E creates a memorable visual based on the scene description
+5. **Audio synthesis** - High-quality TTS pronunciation that can be regenerated with different voices
+
+All this happens in seconds. The result? A rich, multi-sensory flashcard that engages visual, auditory, and linguistic memory systems.
+
+

Why OpenAI for everything?


+
+I could have used Google Translate for translations, or pulled IPA from Wiktionary. But OpenAI's models understand context. When you input "банка", it knows whether you mean "bank" (financial) or "jar" based on usage patterns. The scene descriptions are culturally aware - Bulgarian bread looks different from American bread, and the AI knows this.
+
+

The science of memorable flashcards


+
+After reading extensively about language learning and memory techniques, I've built TotalRecall to create cards that stick. Here's why our approach works:
+
+

No English on the front


+
+The cards show only Bulgarian text and images - no English translations on the front. This forces your brain to recall meaning from context and imagery, creating stronger neural pathways. When you see "ябълка" with an apple image, your brain learns to connect the Bulgarian word directly to the concept, not to the English word "apple."
+
+

The power of personal connection


+
+The best flashcards include personal context. While TotalRecall generates generic images, I recommend adding your own notes about where you first encountered the word. Did you see "хляб" (bread) at a Bulgarian bakery? Add that story. Personal connections make memories stick. So at will, a custom image prompt (not AI generated) can be specified.
+
+

Sound comes first


+
+Native pronunciation from day one is crucial. That's why every card includes audio. Your brain needs to hear the rhythm and melody of Bulgarian, not your English-accented approximation. The OpenAI voices aren't perfect, but they're leagues better than text-to-speech engines of the past. Plus, you can regenerate audio with different voices if one doesn't sound quite right.
+
+

Images over translations


+
+A picture of bread teaches "хляб" better than the word "bread" ever could. Images bypass linguistic processing and create direct conceptual links. DALL-E generates contextually appropriate images - Bulgarian bread looks different from Wonder Bread, and these cultural nuances matter.
+
+

IPA for precision


+
+The phonetic transcriptions are gold for pronunciation. Bulgarian has sounds that don't exist in English. The IPA shows you exactly where to place your tongue, how to shape your lips. It's the difference between sounding foreign and sounding fluent.
+
+

Spaced repetition: The secret sauce


+
+Anki's algorithm is based on the spacing effect - we remember things better when we review them at increasing intervals. Here's how to maximize it:
+
+

Start small, stay consistent


+
+Don't add 100 words on day one. Start with 10-15 new cards daily. Consistency beats intensity. Your brain needs time to consolidate memories during sleep.
+
+

Review first, add new cards second


+
+Always clear your review queue before adding new cards. Reviews are where the real learning happens. New cards are just seeds - reviews make them grow.
+
+

Trust the algorithm


+
+When Anki says to review a card in 4 months, trust it. The urge to over-review is strong, but it actually weakens memory formation. Let your brain struggle a bit - that's where learning happens.
+
+

Quality over quantity


+
+One well-made card beats ten mediocre ones. TotalRecall ensures quality with:
+- Clear, native audio with regeneration options
+- Relevant, memorable images from scene-aware descriptions
+- IPA transcriptions for pronunciation precision
+- Clean, distraction-free formatting
+
+

The technical bits


+
+Written in Go because I wanted something fast and portable. The architecture is clean:
+
+
+internal/
+├── audio/     # OpenAI TTS integration
+├── image/     # DALL-E image generation
+├── anki/      # Card formatting
+├── phonetic/  # IPA transcription fetching
+├── translation/ # Bidirectional translation
+└── config/    # YAML configuration
+
+
+Each package has a single responsibility. The audio package doesn't know about images. The image package doesn't know about Anki. Clean interfaces everywhere.
+
+

Agentic coding insights


+
+Working with AI assistants taught me several valuable lessons:
+
+

Clear communication is crucial


+
+Vague requests get vague results. "Make it better" doesn't work. "Refactor this 80-line function into smaller functions, each handling one responsibility" does. The AI needs specific, actionable instructions.
+
+

AI excels at boilerplate and testing


+
+Writing comprehensive test suites? Perfect AI task. Implementing error handling patterns? Also great. Creative architecture decisions? Still very much a human job. The AI is your implementation partner, not your architect.
+
+

The scaling challenge


+
+Here's the hard truth about agentic coding: it gets exponentially harder as your codebase grows. When TotalRecall was 500 lines, the AI could keep everything in context. At 2000 lines? Not so much.
+
+Features start colliding in unexpected ways. You add batch processing, and suddenly the GUI breaks because it assumes single-word input. You change the default output directory, and it updates in the GUI but not in the CLI batch mode. The AI doesn't see these connections because it can't hold your entire codebase in memory.
+
+

Code duplication becomes a real problem


+
+The AI tends to solve problems locally. Need to validate Bulgarian input? It'll write a validation function right where you need it. Need it again elsewhere? It'll write another one. Before you know it, you have three different ways to validate Cyrillic text.
+
+This isn't the AI being dumb - it's optimizing for the local context you've given it. The burden of architectural consistency falls on you, the human.
+
+

Tests are your safety net


+
+The larger the codebase, the more critical comprehensive tests become. Every time the AI touches code, it might break something three files away. Without tests, you won't know until a user complains.
+
+My rule: before any AI-assisted refactoring, ensure test coverage. The AI is great at writing tests, so use it! Have it write tests for existing code before modifying anything. Then, when it inevitably breaks something, you'll know immediately.
+
+

The context window problem


+
+Modern AI assistants have impressive context windows, but they're not infinite. As TotalRecall grew, I had to become strategic about what context to provide. The entire codebase? Too much. Just the current file? Too little.
+
+The sweet spot: provide the interface definitions, the specific module you're working on, and any directly dependent code. Let the AI know about the broader architecture through comments and documentation, not by dumping everything into context.
+
+So after every feature, clear the context window and/or compact it to start fresh.
+
+

My learning workflow


+
+Here's how I use TotalRecall in practice:
+
+

Morning routine


+
+
+

Encountering new words


+
+When I find a new Bulgarian word (in articles, videos, conversations):
+
+1. Immediately run totalrecall "word"
+2. Add personal context in Anki notes
+3. Tag it with source (e.g., #news, #conversation)
+
+

Weekly maintenance


+- Delete cards for words I'll never use
+- Suspend cards I've truly mastered
+- Adjust ease factors for consistently hard cards
+
+

Future plans


+
+TotalRecall already packs a lot of features, but I'm planning more:
+- Batch processing for word lists
+- Support for phrases and sentences
+- Grammar pattern recognition
+- Integration with Bulgarian dictionaries
+- Automatic difficulty scoring based on word frequency
+- Multiple image generation options per word
+- Voice selection preferences per word
+
+But the real goal? Building a comprehensive Bulgarian deck for AnkiDroid. One command at a time, one word at a time.
+
+

Tips for language learners


+
+

Focus on frequency


+Learn the most common 1000 words first. In any language, the top 1000 words cover ~80% of everyday conversation. TotalRecall will eventually include frequency data to help prioritize.
+
+

Use memory palaces


+Assign Bulgarian words to locations in your home. Put "хладилник" (refrigerator) on your actual fridge. Spatial memory is incredibly powerful.
+
+

Study before sleep


+Review your hardest cards right before bed. Your brain consolidates memories during sleep, especially from the last hour before sleeping.
+
+

Embrace the mess


+Language learning is messy. You'll mix up cases, forget words you "knew" yesterday, and butcher pronunciation. That's normal. TotalRecall makes it easy to try again tomorrow.
+
+

Try it yourself


+
+If you're learning Bulgarian (or want to experiment with agentic coding), give TotalRecall a spin:
+
+ +
go install github.com/yourusername/totalrecall@latest
+export OPENAI_API_KEY="your-key"
+totalrecall "котка"  # cat
+totalrecall "куче"   # dog
+totalrecall "вода"   # water
+
+
+Learning languages should be fun, not tedious. Let's make better tools.
+
+E-Mail your comments to paul@nospam.buetow.org :-)
+
+Other related posts are:
+
+
+Back to the main site
+ + + diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 311b5eda..db00b626 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2025-07-20T09:06:35+03:00 + 2025-07-27T23:04:32+03:00 foo.zone feed To be in the .zone! @@ -1618,6 +1618,22 @@ STATE_FILE="/var/run/nfs-mount.state" touch "$LOCK_FILE" trap "rm -f $LOCK_FILE" EXIT +mount_it () { + if mount "$MOUNT_POINT"; then + echo "NFS mount fixed at $(date)" | systemd-cat -t nfs-monitor -p info + rm -f "$STATE_FILE" + else + echo "Failed to fix NFS mount at $(date)" | systemd-cat -t nfs-monitor -p err + exit 1 + fi +} + +# Quick check - ensure it's actually mounted +if ! mountpoint -q "$MOUNT_POINT"; then + echo "NFS mount not found at $(date)" | systemd-cat -t nfs-monitor -p err + mount_it +fi + # Quick check - try to stat a directory with a very short timeout if timeout 2s stat "$MOUNT_POINT" >/dev/null 2>&1; then # Mount appears healthy @@ -1641,12 +1657,7 @@ echo "Attempting to fix stale NFS mount at $(date)" umount -f "$MOUNT_POINT" 2>/dev/null sleep 1 -if mount "$MOUNT_POINT"; then - echo "NFS mount fixed at $(date)" | systemd-cat -t nfs-monitor -p info - rm -f "$STATE_FILE" -else - echo "Failed to fix NFS mount at $(date)" | systemd-cat -t nfs-monitor -p err -fi +mount_it EOF [root@r0 ~]# chmod +x /usr/local/bin/check-nfs-mount.sh -- cgit v1.2.3