create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: federation-controller-manager | |
namespace: federation | |
labels: | |
app: federated-cluster | |
spec: | |
template: | |
metadata: |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: federation-apiserver | |
namespace: federation | |
labels: | |
app: federated-cluster | |
spec: | |
template: | |
metadata: |
Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f bkp
.
Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.
Please note: This has not been tested with all resource types. Supported resource types include:
# Ubuntu 14.04 don't have nsenter - the straight forward way required me to install build tools and etc. | |
# I preferred to keep the system clean and install nsenter in a container and then copy the command to the host | |
# Note - its also possible to run nsenter from a container (didn't tried) https://github.com/jpetazzo/nsenter | |
# start a container | |
docker run --name nsenter -it ubuntu:14.04 bash | |
## in the docker | |
apt-get update | |
apt-get install git build-essential libncurses5-dev libslang2-dev gettext zlib1g-dev libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf automake autopoint libtool |
#!/bin/bash | |
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) ) | |
rulefile="rules.tmp" | |
echo "" > $rulefile | |
sudo pfctl -a com.apple/tun -F nat | |
for i in "${interfaces[@]}" | |
do | |
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}" | |
echo $RULE >> $rulefile | |
done |
package main | |
import ( | |
"fmt" | |
"math" | |
"strconv" | |
) | |
var ( | |
sizeInMB float64 = 999 // This is in megabytes |
# Source: https://flowerinthenight.com/blog/2019/02/05/golang-cobra-klog | |
package main | |
import ( | |
goflag "flag" | |
"github.com/spf13/cobra" | |
flag "github.com/spf13/pflag" | |
"k8s.io/klog" | |
) |