Skip to content

Instantly share code, notes, and snippets.

View cdxker's full-sized avatar
☁️

Denzell cdxker

☁️
View GitHub Profile
@cdxker
cdxker / open-all-ports
Last active July 25, 2026 07:55
open-all-ports — expose a Linux box's loopback-only dev ports to allowed Tailscale peers via nftables DNAT (no SSH tunnels, no per-port config)
#!/usr/bin/env bash
#
# open-all-ports — expose this machine's loopback-only ports over Tailscale
#
# Dev servers usually bind 127.0.0.1, so they're unreachable from any other
# machine even across a tailnet. This DNATs inbound tailscale traffic to
# loopback, so a peer can hit http://thishost:ANYPORT with no per-port setup
# and no SSH tunnels.
#
# Access is restricted to the peer IPs you allow. Everything else on the
@cdxker
cdxker / ssh-over-cloudflare-tunnel.md
Created July 11, 2026 18:09
SSH over a Cloudflare Tunnel — API-only setup, systemd service, phone access

SSH over a Cloudflare Tunnel (nightbrew.cdxker.com)

Expose SSH on a machine behind NAT — no open router ports — using a Cloudflare Tunnel, managed entirely through the Cloudflare API (no cloudflared tunnel login browser dance). The tunnel runs as a systemd user service so it survives reboots and needs no terminal.

How it works

let dataset_id = $env.DATASET_ID
let api_key = $env.API_KEY
let clickhousePassword = $env.CLICKHOUSE_PASSWORD
let headers = {
"TR-Dataset": $dataset_id
"Authorization": $api_key
"X-API-Version": "V2"
}
def clickhouse-query [query: string] {
@cdxker
cdxker / 0__scrape-okteto-docs.sh
Created January 3, 2025 22:36
Simple Gist command to scrape okteto's docs
export DATASET_ID="<your-trieve-dataset>"
export ORGANIZATION_ID="<your-trieve-organization>"
export TRIEVE_API_KEY="<your-trieve-api-key>"
export TRIEVE_URL="https://api.trieve.ai"
PAYLOAD='{
"crawl_options": {
"allow_external_links" : false,
"boost_titles": true,
"exclude_paths": [],
@cdxker
cdxker / Cargo.lock
Last active December 11, 2024 00:15
Pagefind with rust
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "actix-codec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a"
dependencies = [
@cdxker
cdxker / pod_in_namespace..sh
Last active December 21, 2024 13:51
Create pod with psql in any namespace
kubectl run postgres-client --namespace=cloud-sql-proxy --image=codingpuss/postgres-client --stdin --tty --rm --restart=Never
@cdxker
cdxker / gist:4805262d34524dce2ad89f50ad465330
Created October 8, 2024 21:11
Really good tool for drawing diagrams
- draw.io
@cdxker
cdxker / 1_tailscale_with_keycloak_auth.md
Last active March 16, 2025 06:28
How to configure tailscale with keycloak OIDC auth
@cdxker
cdxker / install_ebs.md
Created September 18, 2024 07:21
Install EBS CSI Addon with IAM role into EKS cluster

most annoying thing about eks,,, you gotta build everything yourself

AWS_REGION=us-west-1
CLUSTER_NAME=my-cluster
AWS_ACCOUNT_ID="$(aws sts get-caller-identity --query "Account" --output text)"

## Creating IAM Roles
eksctl create iamserviceaccount \
  --region="${AWS_REGION}" \
  --name="ebs-csi-controller-sa" \
BACKEND=$(kubectl get ing <ingress-name> -o json | jq -j '.metadata.annotations."ingress.kubernetes.io/backends"' | jq -j 'keys[0]')
gcloud compute backend-services update $BACKEND --enable-cdn