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
| # Requires kubernetes and Helm v3 installed | |
| # Install using Helm chart | |
| helm repo add anchore https://charts.anchore.io | |
| helm install anchore-1 anchore/anchore-engine | |
| # Connect to cli | |
| kubectl exec service/anchore-1-anchore-engine-api -it /bin/bash |
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
| import boto3 | |
| from botocore.exceptions import ClientError | |
| def invalidate_key(id, secret): | |
| iam = boto3.client('iam', aws_access_key_id=id, aws_secret_access_key=secret) | |
| try: | |
| iam.update_access_key( | |
| AccessKeyId=id, |
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
| import boto3 | |
| import botocore | |
| def validate_key(id, secret): | |
| sts = boto3.client('sts', aws_access_key_id=id, aws_secret_access_key=secret) | |
| try: | |
| identity = sts.get_caller_identity() | |
| print('Identity ARN: ' + identity['Arn']) | |
| except botocore.exceptions.ClientError as e: |
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
| # When you need to remove a tag from a bunch of Terraform | |
| find . -type f -name "*.tf" -exec sed -i -e '/^.*git_commit.*$/d' {} \; | |
| # Probably want to delete the "-e" files that were created for all files that didn't have the tag in them | |
| find . -type f -name "*.tf-e" -delete |
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
| curl -fsSL https://tailscale.com/install.sh | sh | |
| sudo tailscale up --advertise-tags=tag:server --ssh --accept-routes | |
| sudo tailscale up --advertise-routes=10.1.0.0/24 --advertise-exit-node --advertise-tags=tag:server,tag:demo --ssh --accept-routes |
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
| Host * | |
| UseKeychain yes | |
| AddKeysToAgent yes | |
| IdentityFile ~/.ssh/id_rsa | |
| Host pi | |
| HostName raspberrypi.local | |
| User pi | |
| StrictHostKeyChecking no | |
| UserKnownHostsFile=/dev/null |
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 | |
| # First copy your ssh key over | |
| ssh-copy-id pi | |
| # then ssh to the pi | |
| ssh pi | |
| # change the default password | |
| sudo passwd pi |
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 | |
| # Install relevant dependencies for NFS / Longhorn | |
| sudo apt install nfs-common open-iscsi | |
| curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="---options---" sh - | |
| Options: | |
| --disable traefik | |
| --disable servicelb |
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 | |
| helm repo add rancher-stable https://releases.rancher.com/server-charts/stable | |
| helm repo add bitnami https://charts.bitnami.com/bitnami | |
| helm repo add k8s-at-home https://k8s-at-home.com/charts/ | |
| helm repo add mojo2600 https://mojo2600.github.io/pihole-kubernetes/ | |
| helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
| helm repo add stable https://charts.helm.sh/stable | |
| helm repo add devtron https://helm.devtron.ai | |
| helm repo add fluxcd https://charts.fluxcd.io |