Skip to content

Instantly share code, notes, and snippets.

View zdk's full-sized avatar
:octocat:

Di Warachet S. zdk

:octocat:
  • Thailand
  • 12:49 (UTC +07:00)
View GitHub Profile
# One-Shot Vault Cleanup
You are helping me organize my Obsidian vault. This is a collaborative process — you will work through it in phases and stop at every checkpoint to wait for my input. To move forward at any checkpoint, I will type **"go [number]"**. Never delete any note. Never change the content of any note.
---
## Phase 1 — Backup
Before touching anything, create a ZIP archive of my entire vault preserving its current folder structure. Save it as a new folder alongside the vault (not inside it), named `vault-backup-YYYY-MM-DD.zip`. Report the exact file location and size.
✋ **Checkpoint 1** — Once you see the backup location and size, type "go 2" to confirm you're happy with it and proceed.
---
## Phase 2 — Scan & Diagnose
List all markdown files in the vault using a file listing command. Do not read their contents yet. Report the total note count.
Then check for duplicate filenames. This matters because Obsidian's wikilinks reference notes by filename, not by file path — so `[[My Note]]` works rega
@zdk
zdk / PRIVACY.md
Last active April 22, 2026 17:42

Privacy Policy — JSON Selector

Last updated: 2026-04-23

JSON Selector ("the extension") does not collect, store, share, or sell any personal or usage data.

What the extension does

When a page loads, the extension inspects the response's Content-Type header. If the header indicates JSON (application/json or text/json), the extension parses the JSON and renders it as an interactive outline in the same page. The user can then click any node to copy a path expression (jq, JSONPath, JSON Pointer, JMESPath, gron, JavaScript, or Python) to the clipboard.

❯ cat Dockerfile
FROM docker.io/python:alpine
WORKDIR /content
RUN apk add curl
RUN curl -fsSL https://github.com/norouter/norouter/releases/latest/download/norouter-$(uname -s)-$(uname -m).tgz | tar xzvC /usr/local/bin
RUN echo '<!DOCTYPE html><html><head><title>Hello</title></head><body><h1>Hello, world!</h1></body></html>' > index.html
CMD ["python3", "-m", "http.server", "80", "--bind", "0.0.0.0"]
❯ cat norouter.yaml
hosts:
@zdk
zdk / ki-coverage.json
Last active June 12, 2025 14:48
ki-converage
{"label":"Coverage","message":"25.0%","schemaVersion":1,"color":"red"}
@zdk
zdk / bashrc
Created December 18, 2024 10:46
function apt-history(){
case "$1" in
install)
cat /var/log/dpkg.log | grep 'install '
;;
upgrade|remove)
cat /var/log/dpkg.log | grep $1
;;
rollback)
cat /var/log/dpkg.log | grep upgrade | \
#!/bin/bash
# Update system packages
apt-get update
apt-get upgrade -y
# Install Apache web server
apt-get install -y apache2
# Add PHP repository and install PHP 8.2
@zdk
zdk / basic.sh
Last active November 5, 2024 11:02
apt update
apt upgrade
echo "PubkeyAuthentication yes
PasswordAuthentication yes" >> /etc/ssh/sshd_config
systemcl restart ssh
sed -i '/^%sudo/c\%sudo ALL=(ALL) NOPASSWD:ALL' /etc/sudoers
usermod -aG sudo <user>
usermod -s /bin/bash <user>
@zdk
zdk / .bashrc
Last active November 6, 2024 02:07
#!/bin/sh
alias ll='ls -la'
# Editor: VIM
export EDITOR='nvim'
export VISUAL='nvim'
alias k=kubectl
alias tf='terraform'
alias i='/sbin/ifconfig'
@zdk
zdk / query_srv_record.tsx
Last active August 14, 2024 14:59
Test SRV record query with Bun
import * as dns from "node:dns";
import { $ } from 'bun';
const addrs = await dns.promises.resolveSrv("_web1._tcp.mydomain.local");
console.log(addrs);
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml