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
| # Set root password | |
| passwd | |
| # Enable SSH access from the WAN | |
| wget https://github.com/ruzickap.keys -O /etc/dropbear/authorized_keys | |
| cat >> /etc/config/firewall << 'EOF' | |
| config rule | |
| option name 'Allow-SSH' |
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
| #!/usr/bin/env bash | |
| # Build custom OpenWrt firmware using the Sysupgrade API | |
| # | |
| # Standalone script — no local Ansible code required. | |
| # Intended for use as a GitHub Gist. | |
| # | |
| # Required environment variables: | |
| # WIFI_SSID — WiFi network name (e.g. "MyNetwork") | |
| # WIFI_PASSWORD — WiFi password (WPA3/SAE-mixed) | |
| # PACKAGES — Space-separated list of extra packages to include |
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
| # https://openwrt.org/docs/guide-user/advanced/expand_root | |
| if [ ! -e /etc/rootfs-resize ] && [ -e /etc/rootpt-resize ] && lock -n /var/lock/root-resize; then | |
| ( | |
| set -eux | |
| date | |
| ROOT_BLK="$(readlink -f /sys/dev/block/"$(awk -e '$9=="/dev/root"{print $3}' /proc/self/mountinfo)")" | |
| ROOT_DEV="/dev/${ROOT_BLK##*/}" | |
| LOOP_DEV="$(awk -e '$5=="/overlay"{print $9}' /proc/self/mountinfo)" |
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
| # https://openwrt.org/docs/guide-user/advanced/expand_root | |
| if [ ! -e /etc/rootpt-resize ] && lock -n /var/lock/root-resize; then | |
| ( | |
| set -eux | |
| date | |
| ROOT_BLK="$(readlink -f /sys/dev/block/"$(awk -e '$9=="/dev/root"{print $3}' /proc/self/mountinfo)")" | |
| ROOT_DISK="/dev/$(basename "${ROOT_BLK%/*}")" | |
| ROOT_PART="${ROOT_BLK##*[^0-9]}" | |
| parted -f -s "${ROOT_DISK}" resizepart "${ROOT_PART}" 100% |
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
| parted --script /dev/sda mklabel gpt | |
| parted --script /dev/sda mkpart primary btrfs 0% 100% | |
| mkfs.btrfs --runtime-features free-space-tree --label My_Disk_2_TB --nodiscard /dev/sda1 | |
| # Entry in /etc/fstab | |
| # LABEL=My_Disk_2_TB /mnt/usb btrfs noatime,nodiratime,compress=zstd,autodefrag,space_cache=v2 | |
| # Links: | |
| # * https://wiki.tnonline.net/w/Btrfs/Space_Cache | |
| # * https://unix.stackexchange.com/questions/53378/how-can-i-script-the-creation-of-a-single-partition-that-uses-the-entire-device |
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
| #!/usr/bin/env bash | |
| export CLUSTER_NAME="ruzickap-calico" | |
| export AWS_DEFAULT_REGION="eu-central-1" | |
| export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf" | |
| export TAGS="Owner=petr.ruzicka@gmail.com Environment=dev" | |
| set -euxo pipefail |
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
| #!/usr/bin/env bash | |
| export AZURE_LOCATION=westeurope | |
| export CLUSTER_FQDN="ruzickap2aks.k8s.mylabs.dev" | |
| # CLUSTER_NAME must have max 12 character due to "--nodepool-name" parameter | |
| export CLUSTER_NAME="${CLUSTER_FQDN%%.*}" | |
| export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf" | |
| set -euxo pipefail |
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
| #!/usr/bin/env bash | |
| export AZURE_LOCATION="westeurope" | |
| export CLUSTER_FQDN="ruzickap1aks.k8s.mylabs.dev" | |
| # CLUSTER_NAME must have max 12 character due to "--nodepool-name" parameter | |
| export CLUSTER_NAME="${CLUSTER_FQDN%%.*}" | |
| export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf" | |
| set -euxo pipefail |
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
| #!/usr/bin/env bash | |
| export CLUSTER_NAME="ruzickap3" | |
| export AWS_DEFAULT_REGION="eu-central-1" | |
| export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf" | |
| export TAGS="Owner=petr.ruzicka@gmail.com Environment=dev" | |
| set -euxo pipefail |
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
| #!/usr/bin/env bash | |
| export CLUSTER_FQDN="${CLUSTER_FQDN:-ruzickap-kops-ubuntu.k8s.mylabs.dev}" | |
| export AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-eu-central-1}" | |
| export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_FQDN}.conf" | |
| export KOPS_STATE_STORE="s3://${CLUSTER_FQDN}" | |
| set -euxo pipefail | |
| ## Create S3 bucket first |
NewerOlder