Skip to content

Instantly share code, notes, and snippets.

@devonhk
devonhk / obsidian-mimetype-misconfiguration.md
Created August 27, 2024 17:10
xdg-open coverage.html opening obsidian instead of a browser

Installing obsidian on my linux distro updated my ~/.config/mimeapps.list with text/html=obsidian.desktop.

This caused go tool cover -html=coverage.out -o coverage.html to attempt (and fail) to open coverage files in obsidian instead of a browser. The fix was was simple. I just needed to fix the mime association with: xdg-mime default google-chrome.desktop text/html

@devonhk
devonhk / gist:0075036ca840bd94e9a2e7608980a4ea
Created August 5, 2024 19:58
debugging GCR distroless containers
To debug GCP distroless containers, prefix the image tag with debug.
From `gcr.io/distroless/static-debian11:nonroot` to `gcr.io/distroless/static-debian11:debug-nonroot`
`docker run --rm -it gcr.io/distroless/static-debian11:debug-nonroot`
sudo caddy run
2020/03/17 02:13:22.520 INFO using adjacent Caddyfile
2020/03/17 02:13:22.521 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["localhost:2019"]}
2020/03/17 02:13:22.522 INFO http server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2020/03/17 02:13:22.522 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2020/03/17 02:13:22.522 INFO http enabling automatic TLS certificate management {"domains": ["plex.devon.ninja"]}
2020/03/16 22:13:22 [INFO][cache:0xc00068b400] Started certificate maintenance routine
2020/03/17 02:13:22.523 INFO tls cleaned up storage units
2020/03/17 02:13:22.572 INFO autosaved config {"file": "/root/.config/caddy/autosave.json"}
2020/03/17 02:13:22.572 INFO serving initial configuration
@devonhk
devonhk / .bash
Created January 24, 2020 15:07
detect changed files in mono repo
CHANGED_FOLDERS=$(git diff --name-status $TRAVIS_COMMIT_RANGE -- | awk 'BEGIN {FS="/"} {print $1}' | awk '{print $2}' | uniq)