Skip to content

Instantly share code, notes, and snippets.

View kcotten's full-sized avatar

kcotten

View GitHub Profile
@kcotten
kcotten / json_print.go
Last active October 10, 2021 20:16
Dynamic json in Go
package main
import (
"encoding/json"
"fmt"
"strings"
)
func main() {
m := deserialize(jsonBlob)
@kcotten
kcotten / json_print.py
Created September 15, 2021 18:37
Dynamic json in Python
#! /usr/bin/python3
import json
s = """{
"_id": "61410596ba0c39a1fae2f47f",
"index": 0,
"guid": "fe1102ba-b5f9-4783-a62c-13adb3c2c293",
"isActive": false,
"balance": "$1,500.31",
"picture": "http://placehold.it/32x32",
@kcotten
kcotten / k8s_setup_ubuntu.sh
Last active December 27, 2022 19:50
k8s Setup Script
#! /usr/bin/bash
# Setup new server with microk8s, kubectl, and helm
set -euo pipefail
# Get current user
USER=$(who | awk '{ print $1}')
# Get current OS, script currently uses snap which should be available
# by default on Ubuntu
@kcotten
kcotten / aws-ec2.sh
Created January 7, 2023 18:16
Example script provisioning a simple ec2 HTTP server
#!/usr/bin/env bash
set -euo pipefail
# Create a VPC
AWS_VPC=$(aws ec2 create-vpc \
--cidr-block 10.0.0.0/16 \
--query 'Vpc.{VpcId:VpcId}' \
--output text)