This file contains 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
#!/usr/env/bin/knife exec | |
# | |
# Based on: | |
# - https://gist.github.com/mpasternacki/1952431 | |
# | |
abort("usage: knife exec #{ARGV[1]} from_id to_id") unless ARGV[3] | |
require 'net/ssh' | |
require 'net/scp' |
This file contains 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
#!/usr/bin/env bash | |
sudo apt-get install -qqy git make build-essential libssl-dev zlib1g-dev libbz2-dev \ | |
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ | |
libncursesw5-dev libxml2-dev libxslt1-dev libffi-dev | |
curl -sL https://raw.github.com/yyuu/pyenv-installer/master/bin/pyenv-installer | \ | |
bash | |
export PATH="~/.pyenv/bin:$PATH" |
This file contains 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
#!/usr/bin/env bash | |
curl -sL https://raw.github.com/yyuu/pyenv-installer/master/bin/pyenv-installer | \ | |
PYENV_ROOT=/opt/pyenv USE_HTTPS=true bash | |
PYENV_ROOT=/opt/pyenv PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4" \ | |
/opt/pyenv/bin/pyenv install 2.7.9 | |
/opt/pyenv/versions/2.7.9/bin/pip install virtualenv | |
/opt/pyenv/versions/2.7.9/bin/virtualenv /opt/openstack/ |
This file contains 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
FROM tox-openstack-base:latest | |
WORKDIR /app | |
ARG BRANCH=kilo | |
ARG PROJECT | |
ENV UPPER_CONSTRAINTS_FILE=/upper-constraints.txt |
This file contains 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
#!/opt/openstack/venv/bin/python | |
import MySQLdb | |
import sys | |
import json | |
connection = MySQLdb.connect( | |
host=sys.argv[1], user="nova", | |
passwd=sys.argv[2], db="nova") | |
cursor = connection.cursor() | |
cursor.execute("select network_info, instance_uuid from instance_info_caches where deleted=0") |
This file contains 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
# 다운로드 및 빌드 | |
cd /tmp | |
wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz | |
tar zxvf openvswitch-2.3.1.tar.gz | |
mv openvswitch-2.3.1 /usr/src/ | |
cd /usr/src/openvswitch-2.3.1 | |
./boot.sh | |
./configure --with-linux=/lib/modules/`uname -r`/build --prefix=/usr --sysconfdir=/etc --localstatedir=/var | |
make -j |
This file contains 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
# node에서 아래처럼 kube-proxy 떠있는지 보시고 | |
# ps -ef | grep proxy | |
root 5217 5200 0 Jul14 ? 00:06:28 /usr/local/bin/kube-proxy --kubeconfig=/var/lib/kube-proxy/kubeconfig.conf | |
root 31473 31265 0 19:17 pts/1 00:00:00 grep --color=auto proxy | |
# 삭제하고 | |
kubectl delete -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml | |
# 아래처럼 service 의 type을 nodeport 로 변경 해준 다음에 다시 적용하면 | |
curl -s https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml | sed '/ targetPort: 9090/a\ \ type: NodePort' | kubectl create -f - |
This file contains 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
function kl() { | |
chkcommand() { | |
command -v $1 >/dev/null 2>&1 || { echo >&2 "Plz install $1 first. Aborting."; return 1; } | |
} | |
chkcommand fzf || return 1 | |
chkcommand tmux || return 1 | |
chkcommand kubectl || return 1 | |
pods=$(kubectl get pods --all-namespaces | sed '1d' | fzf -x -m -e +s --reverse --bind=left:page-up,right:page-down --no-mouse | awk '{print $1","$2}'); | |
if [[ $pods != "" ]]; then |
This file contains 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
$ vdoc 4c66d3b6d4fa | |
ADD file:9c48682ff75c756544d4491472081a078edf5dd0bb5038d1cb850a1f9c480e3e / | |
CMD ["bash"] | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends ca-certificates curl wget && \ | |
rm -rf /var/lib/apt/lists/* |
This file contains 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 | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
set -ex | |
apt update |