Skip to content

Instantly share code, notes, and snippets.

View sergsoares's full-sized avatar

Sergio Soares sergsoares

View GitHub Profile
@sergsoares
sergsoares / plan-improve-app.md
Created May 3, 2026 16:45
Claude Code Web Planning

Plan: Joplin-Style Notebook Hierarchy

Context

The feature branch is currently based on main (old file-based, templ-template architecture). The develop branch has a completely different, more advanced architecture: VanJS SPA, REST JSON API, SQLite-based storage (modernc.org/sqlite), Playwright e2e tests. The feature must be built on top of develop.

The develop branch already has:

  • SQLite DB with notes, notes_fts, attachments, snapshots tables
  • REST API at /api/notes, /api/search, etc.
  • VanJS SPA frontend in staticfs/js/app.js + staticfs/js/api.js
@sergsoares
sergsoares / plan.md
Created March 10, 2026 15:32
Plan to create Matrix server

Plan: Deploy Matrix Server in FluxCD with Picoclaw Integration


Task 1: Create FluxCD Folder Structure for Matrix

Scaffold all manifest files needed for the Matrix (Synapse) server under the FluxCD apps directory.

  • Open the FluxCD repository locally
  • Create folder: clusters/prod/apps/matrix/
@sergsoares
sergsoares / plan.md
Created March 7, 2026 20:20
Ralphex Plan file output

Deploy snotes to k0scluster via Flux

Overview

Build the apps/snotes project as a container image tagged docker.io/localhost/snotes:latest, import it directly into k0s containerd (no SSH needed — same machine), and create Flux-managed Kubernetes manifests in clusters/thelab/snotes/ following the clusters/thelab/apps/ pattern. Git sync is explicitly disabled via env var. imagePullPolicy is Never so k0s uses the locally imported image.

apiVersion: k0sctl.k0sproject.io/v1beta1
kind: Cluster
metadata:
name: k0s-cluster
user: admin
spec:
hosts:
- ssh:
address: localhost
user: root
@sergsoares
sergsoares / Justfile
Created May 29, 2023 17:59
Justfile to apply argocd inside a cluster
init:
colima start argocd-selfmanaged --kubernetes
kubectl-get-nodes:
kubectl get nodes
kubectl get pods -A
kubectl-apply-argocd:
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
@sergsoares
sergsoares / Makefile
Created April 11, 2023 00:12
Makefile for select specific resource inside a main.tf
target:
SELECTED=`cat main.tf | grep resource | tr -d '"' | awk '{ print $$2 "." $$3 }' | fzf` ; \
terraform apply -target=$$SELECTED
@sergsoares
sergsoares / main.go
Created February 1, 2023 05:27
Simple main.go to process a Key/Value bookmarks as .command for be used in MacOS.
package main
import (
"encoding/json"
"os"
"path/filepath"
)
const (
output = "shortcuts"
{
"aws-cli-reference": "https://docs.aws.amazon.com/cli/latest/reference/index.html",
"aws-cli-acm": "https://docs.aws.amazon.com/cli/latest/reference/acm/index.html",
"aws-cli-acm-pca": "https://docs.aws.amazon.com/cli/latest/reference/acm-pca/index.html",
"aws-cli-alexaforbusiness": "https://docs.aws.amazon.com/cli/latest/reference/alexaforbusiness/index.html",
"aws-cli-amplify": "https://docs.aws.amazon.com/cli/latest/reference/amplify/index.html",
"aws-cli-apigateway": "https://docs.aws.amazon.com/cli/latest/reference/apigateway/index.html",
"aws-cli-apigatewaymanagementapi": "https://docs.aws.amazon.com/cli/latest/reference/apigatewaymanagementapi/index.html",
"aws-cli-apigatewayv2": "https://docs.aws.amazon.com/cli/latest/reference/apigatewayv2/index.html",
"aws-cli-application-autoscaling": "https://docs.aws.amazon.com/cli/latest/reference/application-autoscaling/index.html",
@sergsoares
sergsoares / main.go
Created December 9, 2022 23:39
Golang to ping and encode in JSON response
package main
import (
"fmt"
"os/exec"
"strings"
"strconv"
"net"
)
@sergsoares
sergsoares / main.tf
Created July 14, 2022 19:55
Validation of complex variables in terraform
# terraform.vars
rules = [
{
api_groups = [""]
resources = ["pods","services","deployments","jobs"]
verbs = ["*"]
},
{
api_groups = [""]
resources = ["namespaces"]