Skip to content

Instantly share code, notes, and snippets.

Avatar

Fred Hsu fredhsu

View GitHub Profile
@fredhsu
fredhsu / showver.json
Created Jul 13, 2020
show version example eapi
View showver.json
{
"jsonrpc": "2.0",
"id": "EapiExplorer-1",
"result": [
{
"uptime": 26892007.46,
"modelName": "DCS-7050SX-64-R",
"internalVersion": "4.21.0F-9441269.4210F",
"systemMacAddress": "00:1c:73:7d:2d:fd",
"serialNumber": "JPE14140280",
@fredhsu
fredhsu / install-docker-deb-stretch.sh
Last active May 16, 2019
Install docker runtime for debian stretch
View install-docker-deb-stretch.sh
# Install Docker from Ubuntu's repositories:
sudo apt-get update
sudo apt-get install -y docker.io
# or install Docker CE 18.06 from Docker's repositories for Ubuntu or Debian:
## Install prerequisites.
sudo apt-get update && apt-get install apt-transport-https ca-certificates curl software-properties-common -y
## Download GPG key.
@fredhsu
fredhsu / install-kubeadm-deb-stretch.sh
Created Mar 28, 2019
Install kube services on debian stretch
View install-kubeadm-deb-stretch.sh
apt-get update && apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-stretch main
EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl
apt-mark hold kubelet kubeadm kubectl
@fredhsu
fredhsu / openshift-install.sh
Created Nov 14, 2018
Install OpenShift container platform package
View openshift-install.sh
# Assumes that subscription manager has been registered and repos added
sudo yum -y install wget git net-tools bind-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct
sudo yum -y update
sudo yum -y install atomic-openshift-utils
sudo yum -y install docker
@fredhsu
fredhsu / install-kubeadm.sh
Last active May 16, 2019
Install kubeadm after CRI is installed
View install-kubeadm.sh
sudo apt-get update && sudo apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
@fredhsu
fredhsu / kubeadm-docker-ubuntu.sh
Last active May 16, 2019
Install docker for kubeadm on Ubuntu
View kubeadm-docker-ubuntu.sh
# Install Docker from Ubuntu's repositories:
sudo apt-get update
sudo apt-get install -y docker.io
# or install Docker CE 18.06 from Docker's repositories for Ubuntu or Debian:
## Install prerequisites.
sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
@fredhsu
fredhsu / start-ec2-tag.sh
Created May 18, 2018
Start all ec2 instances with a specific usage tag
View start-ec2-tag.sh
aws ec2 start-instances --instance-ids $(aws ec2 describe-instances --filters "Name=tag:Usage,Values=kube" --query 'Reservations[*].Instances[*].[InstanceId]' --output text)
@fredhsu
fredhsu / install-docker.sh
Last active May 16, 2019
Install docker engine 1.12 on Ubuntu 16.04
View install-docker.sh
#!/bin/bash
sudo apt-get update
sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual -y
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
@fredhsu
fredhsu / ubuntudocker.sh
Last active Jun 6, 2021
Shell script to install Docker CE on ubuntu and post-install user configuration
View ubuntudocker.sh
#!/bin/bash
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
@fredhsu
fredhsu / addquotes.sh
Created Apr 6, 2017
One liner to add quotes, a carriage return, and a trailing comma with sed
View addquotes.sh
sed 's/.*/"&\\n",/'