Skip to content

Instantly share code, notes, and snippets.

View ehc-io's full-sized avatar

Eduardo C ehc-io

View GitHub Profile
@ehc-io
ehc-io / folderingest.py
Created September 10, 2025 10:11
Folder Ingest - Consolidate Folders in a single txt file for LLMs
#!/usr/bin/env python
import argparse
import os
import re
import sys
from pathlib import Path
# Default directories to exclude to mimic the original tool's behavior
DEFAULT_EXCLUDE_DIRS = {'.git', 'node_modules', 'vendor', '__pycache__'}
cd ~ && mkdir tmp && cd tmp && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install && brew install -y autojump && curl -s https://gist.githubusercontent.com/ehc-io/52a3549eb17dda934925149b9048f566/raw/ac4ab8a96dd65a50506293c200de29533ff1b1bb/zshrc -o $HOME/.zshrc
@ehc-io
ehc-io / nginx.tcpproxy.conf
Created April 30, 2025 18:17
NGINX TCP PROXY for POSTGRES
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
# Load the stream module for TCP proxying
load_module modules/ngx_stream_module.so;
events {
worker_connections 1024;
@ehc-io
ehc-io / cloud_build_nginx_template.yaml
Created April 2, 2025 12:20
Cloud Build NGINX YAML template
steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- '-t'
- 'us-central1-docker.pkg.dev/qspe-403603/qspe-images/nginx-demo:$BUILD_ID'
- '-f'
- Dockerfile
- .
- name: gcr.io/cloud-builders/docker
@ehc-io
ehc-io / gke_workload_identity_code_snippet.md
Last active March 23, 2025 22:17
GKE - Workload identity - Cloud Storage Example

Accessing Google Cloud Storage from GKE with Identity Federation

  1. With Workload Identity Federation enabled, GKE pods do NOT using the Compute Engine default service account directly.

  2. Instead, GKE pods are using Kubernetes service accounts that are mapped to Google service accounts.

To fix this issue:

  1. Create a dedicated Google service account for your workloads:
@ehc-io
ehc-io / gcp-classic-vpn-template
Last active May 7, 2025 15:48
GCP Classic VPN template
# Guide to Updating VPN Tunnel and Routes in GCP
### ENV Variable Setup (Region and resource names)
```bash
REGION="us-west1"
SITE_LOCAL_ENDPOINT_IP1="my-gateway-prod-by-vpn-ip"
SITE_LOCAL_GATEWAY_NAME="my-gateway-prod-by-vpn"
SITE_LOCAL_VPC_NAME="mycompany-sql-remotecloud"
SITE_LOCAL_VPN_TUNNEL1_NAME="mycompany-to-remotecloud-tunnel"
@ehc-io
ehc-io / folderdiff.sh
Last active March 11, 2025 10:01
This script compares two folders by analyzing their subfolder structures and sizes
#!/bin/bash
#
# Folder Comparison Tool (folderdiff.sh)
#
# DESCRIPTION:
# This script compares two folders by analyzing their subfolder structures and sizes,
# providing a detailed report of the differences. Differences smaller than 300KB are
# considered insignificant and marked as "None". The script reports on total sizes,
# folders present in only one location, and size discrepancies between common folders.
#
@ehc-io
ehc-io / cogmem-test.py
Last active February 6, 2025 00:23
Cognitive Memory Test
import random
import string
import time
from flask import Flask, render_template_string, request, redirect, url_for, session
app = Flask(__name__)
app.secret_key = "your_secret_key_here" # required for session management
# --- Helper Functions ---
@ehc-io
ehc-io / yt_tsc_downloader.py
Last active March 7, 2025 15:47
Youtube Transcription Downloader
#!/usr/bin/env python3.11
import sys
import time
import re
import os
import json
import argparse
import io
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.formatters import TextFormatter