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="${USER}-cilium" | |
| export AWS_DEFAULT_REGION="eu-central-1" | |
| export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf" | |
| export TAGS="[email protected] 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 | |
| set -euxo pipefail | |
| CLUSTER_NAME="rancher-dev" | |
| k3d cluster delete --all | |
| k3d cluster create "${CLUSTER_NAME}" \ | |
| --port "8080:80@loadbalancer" --port "8443:443@loadbalancer" \ |
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 | |
| set -euxo pipefail | |
| CLUSTER_NAME="dev" | |
| k3d cluster delete --all | |
| k3d cluster create "${CLUSTER_NAME}" \ | |
| --port "8080:80@loadbalancer" --port "8443:443@loadbalancer" \ |
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
| # Install blackbox-exporter | |
| apt update | |
| apt install -y prometheus-blackbox-exporter | |
| # Chnage the garfana agent config file /etc/grafana-agent.yaml | |
| cat > /etc/grafana-agent.yaml << EOF | |
| integrations: | |
| agent: | |
| enabled: true |
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
| ZONE_NAME="test.example.com" | |
| ZONE_ID=$(aws route53 list-hosted-zones --query "HostedZones[?Name==\`${ZONE_NAME}.\`].Id" --output text) | |
| aws route53 list-resource-record-sets --hosted-zone-id "${ZONE_ID}" | jq -c '.ResourceRecordSets[] | select (.Type != "SOA" and .Type != "NS")' | | |
| while read -r RESOURCERECORDSET; do | |
| aws route53 change-resource-record-sets \ | |
| --hosted-zone-id "${CLUSTER_FQDN_ZONE_ID}" \ | |
| --change-batch '{"Changes":[{"Action":"DELETE","ResourceRecordSet": '"${RESOURCERECORDSET}"' }]}' \ | |
| --output text --query 'ChangeInfo.Id' | |
| done |
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
| GET_NODES=$(kubectl get node -o=custom-columns='NAME:metadata.name' | grep -v ^NAME) | |
| for NODE in ${GET_NODES}; do | |
| echo -en "${NODE}:\t" | |
| kubectl get po --field-selector=status.phase=Running --all-namespaces -o json | jq -r ".items[] | select(.spec.nodeName==\"${NODE}\") | .metadata.name" | wc -l | |
| done |
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 -eu | |
| HEADSET=$(pacmd list-sinks | sed -n 's/.*name: <\(.*output.*Headset.*\)>/\1/p') | |
| HEADSET_MIC=$(pacmd list-sources | sed -n 's/.*name: <\(.*input.*Headset.*\)>/\1/p') | |
| pacmd "set-default-sink ${HEADSET}" | |
| pacmd "set-default-source ${HEADSET_MIC}" | |
| pactl set-sink-mute "${HEADSET}" 0 | |
| pactl set-sink-volume "${HEADSET}" 80% |
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 -eux | |
| DEVICE="sdc" | |
| lsblk --output NAME,MODEL,MODEL | grep ${DEVICE} | |
| read -r -p "Press enter to remove everything from ${DEVICE}" | |
| curl -L https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-09-26/2022-09-22-raspios-bullseye-arm64-lite.img.xz | xzcat | sudo dd of=/dev/${DEVICE} bs=4M | |
| sudo partprobe /dev/${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
| # You have defined the "cna.example.cloud" zone in Route53 | |
| # You want to create subdomain "${USER}-k8s.cna.example.cloud" and configure proper delegation form parrent zone | |
| echo "* Create DNS zone ${USER}-k8s.cna.example.cloud" | |
| aws route53 create-hosted-zone --output json \ | |
| --name ${USER}-k8s.cna.example.cloud \ | |
| --caller-reference "$(date)" \ | |
| --hosted-zone-config="{\"Comment\": \"Created by ${USER}@example.com\", \"PrivateZone\": false}" | jq |
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
| GITHUB_USERNAME="${GITHUB_USERNAME:-ruzickap}" | |
| DESTINATION_DIRECTORY="${DESTINATION_DIRECTORY:-/root/.ssh}" | |
| [[ ! -d "${DESTINATION_DIRECTORY}" ]] && mkdir -v --mode=0700 "${DESTINATION_DIRECTORY}" | |
| wget "https://github.com/${GITHUB_USERNAME}.keys" -O "${DESTINATION_DIRECTORY}/authorized_keys" | |
| chmod 0600 "${DESTINATION_DIRECTORY}/authorized_keys" |