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/bash | |
REPO=${REPO:-rancher} | |
IMAGE=${IMAGE:-rancher-agent} | |
TAG=${TAG:-v2.5.1-rc1} | |
DESTREPO=${DESTREPO:-oats87} | |
DESTIMAGE=${DESTIMAGE:-$IMAGE} | |
DESTTAG=${DESTTAG:-$TAG} |
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 | |
sed -i "/\b\UUID\b/d" /etc/sysconfig/network-scripts/ifcfg-ens192 | |
rm -vf /etc/ssh/ssh_host_* | |
systemctl stop systemd-journald.socket | |
find /var/log -type f -exec rm {} \; | |
rm -rf /var/log/journal/* | |
rm /root/.bash_history; history -c | |
systemctl poweroff |
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
for i in $(kubectl get state -n hobbyfarm | awk '{print $1}' | grep -v "NAME"); do kubectl -n hobbyfarm patch state $i -p '{"metadata":{"finalizers": []}}' --type=merge; done |
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
etcdctl get / --prefix --endpoints=${ETCDCTL_ENDPOINTS} --keys-only | grep ${NAMESPACE} |
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
kubectl get configmap -n kube-system cattle-controllers -o json | jq -r '.metadata.annotations["control-plane.alpha.kubernetes.io/leader"]' | jq -r ".holderIdentity" |
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
fdisk /dev/sdb | |
mkdir /var/lib/docker | |
echo $(blkid /dev/sdb1 | awk '{print $2}' | sed -e 's/"//g') /var/lib/docker ext4 defaults 0 0 >> /etc/fstab | |
sed -i 's/\/dev\/mapper\/centos-swap/#\/dev\/mapper\/centos-swap/g' /etc/fstab | |
mount -a | |
reboot |
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
cat << EOF >> /etc/sysctl.conf | |
net.bridge.bridge-nf-call-iptables = 1 | |
net.bridge.bridge-nf-call-ip6tables = 1 | |
net.core.somaxconn = 32768 | |
EOF |
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
mkdir /etc/docker | |
cat << EOF > /etc/docker/daemon.json | |
{ | |
"log-driver": "json-file", | |
"log-opts": { | |
"max-size": "10m", | |
"max-file": "6" | |
} | |
} | |
EOF |
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/bash | |
export KUBECONFIG=$(pwd)/kube_config_cluster.yml | |
IFS=$'\n'; for i in $(kubectl get secrets --all-namespaces | grep "service-account-token"); do ns=$(echo $i | awk '{print $1}'); sec=$(echo $i | awk '{print $2}'); kubectl patch secret -n $ns $sec -p '{"metadata":{"finalizers": []}}' --type=merge && kubectl delete secret $sec -n $ns --wait=false; done | |
IFS=$'\n'; for i in $(kubectl get pods --all-namespaces | grep -v "NAME"); do ns=$(echo $i | awk '{print $1}'); pod=$(echo $i | awk '{print $2}'); kubectl delete pod $pod -n $ns --wait=false; done |
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
sudo diskutil list | |
sudo diskutil unmount /dev/disk<x> | |
hdiutil convert -format UDRW -o <img-to-flash> <original-iso>.iso | |
sudo dd if=<img-to-flash>.dmg of=/dev/rdisk<x> bs=4m |