Skip to content

Instantly share code, notes, and snippets.

@jeremyje
jeremyje / simple.yaml
Created February 5, 2021 08:44
Windows Containers
# kubectl apply -f https://gist.githubusercontent.com/jeremyje/173132cc4308db751d1cc1cd3d2213bb/raw/simple.yaml
kind: Pod
apiVersion: v1
metadata:
name: windows-pod-test
spec:
containers:
- name: windows-pod-test
image: mcr.microsoft.com/windows/nanoserver:1809
command:
@jeremyje
jeremyje / tmux.sh
Last active February 1, 2021 04:29
tmux.sh
#!/bin/bash
# curl -s -L -H 'Cache-Control: no-cache' https://gist.githubusercontent.com/jeremyje/3e630cada87536370c96ca234f570518/raw/tmux.sh | bash
sudo apt-get -y update
sudo apt-get -y install tmux
curl -s -o $HOME/.tmux.conf -L -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/gpakosz/.tmux/master/.tmux.conf
curl -s -o $HOME/.tmux.conf.local -L -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/gpakosz/.tmux/master/.tmux.conf.local
@jeremyje
jeremyje / install-containerd.sh
Last active December 17, 2020 07:53
Install Containerd on Linux
#!/bin/bash
# curl https://gist.githubusercontent.com/jeremyje/03e2de221b2592dfb5048b33be1d6d84/raw/install-containerd.sh | bash
CONTAINERD_VERSION=1.4.3
CRITOOLS_VERSION=1.19.0
curl -L https://github.com/containerd/containerd/releases/download/v${CONTAINERD_VERSION}/containerd-${CONTAINERD_VERSION}-linux-amd64.tar.gz | sudo tar -C /usr/local -xz
sudo curl -L https://raw.githubusercontent.com/containerd/containerd/master/containerd.service -o /etc/systemd/system/containerd.service
sudo systemctl stop containerd.service
sudo systemctl disable containerd.service
@jeremyje
jeremyje / pods.yaml
Last active November 20, 2020 17:58 — forked from YangLu1031/pods.yaml
Scripts to reproduce PLEG unhealthy issue
apiVersion: v1
kind: Pod
metadata:
name: test-pod
spec:
# Do not automount default service account, to eliminate its impact.
automountServiceAccountToken: false
nodeSelector:
kubernetes.io/os: windows
containers:
# # 1.17.12-gke.1501 is the earliest version to not install the KB package.
apiVersion: v1
kind: Pod
metadata:
name: agnhost-fixed
labels:
run: agnhost-fixed
spec:
containers:
@jeremyje
jeremyje / rdp.sh
Last active October 7, 2021 22:30
rdp
#!/bin/bash
# curl -s -L -H 'Cache-Control: no-cache' https://gist.githubusercontent.com/jeremyje/df65eee6cff02419cd1552ae9a03f85d/raw/rdp.sh | bash -s PROJECT_ID_OPTIONAL NETWORK_NAME_OPTIONAL
# Creates an allow firewall rule for your machine to access a Windows via RDP.
# This firewall rule will only apply to VMs with the "rdp" network tag.
# This script creates a firewall rule in the target project that accepts
# port 3389 traffic. You may need to change this every so often as your IP
# address changes.
#
# ./rdp.sh <PROJECT_ID> <NETWORK>
@jeremyje
jeremyje / Dockerfile
Last active June 22, 2020 21:20
Setup Docker on Windows Server
# https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile
# Sample Dockerfile
# Indicates that the windowsservercore image will be used as the base image.
FROM mcr.microsoft.com/windows/servercore:ltsc2019
# Metadata indicating an image maintainer.
LABEL maintainer="jshelton@contoso.com"
@jeremyje
jeremyje / osx.sh
Created April 11, 2020 18:36
Debug OSX Unzipping
#!/bin/bash
ARCHIVES_DIR=$PWD/archives
TOOLCHAIN_DIR=$PWD/toolchain
TOOLCHAIN_BIN=${TOOLCHAIN_DIR}/bin
THIRDPARTY_DIR=$PWD/third_party
mkdir -p ${ARCHIVES_DIR}/
curl -o ${ARCHIVES_DIR}/protoc.zip -L https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-osx-x86_64.zip
touch ${ARCHIVES_DIR}/protoc.zip
@jeremyje
jeremyje / codecahedron.sh
Last active April 21, 2020 05:34
Checkout Codecahedron Repositories
#!/bin/bash
# curl -L https://gist.githubusercontent.com/jeremyje/656b3d58f303594601723de7a0542509/raw/codecahedron.sh | bash
set -e
function Checkout {
REPO=$1
git clone git@github.com:jeremyje/${REPO}.git
cd ${REPO}
git remote add upstream git@github.com:codecahedron/${REPO}.git
git fetch origin
#!/bin/bash
# curl -L https://gist.githubusercontent.com/jeremyje/bc5a8f8bdfec1ee79f2fec82ff34f600/raw/tmux-conf.sh | bash
# Download https://github.com/gpakosz/.tmux
curl -o ~/.tmux.conf -L https://raw.githubusercontent.com/gpakosz/.tmux/master/.tmux.conf && curl -o ~/.tmux.conf.local -L https://raw.githubusercontent.com/gpakosz/.tmux/master/.tmux.conf.local