Skip to content

Instantly share code, notes, and snippets.

@timoyuen
timoyuen / gist:a48c9c4d698aca225112aaadeb516247
Created May 18, 2017 05:59 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@timoyuen
timoyuen / docker-send
Created August 11, 2017 14:14 — forked from flungo/docker-send
Script for sending docker images between machines using SSH
#!/bin/bash
# MIT License
#
# Copyright (c) 2017 Fabrizio Lungo <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@timoyuen
timoyuen / docker-send
Created August 11, 2017 14:14 — forked from flungo/docker-send
Script for sending docker images between machines using SSH
#!/bin/bash
# MIT License
#
# Copyright (c) 2017 Fabrizio Lungo <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@timoyuen
timoyuen / backup-all-docker-images.sh
Created August 11, 2017 14:18 — forked from jrenggli/backup-all-docker-images.sh
Backup/Save all Docker Images to a compressed file
docker images | tail -n +2 | grep -v "none" | awk '{printf("%s:%s\n", $1, $2)}' | while read IMAGE; do
echo $IMAGE
filename="${IMAGE//\//-}"
filename="${filename//:/-}.docker-image.gz"
docker save ${IMAGE} | pigz --stdout --best > $filename
done
@timoyuen
timoyuen / config.yml
Created August 18, 2017 05:19
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@timoyuen
timoyuen / zeromq_install.sh
Created December 29, 2017 05:29 — forked from cdjhlee/zeromq_install.sh
install zeromq in ubuntu 14.04
#!/usr/bin/bash
##############################################
#from http://zeromq.org/intro:get-the-software
##############################################
#get zeromq
wget http://download.zeromq.org/zeromq-4.0.5.tar.gz
#unpack tarball package

Ingress configuration options per platform.

Platform Host Port Node Port Cluster IP Provider
Bare-Metal Y Y Y NA
Google Cloud Y N N GLBC
AWS Y Y N NA
DigitalOcean Y Y N NA
Azure Y Y N NA
@timoyuen
timoyuen / kubeadm-install-offline.md
Created February 11, 2018 12:15 — forked from jgsqware/kubeadm-install-offline.md
Offline Kubeadm install

On master and nodes

Pull images form internet access laptop

docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-controller-manager-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-proxy-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-scheduler-amd64:v1.5.0
docker pull weaveworks/weave-npc:1.8.2
docker pull weaveworks/weave-kube:1.8.2
@timoyuen
timoyuen / rails-todo-hab-kube.sh
Created March 7, 2018 14:07 — forked from devigned/rails-todo-hab-kube.sh
Kubernetes commands for deploying Rails todo from private registry
# fetch the hostname of the Azure Container Registry
registry=$(az acr list -g habitat-k8s --query "[?starts_with(name, 'habk8s')] | [0].loginServer" -o tsv)
# run the image sourced from the private repository, and expose port 3000
kubectl run rails-todo --image=${registry}/rails-todo:latest --port 3000
# watch our pod provision
watch kubectl get po
# once the pod is running exit watch
@timoyuen
timoyuen / minio-distributed-statefulset.yaml
Created March 8, 2018 08:35 — forked from nitisht/minio-distributed-statefulset.yaml
Create a distributed Minio deployment based on StatefulSets
apiVersion: v1
kind: Service
metadata:
name: minio
labels:
app: minio
spec:
clusterIP: None
ports:
- port: 9000