Skip to content

Instantly share code, notes, and snippets.

🎧
Groovin'

Pat Migliaccio patmigliaccio

🎧
Groovin'
View GitHub Profile
@patmigliaccio
patmigliaccio / docker-commands.md
Created Aug 1, 2020
A generic set of commands to reference when working with Docker
View docker-commands.md

Docker Commands

A generic set of commands to reference when working with Docker

Containers

Create Container

$ sudo docker run --name mydb -e MYSQL_ROOT_PASSWORD=pass -d mysql:latest
@patmigliaccio
patmigliaccio / linux-ssh-keys.md
Created Aug 1, 2020
A list of steps to generate new SSH keys to a new Linux VM / machine
View linux-ssh-keys.md

Linux SSH Keys

A list of steps to generate new SSH keys to a new Linux VM / machine.

Generate a New Key

$ ssh-keygen -t rsa -b 2048

Enter file in which to save the key (/home/<user>/.ssh/id_rsa): ~/.ssh/**azure_key**
@patmigliaccio
patmigliaccio / install-cf-gae-ssl.md
Last active Aug 1, 2020
Configuring Cloudflare SSL/TLS certificates on Google App Engine
View install-cf-gae-ssl.md

Configuring Cloudflare SSL/TLS on Google App Engine

Implementing end-to-end HTTPS encryption with CloudFlare for Google App Engine applications.

Google App Engine - Custom Domains

Add Domains

Register the root domain with Google Cloud Platform at the following:

@patmigliaccio
patmigliaccio / create_env.py
Created Apr 24, 2020
decodes an `ENV_FILE` env variable from a base 64 string in a .env file
View create_env.py
import os
import base64
encoded_env_file = os.environ.get("ENV_FILE")
if encoded_env_file != None:
decoded_env_file = base64.b64decode(encoded_env_file).decode('utf-8')
with open("./" + str(os.environ.get("FILE_NAME", ".env")), "w") as text_file:
text_file.write(decoded_env_file)
@patmigliaccio
patmigliaccio / lessons-ml-gcp-18.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-18.sh
for node in $(kubectl get nodes -l cloud.google.com/gke-nodepool=default-pool -o=name); do
kubectl drain --force --ignore-daemonsets --delete-local-data --grace-period=10 "$node";
done
@patmigliaccio
patmigliaccio / lessons-ml-gcp-17.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-17.sh
for node in $(kubectl get nodes -l cloud.google.com/gke-nodepool=default-pool -o=name); do
kubectl cordon "$node";
done
@patmigliaccio
patmigliaccio / lessons-ml-gcp-16.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-16.sh
gcloud container node-pools create my-pool \
--cluster=my-cluster \
--machine-type=n1-highmem-2 \
--num-nodes 1 --enable-autoscaling
--min-nodes 1 --max-nodes 3
@patmigliaccio
patmigliaccio / lessons-ml-gcp-15.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-15.sh
kubectl create -f ingress-service.yml
# Verify exposed IP address is ready
kubectl get ingress
@patmigliaccio
patmigliaccio / lessons-ml-gcp-14.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-14.sh
# Adds the converted origin certficate
gcloud compute ssl-certificates create ingress-cert \
--certificate ./certs/<DOMAIN>.pem \
--private-key ./certs/<DOMAIN>.key
@patmigliaccio
patmigliaccio / lessons-ml-gcp-13.yaml
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-13.yaml
# ingress-service.yaml
---
apiVersion: "extensions/v1beta1"
kind: "Ingress"
metadata:
name: "ingress"
annotations:
kubernetes.io/ingress.global-static-ip-name: "my-dev-ip"
ingress.gcp.kubernetes.io/pre-shared-cert: "ingress-cert"
spec:
You can’t perform that action at this time.