a.k.a. what to do when your ISP starts blocking sites :(
1 ssh to remote server as a SOCKS server
ssh -D 6080 {user}@{ssh_server} -p {ssh_port}
| #!/bin/bash | |
| # Example for the Docker Hub V2 API | |
| # Returns all images and tags associated with a Docker Hub organization account. | |
| # Requires 'jq': https://stedolan.github.io/jq/ | |
| # set username, password, and organization | |
| UNAME="" | |
| UPASS="" | |
| ORG="" |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
The most recent release from the LTS series: http://openvswitch.org/releases/openvswitch-2.5.4.tar.gz
Instructions:
As the root user let’s install some packages:
yum -y install wget openssl-devel gcc make python-devel openssl-devel kernel-devel graphviz kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool python-twisted-core python-zope-interface PyQt4 desktop-file-utils libcap-ng-devel groff checkpolicy selinux-policy-devel
Add a new user and switch to that user:
| #!/bin/bash | |
| for container in $(docker ps -q); do | |
| iflink=`docker exec -it $container bash -c 'cat /sys/class/net/eth0/iflink'` | |
| iflink=`echo $iflink|tr -d '\r'` | |
| veth=`grep -l $iflink /sys/class/net/veth*/ifindex` | |
| veth=`echo $veth|sed -e 's;^.*net/\(.*\)/ifindex$;\1;'` | |
| echo $container:$veth | |
| done |
| function fish_prompt --description 'Write out the prompt' | |
| set laststatus $status | |
| function _git_branch_name | |
| echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') | |
| end | |
| function _is_git_dirty | |
| echo (git status -s --ignore-submodules=dirty ^/dev/null) | |
| end | |
| function _k8s_cluster | |
| echo (kubectl config view --minify --output 'jsonpath={..server}' 2>/dev/null | cut -d':' -f2 |cut -d'.' -f4) |
| #!/bin/bash | |
| # sudo loopmount file size mount-point | |
| touch $1 | |
| truncate -s $2 $1 | |
| mke2fs -t ext4 -F $1 1> /dev/null 2> /dev/null | |
| if [[ ! -d $3 ]]; then | |
| echo $3 " not exist, creating..." | |
| mkdir $3 |
| kubectl get pods --all-namespaces -o=json | jq -c '.items[] | {name: .metadata.name, namespace: .metadata.namespace, claimName: .spec | select( has ("volumes") ).volumes[] | select( has ("persistentVolumeClaim") ).persistentVolumeClaim.claimName }' |
| //step1:初始一个counter, with help string | |
| pushCounter = prometheus.NewCounter(prometheus.CounterOpts{ | |
| Name: "repository_pushes", | |
| Help: "Number of pushes to external repository.", | |
| }) | |
| //setp2: 注册容器 | |
| err = prometheus.Register(pushCounter) | |
| if err != nil { | |
| fmt.Println("Push counter couldn't be registered AGAIN, no counting will happen:", err) |