I hereby claim:
- I am ursuad on github.
- I am ursuad (https://keybase.io/ursuad) on keybase.
- I have a public key ASA0k9R6djMVQSjquz69dEZEiAGa44zliIFXotpuntTVdwo
To claim this, I am signing this object:
# 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" | |
) |
package main | |
import ( | |
"fmt" | |
"math" | |
"strconv" | |
) | |
var ( | |
sizeInMB float64 = 999 // This is in megabytes |
#!/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 |
I hereby claim:
To claim this, I am signing this object:
# 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 |
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:
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: federation-apiserver | |
namespace: federation | |
labels: | |
app: federated-cluster | |
spec: | |
template: | |
metadata: |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: federation-controller-manager | |
namespace: federation | |
labels: | |
app: federated-cluster | |
spec: | |
template: | |
metadata: |
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |