Skip to content

Instantly share code, notes, and snippets.

View cdxker's full-sized avatar
☁️

cdxker cdxker

☁️
View GitHub Profile
@cdxker
cdxker / gist:dfbce9fc482e8ae52a89716fb8bf7ae8
Created November 9, 2024 00:16
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 September 30, 2024 18:41
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

Using raw vms are great for quickly self-hosting many products. Self hosting sentry is 50 services managed in docker-compose. The docs's arent very clear, but there is a way to use s3 to host the filestorage. Updating the config was too hard for me to figure out and now its all being logged to storage on the vm itself. Our selfhosted Sentry has died many times because it ran out of storage. I didn't realize that before. When you run out of storage, you are no longer able to even ssh into the machine to diagnose the problem. Anyways... this is how we do it on gcp.

From the gcloud cli run.

@cdxker
cdxker / push-and-edit-hn.md
Created July 30, 2024 20:38
Deploy HN UI

Run this, with a different tag name in hn_frontend/frontend

docker build -t trieve/hn-ui:21 . && docker push trieve/hn-ui:21
gcloud container clusters get-credentials --region us-west1-a hackernews
kubectl edit -n hackernews deployments/hackernews

You will be in a vim session and just edit the tag here

@cdxker
cdxker / ingestion_guide.md
Last active July 25, 2024 21:02
How to make any ingestion pipeline scale fast and how to run the pipline.

Take for example this simplified pseudo code for hackernews ingest.

import requests

def get_post(id):
  
  return requests.get(f"https://hacker-news.firebaseio.com/v0/item/{id}.json?print=pretty").json()
@cdxker
cdxker / index.html
Created June 19, 2024 06:53
Trieve Search Spam test
wrk https://api.trieve.ai/api/chunk/search -t12 -d30s -c800 -s post_search.lua
@cdxker
cdxker / index.html
Last active June 15, 2024 03:13
Website
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>cdxker</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>