Skip to content

Instantly share code, notes, and snippets.

@adamf
adamf / run_minikube.sh
Created August 5, 2020 18:35
Running minikube + tilt ci in a github action
#!/bin/bash
set -exu
PLATFORM=$(uname)
# If the minikube cluster doesn't exist, the return code is 7
# we'll test this later to see if we need to do a bunch of initial setup on
# services (eg, create RBAC for k8s, create DB users, etc)
MINIKUBE_STATUS_GREP_NON_EXISTENT=0
@adamf
adamf / make_gcp-aws_ha_vpn.sh
Last active November 14, 2024 18:42
Bash script to create an HA VPN between GCP and AWS.
#!/bin/bash
set -exu -o pipefail
# This script creates a highly-available VPN between a VPC in Google Cloud Platform
# and a VPC in AWS. This does all of the work (and a bit more) detailed in
# https://cloud.google.com/architecture/build-ha-vpn-connections-google-cloud-aws
export AWS_PAGER=""
@adamf
adamf / extra_logging.py
Created March 24, 2023 16:42
Add datadog span & event information to structured logs in a Django app
import logging
from typing import Any, Dict
import ddtrace
from ddtrace import tracer
def datadog_context(
logger: logging.Logger, log_method: Any, event_dict: Dict[Any, Any]
) -> Dict[Any, Any]: