Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions content/posts/04-jetkvm-tailscale.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
---
title: Getting Tailscale to work on my JetKVM
updated: 05-01-2025
---

Earlier this week I got my [JetKVM](https://jetkvm.com) in the mail. There's plenty of posts out there about how awesome it is, so I won't bother to write another post reiterating that. Well, maybe briefly: it is in fact awesome. You should by one.

## Remotely accessing my JetKVM

While the folks behind this product seem smart enough, I'm always skeptical about using new cloud services, especially when they have a direct line to my PC. Rather than use their [Remote Access](https://jetkvm.com/docs/networking/remote-access) feature, I was happy to see that they also had a link in their FAQ pointing to an article on Medium called [Installing Tailscale on JetKVM](https://medium.com/@brandontuttle/installing-tailscale-on-a-jetkvm-3c72355b7eb0). This unfortunately did not work for me without some minor tweaks.
While the folks behind this product seem smart enough, I'm always skeptical about using new cloud services, especially when they have a direct line to my PC. Rather than use their [Remote Access](https://jetkvm.com/docs/networking/remote-access) feature, I was happy to see that they also had a link in their FAQ pointing to an article on Medium called [Installing Tailscale on JetKVM](https://medium.com/@brandontuttle/installing-tailscale-on-a-jetkvm-3c72355b7eb0). This unfortunately did not work for me without some minor tweaks.

### Getting Tailscale to start automatically

Because JetKVM is built on top of busybox (for better or worse - worse IMHO), it lacks a modern init system. Other than being a good introduction for less experienced folks into how things used to be before systemd, it is a bit of a pain to work with.
Expand Down Expand Up @@ -72,6 +75,7 @@ case "$1" in
;;
esac
```

## Orthogonal issue with non-persistent MAC address

During the process of setting up my JetKVM, I noticed that I was getting a new IP every time the device restarted. The first thing I tried was to give in a static IP through my UniFi console, but was surprised when after a reboot I got yet another IP. This led to me finding this [GitHub issue](https://github.com/jetkvm/kvm/issues/375)that has a ton of activity on it. I suspect this will be fixed soon, but in the meantime, [this comment](https://github.com/jetkvm/kvm/issues/375#issuecomment-2832773429) had a solution that resolves the issue.
During the process of setting up my JetKVM, I noticed that I was getting a new IP every time the device restarted. The first thing I tried was to give in a static IP through my UniFi console, but was surprised when after a reboot I got yet another IP. This led to me finding this [GitHub issue](https://github.com/jetkvm/kvm/issues/375)that has a ton of activity on it. I suspect this will be fixed soon, but in the meantime, [this comment](https://github.com/jetkvm/kvm/issues/375#issuecomment-2832773429) had a solution that resolves the issue.
11 changes: 6 additions & 5 deletions content/posts/05-kind-podman-exec-as-root.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Obtaining root access in a pod running under kind on Podman
updated: 05-03-2025
---

I am using a development environment that utilizes [`kind`](https://kind.sigs.k8s.io/) running under [rootless Podman](https://kind.sigs.k8s.io/docs/user/rootless/#creating-a-kind-cluster-with-rootless-podman). Here's how I was able to save some time while debugging and avoid needing to rebuild/redeploy when testing changes to containers that are not running as root.
Expand All @@ -13,23 +14,23 @@ $ podman exec -ti kind-control-plane bash
Next, locate the container we want to access:

```
root@kind-control-plane:/# crictl ps | grep api
root@kind-control-plane:/# crictl ps | grep api
46fc42d2ed03c       09ba385429956       16 minutes ago      Running             api                    0                   8f72c70f538a5       my-app-8544786747-rzwlp                  default
```

Obtain the full ID:

```
root@kind-control-plane:/# crictl inspect 46fc42d2ed03c | jq -r '.status.id'
root@kind-control-plane:/# crictl inspect 46fc42d2ed03c | jq -r '.status.id'
46fc42d2ed03c7e42452725bcdea05c089958b1d2c62f4d68526c2640e8cab8a
```

Now we can gain root access to our container:

```
root@kind-control-plane:/# ctr --namespace k8s.io tasks exec --user 0 --exec-id debug --tty 46fc42d2ed03c7e42452725bcdea05c089958b1d2c62f4d68526c2640e8ca
b8a /bin/sh
sh-4.4# id -u   
root@kind-control-plane:/# ctr --namespace k8s.io tasks exec --user 0 --exec-id debug --tty 46fc42d2ed03c7e42452725bcdea05c089958b1d2c62f4d68526c2640e8ca
b8a /bin/sh
sh-4.4# id -u   
0
```

Expand Down
62 changes: 33 additions & 29 deletions content/posts/06-golang-debugging-on-fedora-atomic.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
title: Debuging a Golang project on a Fedora Atomic Desktop (with Emacs and Dape)
---

A couple months ago, I tried to get [Dape](https://github.com/svaante/dape) working with a Golang project and ran into a couple of problems that prevented me from being able to use it. Today I decided to revisit it, and I'm glad I did, because it was one of the last remaining reasons I had for ever needing to open VSCode.

## First attempt at using Dape with a Golang project

### Problem 1 - passing arguments

In the top-level of my repo, I created the file `.dir-locals.el` with the following content:

```lisp
Expand Down Expand Up @@ -108,15 +112,15 @@ go-debug-main :args ["build"]
I then tried to update my `.dir-locals.el` with the bracket notation:

```diff
diff --git a/.dir-locals.el b/.dir-locals.el
index 65e164b..9995c3a 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -11,4 +11,4 @@
          :type "go"
          :showLog "true"
          :program "/home/shanemcd/github/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go"
-          :args ("build")))))))
diff --git a/.dir-locals.el b/.dir-locals.el
index 65e164b..9995c3a 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -11,4 +11,4 @@
          :type "go"
          :showLog "true"
          :program "/home/shanemcd/github/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go"
-          :args ("build")))))))
+          :args ["build"]))))))
```

Expand Down Expand Up @@ -161,27 +165,27 @@ Detaching

Now with the command invocation working, I proceeded with trying to set a breakpoint in the Skaffold code with `dape-breakpoint-toggle C-x C-a b`. Doing that and then re-running `dape`, I was surprised to see that the breakpoint did not hit as I was expecting.

After describing my problem to ChatGPT, it inferred from our previous chats that I was using Fedora Kinoite, and it pointed out right away that symlinks (Fedora Atomic Desktops link `/home/` to `/var/home`) were known to cause problem in debuggers. After a quick search, that was easy to confirm after locating [this note](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#debug-symlink-directories) in the `vscode-go` docs. I was able to get around this by setting `HOME` to the full path when in my `.dir-locals.el`
After describing my problem to ChatGPT, it inferred from our previous chats that I was using Fedora Kinoite, and it pointed out right away that symlinks (Fedora Atomic Desktops link `/home/` to `/var/home`) were known to cause problem in debuggers. After a quick search, that was easy to confirm after locating [this note](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#debug-symlink-directories) in the `vscode-go` docs. I was able to get around this by setting `HOME` to the full path when in my `.dir-locals.el`

```diff
diff --git a/.dir-locals.el b/.dir-locals.el
index 9995c3a..fba8c9f 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -3,12 +3,12 @@
          modes (go-mode go-ts-mode)
          command "dlv"
          command-args ("dap" "--listen" "127.0.0.1:55878" "--log-dest" "/tmp/dlv.log")
-          command-cwd "/home/shanemcd/github/GoogleContainerTools/skaffold/examples/simple-artifact-dependency"
+          command-cwd "/var/home/shanemcd/github/GoogleContainerTools/skaffold/examples/simple-artifact-dependency"
          host "127.0.0.1"
          port 55878
          :request "launch"
          :mode "debug"
          :type "go"
          :showLog "true"
-          :program "/home/shanemcd/github/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go"
+          :program "/var/home/shanemcd/github/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go"
diff --git a/.dir-locals.el b/.dir-locals.el
index 9995c3a..fba8c9f 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -3,12 +3,12 @@
          modes (go-mode go-ts-mode)
          command "dlv"
          command-args ("dap" "--listen" "127.0.0.1:55878" "--log-dest" "/tmp/dlv.log")
-          command-cwd "/home/shanemcd/github/GoogleContainerTools/skaffold/examples/simple-artifact-dependency"
+          command-cwd "/var/home/shanemcd/github/GoogleContainerTools/skaffold/examples/simple-artifact-dependency"
          host "127.0.0.1"
          port 55878
          :request "launch"
          :mode "debug"
          :type "go"
          :showLog "true"
-          :program "/home/shanemcd/github/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go"
+          :program "/var/home/shanemcd/github/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go"
          :args ["build"]))))))
```

Expand All @@ -199,4 +203,4 @@ Seeking a more long-term solution, I was able to add this to my emacs configurat
(setenv "HOME" real-home)))
```

I still have a lot more to learn, but with this, I am at least able to set breakpoints in my Golang application, step through the code, and inspect variables. I hope this blog post proves to be useful for others, but if nothing else I will be able to copy + paste these configs the next time I lose them. 🙂
I still have a lot more to learn, but with this, I am at least able to set breakpoints in my Golang application, step through the code, and inspect variables. I hope this blog post proves to be useful for others, but if nothing else I will be able to copy + paste these configs the next time I lose them. 🙂
2 changes: 1 addition & 1 deletion quartz.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const config: QuartzConfig = {
Plugin.Assets(),
Plugin.Static(),
Plugin.NotFoundPage(),
Plugin.Favicon()
Plugin.Favicon(),
],
},
};
Expand Down
15 changes: 15 additions & 0 deletions quartz.layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ export const defaultContentPageLayout: PageLayout = {
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),
],
afterBody: [
Component.Comments({
provider: "giscus",
options: {
// from data-repo
repo: "shanemcd/shanemcd.github.io",
// from data-repo-id
repoId: "R_kgDONkdtZA",
// from data-category
category: "Announcements",
// from data-category-id
categoryId: "DIC_kwDONkdtZM4CpxTn",
},
}),
],
};

// components for pages that display lists of pages (e.g. tags or folders)
Expand Down
Loading