Skip to content

Instantly share code, notes, and snippets.

View mikesparr's full-sized avatar

Mike Sparr mikesparr

  • Montana, USA
View GitHub Profile
@mikesparr
mikesparr / 01-architecting-solutions.md
Last active May 14, 2026 20:08
Study Guide for GCP Professional Cloud Architect exam (notes from refresher course)

Architecting for the cloud

  • Architect solutions to be scalable and reilient
  • Business requirements involve lowering costs / enhancing user experience
  • Keep an eye on technical needs during development and operation

3 Major Questions To Ask

  1. Where is the company coming from
@mikesparr
mikesparr / core-arch-training.md
Created April 19, 2021 17:10
Core cloud architecture training videos

The following videos, or playlists, can help ensure consistent knowledge amongst all core team members and help make customer support easier.

  • CS fundamentals - 12-min videos (9 hr)

    • Learn about computer origins, transistors, logic gates, and computer architecture

    • Learn about binary, bits, and bytes (bits, bytes, and octets key in networking)

    • Computer architecture, programming, languages, ML, robotics

@mikesparr
mikesparr / advanced-ddos-gcp.sh
Last active March 9, 2026 10:11
Cheat sheet for enabling advanced DDoS protection on Google Cloud
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/armor/docs/managed-protection-using#gcloud
# - https://cloud.google.com/armor/docs/advanced-network-ddos
# - https://cloud.google.com/armor/docs/configure-adaptive-protection
# - https://cloud.google.com/armor/docs/adaptive-protection-auto-deploy
#####################################################################
@mikesparr
mikesparr / model-armor-example-gcloud-or-tf.md
Created January 30, 2026 19:35
Google Cloud Model Armor setup example with gcloud sdk or Terraform

Model Armor Credit Card Number Masking Example

Gcloud SDK

#!/bin/bash

export PROJECT_ID="EXAMPLE-PROJECT-ID"  # <--- Change this
export LOCATION="us-central1"
@mikesparr
mikesparr / sre-practices.md
Last active January 27, 2026 17:16
SRE best practices

SRE best practices

  • don’t expect a tool to solve
  • cultural change and need “believers” in senior role to advocate within company
  • people need to absorb info within their own mindset

“Reliability is a journey”

  • it is a process that can span 6-9 months in orgs w/ 5000 engineers; nothing happens immediately
  • Step 1: “I want to be reliable when I grow up” (you must believe you have problem first)
  • Step 2: “Read the book!” and watch SRE v DevOps
  • Step 3: “Panic!” (myth: fire team and retrain; not the case and can retrain team in house)

Nerdy by Nature - M.C.P.

Style

Use an energetic hip-hop style, clear call-and-response chorus, rhythmic internal rhymes, witty tech-related wordplay, reference Model Context Protocol throughout, and keep it roughly at 98 BPM vibe. This should be formatted so a generation model can output lyrics or even a sung/rap performance.

Lyrics

[Intro / Hook Starter]
(spoken like MC hype intro)
Arm me with logic!
@mikesparr
mikesparr / gcp-iap-oslogin-audit-logging.sh
Last active January 5, 2026 15:08
Example of granting access to select compute engine instance and enabling audit logs on Google Cloud Platform (GCP)
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/compute/docs/oslogin/manage-oslogin-in-an-org
# - https://cloud.google.com/compute/docs/instances/managing-instance-access#configure_users
# - https://cloud.google.com/iam/docs/configuring-resource-based-access
# - https://cloud.google.com/iap/docs/using-tcp-forwarding#grant-permission
# - https://cloud.google.com/iap/docs/audit-log-howto
# - https://cloud.google.com/compute/docs/oslogin/view-audit-logs#view-logs
@mikesparr
mikesparr / freeswitch-gcp-nat-test.sh
Created April 28, 2021 23:54
Installing FreeSwitch on GCP with public and private VMs behind load balancer and NAT
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain
export GCP_REGION="us-west4"
export GCP_ZONE="us-west4-a"
export NETWORK_NAME="default"
@mikesparr
mikesparr / gcp-nextjs-vercel-gcp-migrate.sh
Last active November 19, 2025 02:46
Experiment migrating Vercel hosted NextJS app to Google Cloud Platform atop Cloud Run
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://nextjs.org/learn/dashboard-app/getting-started
# - https://github.com/vercel/next.js/tree/canary/examples/with-docker
# - https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-nodejs-service
# - https://cloud.google.com/run/docs/configuring/services/environment-variables
# - https://cloud.google.com/run/docs/securing/service-identity
# - https://cloud.google.com/sdk/gcloud/reference/run/deploy
@mikesparr
mikesparr / gke-gateway-iap-demo.sh
Created February 24, 2024 17:56
Demo securing a Google Kubernetes Engine (GKE) hosted app using Gateway API, HTTPRoute, and Identity Aware Proxy (IAP)
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/iap/docs/concepts-overview
# - https://cloud.google.com/iap/docs/enabling-kubernetes-howto
# - https://cloud.google.com/kubernetes-engine/docs/how-to/configure-gateway-resources#configure_iap
# - https://cloud.google.com/sdk/gcloud/reference/container/clusters/create
# - https://github.com/digitalocean/kubernetes-sample-apps/tree/master/podinfo-example
# - https://cloud.google.com/kubernetes-engine/docs/how-to/container-native-load-balancing