Skip to content

Instantly share code, notes, and snippets.

View darkn3rd's full-sized avatar
🏠
Working from home

Joaquin Menchaca darkn3rd

🏠
Working from home
View GitHub Profile
@darkn3rd
darkn3rd / scaling_notes.md
Created August 6, 2026 20:37
scaling notes

I would first establish the workload characteristics and scaling target: current and expected traffic, read/write ratio, latency objective, data volume, availability requirements, regional requirements, and budget. Then I would scale each tier independently, because the application, cache, and database have different bottlenecks and consistency trade-offs.

1. Start with requirements

Before choosing an architecture, I would ask:

  • Is traffic steady, bursty, or seasonal?
  • Is the application stateless?
  • What are the read/write ratios?
  • What is the current bottleneck?
@darkn3rd
darkn3rd / cleanup_eks_network.sh
Last active June 12, 2026 02:17
Create EKS Cluster with Existing VPC
#!/usr/bin/env bash
set -euo pipefail
if [[ ! -f "./vpc-outputs.env" ]]; then
echo "ERROR: vpc-outputs.env not found in current directory." >&2
exit 1
fi
source ./vpc-outputs.env
@darkn3rd
darkn3rd / install_macos.sh
Last active January 7, 2026 23:46
Dev Tools Ubuntu 24 and Windows
#!/usr/bin/env bash
update_homebrew_path() {
# Google Style: Declare locals at the top.
# Capitalized because these will hold environment-like path strings.
local BREW_PREFIX
local GNU_PATHS
local KEG_PATHS
local RAW_COMBINED
local DEDUPE_LOGIC
@darkn3rd
darkn3rd / provision.md
Last active October 26, 2025 16:16
Pedantic ADHD Guide to Kubernetes Provisioning

Pedantic ADHD Guide to Kubenretes Provisioning

This is my guide for how to get Kubernetes provisioned using Azure, Google Cloud, or AWS using CLI tools. This will require setting up an account with local CLI tools. The goal of this is to quickly set up a disposable test clusters in minimalist way.

The Tools

Some tools used here:

  • General
  • direnv (direnv) - used to setup environment variables automatically
@darkn3rd
darkn3rd / new_mac.sh
Created November 29, 2018 02:59
Joaquin's New MacBook Starter Script
# Command Line Tools
xcode-select --install
# Download XCode
# Instructions: https://stackoverflow.com/questions/4081568/downloading-xcode-with-wget-or-curl
# URL: https://download.developer.apple.com/Developer_Tools/Xcode_10.1/Xcode_10.1.xip
sudo xcodebuild -license
# Mojave only - need headers or nothing works
TOOLS_PATH="/Library/Developer/CommandLineTools/"
@darkn3rd
darkn3rd / cpan.md
Last active April 4, 2025 07:11
Perl CPAN vs. CPANM

What is the difference between cpan and cpanm?

This was explanation by Grant McLean

CPAN CLI

cpan the CPAN shell has been shipped with Perl since about 1997. When you run it the first time it asks a bunch of questions and saves the answers in a config file. Then you can install a module by running:

cpan -i Module::Name

The shell provides other commands for searching CPAN and looking inside distribution files.

@darkn3rd
darkn3rd / setup_and_run_terraformer.sh
Last active March 31, 2025 06:49
Export Deployed TeamCity on Google Cloud to Terraform
##################
# Install Terraform with tfenv
# Ref: https://github.com/GoogleCloudPlatform/terraformer#installation
# For macOS with Homebrew: brew install tfenv
#############################
git clone https://github.com/tfutils/tfenv.git ~/.tfenv
export PATH="$HOME/.tfenv/bin:$PATH"
echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> ~/.bashrc
# install Terraform
tfenv install latest
@darkn3rd
darkn3rd / cloudflare.tf
Created June 17, 2024 22:37
Example Cloudflare
variable "records" {
description = "Cloudflare DNS zone records"
type = set(object({
tf_obj_id = string # tf key used to organize records
name = string
proxied = bool
value = string
priority = number
ttl = number
type = string
@darkn3rd
darkn3rd / monitors.tf
Last active March 31, 2025 06:27
Datadog example for monitors
# Run Script to fetch monitors
# --------------------------------------
# WORKSPACE=$(terraform workspace show)
# [[ -d "./tfvars" ]] && VAR_DEFS_PATH="./tfvars"
# [[ -d ".././tfvars" ]] && VAR_DEFS_PATH=".././tfvars"
# [[ -z "$VAR_DEFS_PATH" ]] && { echo 'VAR_DEFS_PATH not specified. Aborting' >&2 ; exit 1; }
# DD_API_KEY="$(awk -F'"' '/dd_api_key/{ print $2 }' $VAR_DEFS_PATH/$WORKSPACE.secret.tfvars)"
# DD_APP_KEY="$(awk -F'"' '/dd_app_key/{ print $2 }' $VAR_DEFS_PATH/$WORKSPACE.secret.tfvars)"
# [[ -z "$DD_API_KEY" ]] && { echo 'DD_API_KEY not specified. Aborting' >&2 ; exit 1; }
# [[ -z "$DD_APP_KEY" ]] && { echo 'DD_APP_KEY not specified. Aborting' >&2 ; exit 1; }
@darkn3rd
darkn3rd / main.tf
Created June 19, 2024 02:18
My Datadog Pipelines Example (experimental)
variable "pipelines" {
description = "List of pipelines with their processors"
type = list(any)
}
resource "datadog_logs_custom_pipeline" "pipelines" {
for_each = { for idx, pipeline in var.pipelines : idx => pipeline }
name = each.value.name
is_enabled = each.value.is_enabled