Skip to content

Instantly share code, notes, and snippets.

View estroz's full-sized avatar

Eric Stroczynski estroz

View GitHub Profile
@estroz
estroz / tag-route53-hosted-zones.sh
Created June 23, 2017 23:56
Tag route53 hosted zones if they don't have a specific tag key
#!/usr/bin/env bash
## Tags route53 hosted zones not already tagged with the specified key(s)
# Example tag file:
# [
# {
# "Key": "expirationDate",
# "Value": "2017-06-22"
# }
# ]
This file has been truncated, but you can view the full file.
2017/07/14 13:29:25 [INFO] Terraform version: 0.9.6 85e0979c6af6a15345c9131e4478ba712bb3c21d
2017/07/14 13:29:25 [INFO] Go runtime version: go1.8
2017/07/14 13:29:25 [INFO] CLI args: []string{"/usr/local/bin/terraform", "plan", "-var-file=terraform.tfvars", "platforms/aws"}
2017/07/14 13:29:25 [DEBUG] Detected home directory from env var: /home/estro
2017/07/14 13:29:25 [DEBUG] Detected home directory from env var: /home/estro
2017/07/14 13:29:25 [DEBUG] Attempting to open CLI config file: /home/estro/.terraformrc
2017/07/14 13:29:25 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/07/14 13:29:25 [DEBUG] Detected home directory from env var: /home/estro
2017/07/14 13:29:25 [INFO] CLI command args: []string{"plan", "-var-file=terraform.tfvars", "platforms/aws"}
@estroz
estroz / pdf-quality.sh
Created December 8, 2018 18:20
PFD quality conversion on linux
# From https://askubuntu.com/questions/113544/how-can-i-reduce-the-file-size-of-a-scanned-pdf-file/256449#256449
gs -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
# -dPDFSETTINGS=/screen lower quality, smaller size. (72 dpi)
# -dPDFSETTINGS=/ebook for better quality, but slightly larger pdfs. (150 dpi)
# -dPDFSETTINGS=/prepress output similar to Acrobat Distiller "Prepress Optimized" setting (300 dpi)
# -dPDFSETTINGS=/printer selects output similar to the Acrobat Distiller "Print Optimized" setting (300 dpi)
# -dPDFSETTINGS=/default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file
-dPDFSETTINGS=/ebook \
-dNOPAUSE -dQUIET -dBATCH \
package main
import (
"bytes"
"io/ioutil"
"log"
"os"
"strings"
"golang.org/x/net/html"
@estroz
estroz / .sh
Created September 13, 2019 16:34
delete_old_branches.sh
git branch -vv | gawk '{print $1,$3,$4}' | grep -E '\[origin/.+: gone\]' | gawk '{print $1}' | xargs git branch -D
apiVersion: v1
kind: Pod
metadata:
name: memcached-operator-index-server
namespace: default
spec:
containers:
- command:
- /bin/bash
- -c
@estroz
estroz / kuttl-rbac.yaml
Last active August 6, 2020 22:42
RBAC required to run a basic kuttl suite
apiVersion: v1
kind: ServiceAccount
metadata:
name: scorecard-kuttl
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: scorecard-kuttl
roleRef: