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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USERNAME=$(whoami) | |
declare -a HOSTS=( | |
hostname1 | |
hostname2 | |
hostname3) | |
for i in "${HOSTS[@]}" |
create bare repo and workdir on master and slaves
cd ~
git init --bare projectname.git
mkdir projectname
create post-receive hooks on each slave
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USERNAME=username | |
WORK_DIR=/path/to/workdir | |
declare -a HOSTS=("hostname1" "hostname2" "hostname3") | |
function copy_files() | |
{ | |
scp -r "$WORK_DIR" "$USERNAME"@"$1":"$WORK_DIR" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
WORK_BRANCH=production | |
WORK_DIR=/path/to/workdir | |
COMPOSE_FILE=/path/to/docker-compose.yml | |
SU_PWD=sudo_pass | |
SERVICE=service_name | |
CMD=command | |
restart() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# get the latest linux kernel at http://kernel.ubuntu.com/~kernel-ppa/mainline/ | |
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14-rc6/linux-image-4.14.0-041400rc6-generic_4.14.0-041400rc6.201710230731_amd64.deb | |
# install the kernel | |
dpkg -i linux-image-4.*.deb | |
# update grub | |
# for linode, change kernel in boot settings to GRUB 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# step 1: 安装必要的一些系统工具 | |
sudo apt-get update | |
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common | |
# step 2: 安装GPG证书 | |
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - | |
# Step 3: 写入软件源信息 | |
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | |
# Step 4: 更新并安装 Docker-CE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"es6": true, | |
"node": true | |
}, | |
"extends": "eslint:recommended", | |
"parserOptions": { | |
"ecmaVersion": 8 | |
}, | |
"rules": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
slice() { | |
DIR=$(gm identify -format %d "$1") | |
FILENAME=$(gm identify -format %t "$1") | |
EXTENSION=$(gm identify -format %e "$1") | |
WIDTH=$(gm identify -format %w "$1") | |
OFFSET=$((WIDTH/2)) | |
if [ "$DIR" ]; then | |
FILENAME="${DIR}/${FILENAME}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
# Remove all stopped containers | |
docker rm $(docker ps -aq) | |
# Remove all untagged images | |
docker rmi $(docker images | grep "^<none>" | awk "{print $3}") |
NewerOlder