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 | |
# Usage: kc [<partialmatch>] | |
# Where <partialmatch> can be any case insensitive string that partially matches one of your contexts. (not a regexp) | |
# If there's only one match, context will be switched. | |
# If there's more than one match, it'll list them so you can try again and be more specific. | |
# If there's no matches, context is not switched. Run it again without a pattern to see your contexts. | |
# If you don't supply a pattern, it just lists all your contexts. | |
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
# For accessing properites defined in my default `google` terraform provider. | |
data google_project current {} | |
# Create a google service account | |
resource google_service_account "external-dns" { | |
account_id = "gke-external-dns-manager" | |
display_name = "Cluster-controlled DNS management" | |
} | |
# Bind the ExternalDNS Service Account to the DNS admin role |
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 | |
set -eu -o pipefail | |
function main() { | |
AUTHORIZED_KEYS=${1:-~/.ssh/authorized_keys} | |
while read -r p; do | |
echo -e "\n$p ->" | |
echo "$p" | awk '{ print $2 }' | # Only the actual key data without prefix or comments | |
base64 -d | # decode as base64 | |
sha256sum | # SHA256 hash (returns hex) |
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 python3 | |
""" | |
Document Description | |
""" | |
__author__ = "Anonymous Coward" | |
__version__ = "0.1.0" | |
__license__ = "GPLv3" |
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
# Generic role to allow lambda to execute | |
resource "aws_iam_role" "lambda_exec" { | |
name = "lambda_assume_role" | |
assume_role_policy = jsonencode({ | |
Version = "2012-10-17" | |
Statement = [ | |
{ | |
Action = "sts:AssumeRole" | |
Effect = "Allow" | |
Sid = "" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowAllUsersToListAccounts", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:ListAccountAliases", | |
"iam:ListUsers", | |
"iam:GetAccountSummary" |
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 | |
set -eu -o pipefail | |
# -------------------------------------------- | |
# ---------- USE AT YOUR OWN RISK ----------- | |
# -------------------------------------------- | |
# Remove Solr from Ubuntu, as long as it was installed with defaults. | |
# As of 2022, works for any version of solr on any version of Ubuntu. |
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 | |
# ------------------------------------------------------------- | |
# Repeatedly probe a url forever with curl, only keeping the HTTP response code or the failure message from curl. Discard all other output. | |
# Any args passed to this script will be forwarded to the curl command as-is. | |
# Activity is profusely logged. | |
# | |
# Examples: | |
# | |
# Probe from the internet, limiting execution time: |
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
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: gitlab | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: gitlab-admin |
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 | |
set -eu -o pipefail | |
# Turn: | |
# foo/ | |
# ├── bar/ | |
# │ ├── one.txt | |
# │ ├── two.txt | |
# ├── baz/ | |
# ├── three.txt |
NewerOlder