Skip to content

Instantly share code, notes, and snippets.

@vaayne
vaayne / rook.sh
Created January 16, 2020 06:24
Kubernetes Install Rook script
#! /bin/sh
if [[ $1 == "delete" ]]; then
kubectl delete -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/common.yaml
kubectl delete -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/operator.yaml
kubectl delete -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/cluster.yaml
kubectl delete -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
kubectl delete -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/toolbox.yaml
elif [[ $1 == "create" ]]; then
kubectl apply -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/common.yaml
@vaayne
vaayne / Kubeadm_master_init.sh
Last active January 16, 2020 05:58
Kubeadm master init
#!/bin/sh
echo "Init env"
curl https://gist.githubusercontent.com/Vaayne/043226626c1e7987613b9b5e7ea7bbaa/raw/b64f6c1c47e7f7aa2ec25431583259eea8bcde86/kubeadm_init_install.sh -o install.sh
sh install.sh
echo "Kubeadm init"
kubeadm init
echo "make kubectl usable"
@vaayne
vaayne / kubeadm_init_pre_install.sh
Last active January 16, 2020 04:40
Init kubeadm env for Ubuntu 18.04
#!/bin/sh
echo "Install Docker"
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Setup daemon.
cat >/etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
@vaayne
vaayne / xueqiu_header.py
Created July 30, 2019 05:32
Xueqiu Headers
def get_cookie_headers():
headers = {
'Referer': 'https://xueqiu.com/',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
}
r = requests.get('https://xueqiu.com/', headers=headers)
if r.status_code == 200:
cookies = r.raw.getheaders().get('Set-Cookie')
headers['Cookies'] = cookies
@vaayne
vaayne / docker-compose.yml
Created September 4, 2017 14:46 — forked from cboettig/docker-compose.yml
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter