Skip to content

Instantly share code, notes, and snippets.

View lastcoolnameleft's full-sized avatar

Tommy Falgout lastcoolnameleft

View GitHub Profile
@lastcoolnameleft
lastcoolnameleft / Setup Commands
Last active June 6, 2022 13:23
Azure Container Registry to Minikube token passing
REG=sandboxtmf
az acr login -n $REG
# Works only on OSX. Windows uses wincred, so someone would need to figure out the equivalent
TOKEN=`security find-internet-password -s $REG.azurecr.io -w`
USER=00000000-0000-0000-0000-000000000000
kubectl create secret docker-registry acr-auth --docker-server $REG.azurecr.io --docker-password=$TOKEN --docker-username=$USER
kubectl apply -f /tmp/deploy.yaml
@lastcoolnameleft
lastcoolnameleft / Dockerfile
Last active August 8, 2019 18:22
Azure Functions Development Dockerfile
FROM ubuntu:bionic
# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-apt?view=azure-cli-latest#manual-install-instructions
# https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#linux
RUN apt-get update
RUN apt-get -y install lsb-release ca-certificates curl apt-transport-https lsb-release gnupg libssl1.0.0 libssl-dev python3-distutils python3-pip
# HACk! func looks for pip, not pip3
RUN ln -s /usr/bin/pip3 /usr/bin/pip
@lastcoolnameleft
lastcoolnameleft / generate_sas.py
Last active January 20, 2023 07:07
Generate Azure Blob SAS Token with Python
from datetime import datetime, timedelta
from azure.storage.blob import (
BlockBlobService,
ContainerPermissions,
BlobPermissions,
PublicAccess,
)
AZURE_ACC_NAME = '<account_name>'
AZURE_PRIMARY_KEY = '<account_key>'
@lastcoolnameleft
lastcoolnameleft / coredns-custom.yaml
Created September 23, 2019 19:57
AKS CoreDNS custom rule
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns-custom
namespace: kube-system
data:
test.server: |
lastcoolnameleft.com:53 {
log
errors
@lastcoolnameleft
lastcoolnameleft / Overview.md
Last active October 6, 2019 06:38
Makerspace Management Software

Options:

  • OneSiren - No software to download. No real way to evaluate
  • Fabman -
    • Pro: comprehensive.
    • Con:
      • Paid (€79/ month) + 1% transaction fee on top of Stripe.
  • They want you to buy their own hardware.
bash-3.2$ kubectl get pods --namespace voting -w
NAME READY STATUS RESTARTS AGE
voting-analytics-1-0-79fbdb99f9-b6v8c 2/2 Running 0 15m
voting-analytics-1-1-77b6987669-tw9k4 2/2 Running 0 9m50s
voting-analytics-2-0-688f654c6-rdgkf 0/2 PodInitializing 0 8s
voting-app-1-0-ffb8c5dbf-26sn6 2/2 Running 0 15m
voting-app-1-0-ffb8c5dbf-gxl6n 2/2 Running 0 15m
voting-app-1-0-ffb8c5dbf-lsqfn 2/2 Running 0 15m
voting-app-2-0-5cf65b7ccb-cwn65 0/2 PodInitializing 0 7s
voting-app-2-0-5cf65b7ccb-hmrpv 0/2 PodInitializing 0 7s
@lastcoolnameleft
lastcoolnameleft / code-gen.sh
Created October 18, 2019 19:13
random-code-generator
#!/bin/sh
a=0
while [ $a -lt 1000 ]
do
# echo $a
a=`expr $a + 1`
@lastcoolnameleft
lastcoolnameleft / function.sh
Last active October 19, 2019 04:55
Code Generation
gen_random() {
NUM=$1
if [ $(($NUM%1000000)) -eq 0 ]; then
echo $NUM
fi
RAND=$(head /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~\n\t' | head -c100)
echo "$RAND" | gcc -x c - > /dev/null 2>&1
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo 'SUCCESSFULLY COMPILED!' $NUM
@lastcoolnameleft
lastcoolnameleft / walkthrough.md
Last active October 24, 2019 15:49
Kubernetes Fundamentals Demo

Create Cluster

RG=dol-demo
K8S_NAME=dol-demo

az group create -n $RG -l southcentralus
az aks create -g $RG -n $K8S_NAME --enable-vmss
@lastcoolnameleft
lastcoolnameleft / ingress.yaml
Last active June 11, 2020 14:19
Combining APIM + AKS
## Overview
There are 3 options listed here: https://docs.microsoft.com/en-us/azure/api-management/api-management-kubernetes
* APIM + Public AKS Service, no shared Vnet
* APIM + Public AKS Ingress, no shared Vnet
* APIM + Private AKS in same Vnet, no ingress
A missing scenario is:
* APIM + Private AKS in same Subnet, with ingress