This file contains hidden or 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 | |
set -ex | |
default_route_dev="$(ip -br route | awk '/default/ { print $5; exit }')" | |
ethtool "${default_route_dev}" |
This file contains hidden or 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
root_vm() { | |
vm=$2 | |
ns=$1 | |
kubectl exec -n ${ns} $(kubectl get -n ${ns} pod -l vm.kubevirt.io/name=${vm} -o name) -- virsh set-user-password 1 root password | |
virtctl console -n ${ns} ${vm} | |
} |
This file contains hidden or 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 | |
set -ex | |
tdnf update | |
tdnf install -y openssh-server | |
tdnf install -y moby-containerd moby-cli moby-buildx moby-engine moby-runc | |
tee /etc/docker/daemon.json <<EOF | |
{ | |
"exec-opts": ["native.cgroupdriver=systemd"], | |
"log-driver": "journald" |
This file contains hidden or 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 | |
set -ex | |
kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml | |
cat <<EOF | kubectl apply -f - | |
# This section includes base Calico installation configuration. | |
# For more information, see: https://docs.projectcalico.org/v3.19/reference/installation/api#operator.tigera.io/v1.Installation | |
apiVersion: operator.tigera.io/v1 | |
kind: Installation | |
metadata: |
This file contains hidden or 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
--- | |
# Source: openstack/templates/Secret-config.yaml | |
apiVersion: v1 | |
data: | |
06b06dca3e9ef97d123a5d4d04535da9eec66d58d27815b08e9227dab66bea24: CltERUZBVUxUXQp2aWZfcGx1Z2dpbmdfdGltZW91dCA9IDMwMAp2aWZfcGx1Z2dpbmdfaXNfZmF0YWwgPSBUcnVlCmNvbXB1dGVfZHJpdmVyID0gbGlidmlydC5MaWJ2aXJ0RHJpdmVyCmRlZmF1bHRfZXBoZW1lcmFsX2Zvcm1hdCA9IGV4dDQKcG9pbnRlcl9tb2RlbCA9IHBzMm1vdXNlCmdyYWNlZnVsX3NodXRkb3duX3RpbWVvdXQgPSA1Cm1ldGFkYXRhX3dvcmtlcnMgPSAyCm9zYXBpX2NvbXB1dGVfd29ya2VycyA9IDIKdHJhbnNwb3J0X3VybCA9IHJhYmJpdDovL25vdmE6cGFzc3dvcmRAUkVMRUFTRS1OQU1FLW9wZW5zdGFjazo1NjcyL25vdmEKbG9nZ2luZ19leGNlcHRpb25fcHJlZml4ID0gRVJST1IgJShuYW1lKXMgG1swMTszNW0lKGluc3RhbmNlKXMbWzAwbQpsb2dnaW5nX2RlZmF1bHRfZm9ybWF0X3N0cmluZyA9ICUoY29sb3IpcyUobGV2ZWxuYW1lKXMgJShuYW1lKXMgWxtbMDA7MzZtLSUoY29sb3Ipc10gG1swMTszNW0lKGluc3RhbmNlKXMlKGNvbG9yKXMlKG1lc3NhZ2UpcxtbMDBtCmxvZ2dpbmdfY29udGV4dF9mb3JtYXRfc3RyaW5nID0gJShjb2xvcilzJShsZXZlbG5hbWUpcyAlKG5hbWUpcyBbG1swMTszNm0lKGdsb2JhbF9yZXF1ZXN0X2lkKXMgJShyZXF1ZXN0X2lkKXMgG1swMDszNm0lKHByb2plY3RfbmFtZSlzICUodXNlcl9uYW1lKXMlKG |
This file contains hidden or 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 tee /etc/sysctl.d/k8s.conf <<EOF | |
net.bridge.bridge-nf-call-ip6tables = 1 | |
net.bridge.bridge-nf-call-iptables = 1 | |
EOF | |
sudo sysctl --system | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends docker.io apt-transport-https curl | |
This file contains hidden or 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 | |
image_pool="/var/lib/libvirt/images" | |
sudo curl -o "${image_pool}/ubuntu-20.04.qcow2" -L https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-disk-kvm.img | |
sudo curl -o "${image_pool}/ubuntu-18.04.qcow2" -L https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img | |
sudo modprobe nbd | |
function find_nbd() { | |
for dev in /sys/class/block/nbd*; do | |
local size |
This file contains hidden or 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 virsh destroy airshipctl | |
sudo virsh undefine airshipctl | |
sudo rm -rf /var/lib/libvirt/images/airshipctl.qcow2 /var/lib/libvirt/boot/airshipctl_config.iso | |
sudo qemu-img create -f qcow2 -o \ | |
backing_file=/var/lib/libvirt/images/base/bionic-server-cloudimg-amd64.qcow2 \ | |
/var/lib/libvirt/images/airshipctl.qcow2 | |
sudo qemu-img resize /var/lib/libvirt/images/airshipctl.qcow2 +250G | |
cat > /tmp/script.sh <<'EOS' |
This file contains hidden or 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
rsync -avxHAX --progress /media/harbor/writable/ /media/harbor/root | |
sed -i '/^LABEL=writable/d' /media/harbor/root/etc/fstab | |
sed -i '1 i\LABEL=root\t/\txfs\tdefaults\t0\t0' /media/harbor/root/etc/fstab | |
sed -i 's/root=LABEL=writable/root=LABEL=root/' /media/harbor/system-boot/nobtcmd.txt | |
sed -i 's/rootfstype=ext4/rootfstype=xfs/' /media/harbor/system-boot/nobtcmd.txt | |
#see https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245931 | |
echo " usb-storage.quirks=152d:1561:u" >> /media/harbor/system-boot/nobtcmd.txt | |
#see https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1848790 | |
echo "total_mem=3072" >> /media/harbor/system-boot/usercfg.txt |
This file contains hidden or 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 yum install "kernel-devel-uname-r == $(uname -r)" |
NewerOlder