talosctl gen config talos-kubevirt https://talos-kubevirt.home.arpa:6443 --additional-sans 192.168.1.70,talos-kubevirt --install-disk /dev/vda --output-dir $(pwd)/talos
❯ cat deploy.sh
#kubectl --kubeconfig $HOME/.kube/poweredge delete -f ./kubevirt/
#sleep 12
#kubectl --kubeconfig $HOME/.kube/poweredge apply -f ./kubevirt/
#sleep 120
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
| VIP="192.168.100.5" | |
| mkdir -p /etc/kubernetes/pki | |
| talosctl -n "$VIP" cat /etc/kubernetes/kubeconfig-kubelet > /etc/kubernetes/kubelet.conf | |
| talosctl -n "$VIP" cat /etc/kubernetes/bootstrap-kubeconfig > /etc/kubernetes/bootstrap-kubelet.conf | |
| talosctl -n "$VIP" cat /etc/kubernetes/pki/ca.crt > /etc/kubernetes/pki/ca.crt | |
| sed -i "/server:/ s|:.*|: https://${VIP}:6443|g" \ | |
| /etc/kubernetes/kubelet.conf \ | |
| /etc/kubernetes/bootstrap-kubelet.conf |
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
| func typeCache[T any](compute func(t reflect.Type) T) func(t reflect.Type) T { | |
| cache := map[reflect.Type]T{} | |
| return func(t reflect.Type) T { | |
| if v, ok := cache[t]; ok { | |
| return v | |
| } | |
| v := compute(t) // but compute cant recurse | |
| cache[t] = v | |
| return v | |
| } |
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
| git_color() { | |
| local git_status="$(git status 2> /dev/null)" | |
| local output_styles="" | |
| if [[ $git_status =~ "nothing to commit, working tree clean" ]]; then | |
| # red | |
| output_styles="9" | |
| elif [[ $git_status =~ "nothing added to commit but untracked files present" ]]; then | |
| # yellow | |
| output_styles="11" |
Welcome! This is a series of quick guides to setting up dev/test/lab environment with Tanzu Kubernetes Grid and/or with VMware Telco Cloud Automation.
This isn't a replacement for the official documentation but rather is a curated, streamlined set of "how tos" from several locations based on my experiences.
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 | |
| # given "https://www.icloud.com/iclouddrive/<ID>#<Filename> | |
| ID="...." | |
| URL=$(curl 'https://ckdatabasews.icloud.com/database/1/com.apple.cloudkit/production/public/records/resolve' \ | |
| --data-raw '{"shortGUIDs":[{"value":"$ID"}]}' --compressed \ | |
| jq -r '.results[0].rootRecord.fields.fileContent.value.downloadURL') | |
| curl "$URL" -o myfile.ext |
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
| # Force Juniper SRX110H2 to accept VDSL PIC firmware from Juniper jfirmware 17 release (For SRX300 series?) | |
| # it might work, it might not. do this at your own risk etc. i think it rolls back. haven't tried lol. | |
| # Testing using latest 17.4 release specifically from https://support.juniper.net/support/downloads/?p=junos-srx#sw. | |
| # At time of writing, "latest" was jfirmware-srxsme-17.4R3.16-signed.tgz - copy your shit to a fat32 usb | |
| # Make usb mountpoint (if you haven't already) | |
| root@% mkdir /var/tmp/usb | |
| # Mount the USB | |
| root@% mount_msdosfs /dev/da0s1 /var/tmp/usb |
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 | |
| SSH_DIR=$HOME/.ssh/ | |
| AUTH_KEYS_DIR=${SSH_DIR}/authorized_keys.d | |
| AUTH_KEYS_FILE=${SSH_DIR}/authorized_keys | |
| # Utils | |
| key-path() { | |
| echo "${AUTH_KEYS_DIR}/${1}" |
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 | |
| # Kenneth Finnegan, 2020 | |
| # https://blog.thelifeofkenneth.com/ | |
| # Huge thanks to Gandi.net for most of this code | |
| set -x | |
| set -e | |
| # Create the mount points for all of the virtual file systems which don't | |
| # actually map to disks, but are views into the kernel |
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
| // app.js: register the route. In our case, we don't want authorization for this route | |
| app.use('/healthcheck', require('./routes/healthcheck.routes')); | |
| // healthcheck.routes.js: return a 2xx response when your server is healthy, else send a 5xx response | |
| import express from 'express'; | |
| const router = express.Router({}); | |
| router.get('/', async (_req, res, _next) => { | |
| // optional: add further things to check (e.g. connecting to dababase) |
NewerOlder