This file contains 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 zsh | |
# This script assumes that you store all your charts in a single repo | |
# under a single folder called charts-folder. It will go back through previous versions | |
# of the code and upload all of them into your chart registry. | |
# This script assumes that you have updated the chart version in `Chart.yaml` | |
# whenever a change has been made in the chart. If this is not the case, you can | |
# switch off version checking by disabling the check on line 54. |
This file contains 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
# Ah yes, the lovely, undocumented, and not-at-all-irrationally-difficult-to-understand ArgoCD method of chart customisation - plugins... | |
# If you are struggling to install the "lovely" plugin (or any plugin for that matter) with the ArgoCD Helm chart, this Gist could help you. | |
# Include this values config file as part of a Helm/Helmfile values argument to include the "lovely" plugin in your ArgoCD deployment. | |
# "Lovely" includes several popular tools for helm chart management, including the brilliant Helmfile, which itself includes | |
# "Vals" for secrets management. | |
--- | |
argo-cd: | |
configs: |
This file contains 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
# This gist describes how to undelete files in GCS while retaining most of the metadata. | |
# GCS doesn't seem to use delete markers like AWS. If anyone knows a better way please say so in the comments. | |
# I couldn't find any examples of how to do this other than in the UI. | |
# GCS documentation doesn't seem to include instructions for restoring versioned objects in python, but I found | |
# that this method works. Confusingly they use terms like version, generation, and revision interchangably in | |
# the documentation. I couldn't understand how object deletion works on versioned buckets. | |
import tempfile | |
from google.cloud import storage |
This file contains 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
# This example shows how you can export your Hashicorp Terraform Cloud state files out of | |
# Terraform Cloud and into a bucket storage provider, with the full history. | |
# This example assumes that you have object versioning enabled on your bucket storage. | |
# The example is written for using Google Cloud Storage, but can be adapted for any storage provider. | |
# Before you run the code, you need to generate an API token in Terraform Cloud, and export it as "TFE_TOKEN" in your shell. | |
# pip install terrasnek google-cloud-storage ipython |
This file contains 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
# From: | |
# https://dl.photoprism.org/docker/docker-compose.yml | |
version: '3.5' | |
# Example Docker Compose config file for PhotoPrism (Linux / AMD64) | |
# | |
# Documentation : https://docs.photoprism.org/getting-started/docker-compose/ | |
# Docker Hub URL: https://hub.docker.com/r/photoprism/photoprism/ | |
# | |
# Please run behind a reverse proxy like Caddy, Traefik or Nginx if you need HTTPS / SSL support |
This file contains 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
# This script will explain how to transfer a file to EC2 using SSM ONLY! | |
# You will need to have permission to run SSM commands on the target machine and have sudo access as well | |
# Infos | |
INSTANCE_ID=i-1234567890 | |
FILE_NAME=the_file.tar.gz | |
# Step 1: Run command on machine to install netcat and dump from port to filename | |
# < Start session |
This file contains 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 -e | |
# How to use this script: | |
# 1. Follow these instructions to configure a single AWS account to do initial login with SSO | |
# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html | |
# 2. Export AWS_PROFILE=... and then run "aws sso login" to get an SSO token | |
# 3. Once signed in with AWS SSO, run this script to automatically list out all the other accounts and roles and add them to your config file | |
# If you want to filter roles / accounts in the process, or validate config before committing it, you can customise the script to do this. |
This file contains 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/zsh | |
# Do merged git branches clutter up your local machine? | |
# This handy script can automatically clean them up for you. | |
# To install - put the script somewhere on the filesystem and add a source command to your .bashrc / .zshrc | |
# e.g. - 'source ~/code/scrapbook/cleanup_git.sh' | |
# When the script is sourced you will get two commands - | |
# "gitclean" - delete merged branches in current folder (with prompt) |
This file contains 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
# If your pod container doesn't have bash in the path, you might need to replace `bash` with `/bin/bash/`, `/bin/sh` or `/bin/ash`. | |
# Simple string from the command line - puts the literal text 'AAA' into a new file /tmp/test.txt | |
echo 'AAA' > kubectl -n MyNamespace exec -ti $my_pod_id -c my-pod-container -- bash -c 'cat - > /tmp/test.txt' | |
# Copy / inject a file from the local filesystem into a new file in the pod in the remote kubernetes cluster | |
kubectl -n MyNamespace exec -i $my_pod_id -c my-pod-container -- bash -c 'cat - > /tmp/file.txt' </my/input/file.txt |
This file contains 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
# Ever wondered which modules are the most popular? Well.. here they are. The top 500 PyPI modules, by download | |
urllib3, 910195765 | |
six, 749120890 | |
botocore, 670113460 | |
python-dateutil, 629757389 | |
pip, 629606070 | |
requests, 626954494 | |
s3transfer, 595019137 | |
certifi, 570148733 |
NewerOlder