Skip to content

Instantly share code, notes, and snippets.

View cdxker's full-sized avatar
☁️

cdxker cdxker

☁️
View GitHub Profile
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

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