Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Sparr mikesparr

  • Montana, USA
View GitHub Profile
@mikesparr
mikesparr / experiment-ffmpeg-gcp-trancoder.sh
Created January 23, 2023 18:22
Experiment fixing missing file duration metadata using ffmpeg for Google Cloud Platform (GCP) Transcoder API
View experiment-ffmpeg-gcp-trancoder.sh
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/transcoder/docs/transcode-video#create-job-from-preset-python
# - https://ffmpeg.org/ffmpeg.html#Stream-copy
#####################################################################
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
@mikesparr
mikesparr / 01-kestra-setup.sh
Last active December 15, 2022 05:31
Testing out Kestra workflow orchestration tool on local Mac
View 01-kestra-setup.sh
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://kestra.io/docs/getting-started/
#####################################################################
# download kestra docker-compose.yml file
wget https://raw.githubusercontent.com/kestra-io/kestra/develop/docker-compose.yml
@mikesparr
mikesparr / gcp-netbox-managed.sh
Last active January 19, 2023 02:27
Experiment setting up Netbox on Google Cloud Platform leveraging managed services
View gcp-netbox-managed.sh
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://docs.netbox.dev/en/stable/installation/3-netbox/
# - https://github.com/netbox-community/netbox-docker/wiki/
# - https://hub.docker.com/r/netboxcommunity/netbox
# - https://cloud.google.com/sql/docs/postgres/configure-private-ip
# - https://cloud.google.com/sql/docs/postgres/create-instance
# - https://cloud.google.com/sql/docs/postgres/create-manage-databases#gcloud
@mikesparr
mikesparr / flutter-setup-mac-silicon.sh
Last active December 7, 2022 21:37
Flutter setup steps for Mac running Apple silicon
View flutter-setup-mac-silicon.sh
#! /usr/bin/env bash
#############################################################
# REFERENCES
# - https://docs.flutter.dev/get-started/install/macos
# - https://developer.android.com/studio/index.html
# - https://developer.android.com/studio/command-line
# - https://developer.android.com/studio/command-line/sdkmanager
# - https://developer.apple.com/download/
# - https://guides.cocoapods.org/using/getting-started.html#installation
@mikesparr
mikesparr / gcp-gke-autopilot-rabbitmq.sh
Last active December 7, 2022 13:00
Experiment exposing a RabbitMQ cluster with both TCP load balancer and HTTP(S) load balancer, sharing same static IP on GKE Autopilot cluster
View gcp-gke-autopilot-rabbitmq.sh
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/kubernetes-engine/docs/how-to/creating-an-autopilot-cluster
# - https://www.rabbitmq.com/kubernetes/operator/quickstart-operator.html
#####################################################################
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)")
@mikesparr
mikesparr / gcp-gce-snapshots-delete-restore.sh
Last active December 7, 2022 03:55
Experiment creating disk snapshots and deleting all but one to verify data restored for Google Cloud Platform (GCP) Compute Engine
View gcp-gce-snapshots-delete-restore.sh
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/compute/docs/instances/create-start-instance
# - https://cloud.google.com/compute/docs/disks/create-snapshots
# - https://cloud.google.com/compute/docs/disks/restore-snapshot
#####################################################################
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
@mikesparr
mikesparr / gcp-ilb-gke-ingress-proxy-only.sh
Last active December 6, 2022 06:17
Experiment with proxy-only subnet and Google Kubernetes Engine (GKE) serving up internal Ingress with static IP
View gcp-ilb-gke-ingress-proxy-only.sh
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balance-ingress#deploying_ingress_for
# - https://cloud.google.com/load-balancing/docs/l7-internal/setting-up-l7-internal#configure-test-environment
#####################################################################
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
@mikesparr
mikesparr / 01-fetch-shelter-and-pet-data.sh
Last active December 5, 2022 21:59
Quick data loader for national animal shelter (and pet type/breed) data for research
View 01-fetch-shelter-and-pet-data.sh
#!/usr/bin/env bash
# FETCH AND BUILD DATA LOCALLY
#############################################################
# "FETCH" MARKET RESEARCH DATA :-)
# - https://www.petfinder.com/developers/v2/docs
# - TIP: store CLIENT_ID and CLIENT_SECRET in .env-local file
#############################################################
@mikesparr
mikesparr / gcp-anthos-quick-example.sh
Created November 17, 2022 18:41
Project setup for an example Anthos deployment
View gcp-anthos-quick-example.sh
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/anthos/docs/tutorials/explore-anthos
#####################################################################
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)")
@mikesparr
mikesparr / gcp-pub-private-migs-lb.sh
Last active November 6, 2022 15:57
Example network load balancer and internal TCP load balancer on Google Cloud Platform fronting an instance group
View gcp-pub-private-migs-lb.sh
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/compute/docs/instance-templates/create-instance-templates
# - https://cloud.google.com/compute/docs/metadata/setting-custom-metadata
# - https://cloud.google.com/compute/docs/instances/startup-scripts/linux#gcloud_2
# - https://cloud.google.com/compute/docs/instances/startup-scripts/linux#accessing-metadata
# - https://cloud.google.com/compute/docs/instance-groups/distributing-instances-with-regional-instance-groups
# - https://cloud.google.com/load-balancing/docs/health-checks#optional-flags-hc-protocol-ssl-tcp