Skip to content

Instantly share code, notes, and snippets.

View dbafromthecold's full-sized avatar

Andrew Pruski dbafromthecold

View GitHub Profile
@dbafromthecold
dbafromthecold / mysql_docker
Last active February 7, 2020 17:50
Run mysql in a docker container
docker container run `
-d ` # detach the container (run it in the background)
--name arkkkd ` # give the container a name (arkkkd)
-p 3306:3306 ` # set port mapping from your computer to the container (3306 to 3306)
# setting environment variables for mysql
--env MYSQL_ALLOW_EMPTY_PASSWORD=True `
@dbafromthecold
dbafromthecold / InstallK8sOnRaspberryPi.txt
Last active March 21, 2020 23:38
Steps to install K8s on a raspberry pi 4 running Raspbian Buster Lite
# https://github.com/teamserverless/k8s-on-raspbian/blob/master/script/prep.sh
# https://www.hanselman.com/blog/HowToBuildAKubernetesClusterWithARMRaspberryPiThenRunNETCoreOnOpenFaas.aspx
# config of the raspberry pi on the network
change hostname
change ip
disable swap
# raspbian claiming it's debian v10 when it's actually v9 - curl -sL get.docker.com | grep '9)' -b10 -a10 - no version for buster
sudo curl -sL get.docker.com | sed 's/9)/10)/' | sh
@dbafromthecold
dbafromthecold / delete_aci-virtualnetwork.azcli
Created October 6, 2018 13:50
delete_aci-virtualnetwork
# https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet
# log into Azure
az login
# Set variables for resource group, virtual network, and subnet
RES_GROUP=containers1
VNET=vnet1
@dbafromthecold
dbafromthecold / DecodeHelmSecrets.sh
Created August 16, 2020 13:06
A kubectl plugin to decode secrets created by Helm
#!/bin/bash
# get helm secrets from Kubernetes cluster
SECRET=$(kubectl get secret $1 -o jsonpath='{ .data.release }' )
# decode the secrets
DECODED_SECRET=$(echo $SECRET | base64 -d | base64 -d | gunzip -c )
# parse the decoded secrets, pulling out the templates and removing whitespace
DATA=$(echo $DECODED_SECRET | jq '.chart.templates[]' | tr -d '[:space:]' )
@dbafromthecold
dbafromthecold / azure-sql-edge.yaml
Created November 30, 2020 11:43
Yaml file to deploy Azure SQL Edge and expose with a load balanced service
apiVersion: apps/v1
kind: Deployment
metadata:
name: sqledge-deployment
spec:
replicas: 1
selector:
matchLabels:
app: sqledge
template:
@dbafromthecold
dbafromthecold / testnginxingress.yaml
Created November 21, 2020 11:30
Test nginx ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-testwebsite
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: www.testwebaddress.com
http:
@dbafromthecold
dbafromthecold / azure-sql-edge-pv.yaml
Created December 6, 2020 10:47
Persistent Volumes for Azure SQL Edge
apiVersion: v1
kind: PersistentVolume
metadata:
name: sqlsystem-pv
spec:
capacity:
storage: 1024Mi
accessModes:
- ReadWriteOnce
nfs:
@dbafromthecold
dbafromthecold / azure-sql-edge-persistent.yaml
Created December 6, 2020 11:00
Azure SQL Edge with persistent volume claims
apiVersion: apps/v1
kind: Deployment
metadata:
name: sqledge-deployment
spec:
replicas: 1
selector:
matchLabels:
app: sqledge
template:
@dbafromthecold
dbafromthecold / azure-sql-edge-pvc.yaml
Last active December 6, 2020 13:37
Persistent Volume Claims for Azure SQL Edge
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: sqlsystem-pvc
spec:
volumeName: sqlsystem-pv
accessModes:
- ReadWriteOnce
resources:
requests:
@dbafromthecold
dbafromthecold / main.go
Last active May 15, 2021 11:55
SqlContainerFromScratch
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strconv"
"syscall"