Skip to content

Instantly share code, notes, and snippets.

View abuxton's full-sized avatar
💭
discombobulated as always

adam buxton abuxton

💭
discombobulated as always
View GitHub Profile
@abuxton
abuxton / README.md
Last active November 19, 2021 10:22
@abuxton
abuxton / README.MD
Last active November 19, 2021 13:48

manipulate variables helpers

if you've not already go get tfvars utility! https://github.com/shihanng/tfvar it will help a lot.

Lets grab all the variables in a module thats easy tfvar . but what do with them now? You can simply append them to a tfvar or auto.tfvars file tfvar . > example.auto.tfvars

But what if there are multiple modules you want to use and you want to collect all their variables?

  • A sensible approach is to redeclare them all as locals the helpers below create output that can be simple appened and then encapsulated ina. locals{ } block
@abuxton
abuxton / rhel7-docker-install.sh
Created December 1, 2021 15:27
rhel7-docker-install
#! /bin/bash +X
# later we will disable selinux
# sudo setenforce Permissive
# getenforce # just incase youy want to check selinuxmode
# lets make sure we are a clean install of docker
sudo yum remove docker docker-common docker-selinux docker-engine-selinux docker-engine docker-ce
# now install some tools dmpd(for short) ensures rhel 7 respects gpg settings in repos (issue is https://access.redhat.com/solutions/2850911) see https://access.redhat.com/discussions/5336741 for the fix
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
@abuxton
abuxton / self-signed-certificate-with-custom-ca.md
Created January 21, 2022 14:53 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
def get_ca_bundle():
"""Tries to find the platform ca bundle for the system (on linux systems)"""
ca_bundles = [
# list taken from https://golang.org/src/crypto/x509/root_linux.go
"/etc/ssl/certs/ca-certificates.crt", # Debian/Ubuntu/Gentoo etc.
"/etc/pki/tls/certs/ca-bundle.crt", # Fedora/RHEL 6
"/etc/ssl/ca-bundle.pem", # OpenSUSE
"/etc/pki/tls/cacert.pem", # OpenELEC
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", # CentOS/RHEL 7
]
@abuxton
abuxton / README.MD
Last active May 4, 2023 12:49 — forked from idokd/scrap-ca-to-bundle.sh
Scrape site for its certificates, validate and create a ca bundle, for the use in downloading a local copy of Certificate Authorities (CAs)
@abuxton
abuxton / README.MD
Last active February 3, 2022 16:11
Scrape Globals from Replicated/terraform enterprise install.sh
provider "aws" {
region = "us-east-1"
## uses default env_var from aws
#AWS_ACCESS_KEY_ID="anaccesskey"
#AWS_SECRET_ACCESS_KEY="asecretkey"
#AWS_DEFAULT_REGION="us-west-2"
}
# Additional provider configuration for west coast region; resources can
# reference this as `aws.alt`.
https://kubernetes.io/docs/tasks/debug-application-cluster/debug-running-pod/
https://kubernetes.io/docs/reference/kubectl/cheatsheet/
# examples
kubectl -n terraform-cloud-agent get all
kubectl -n terraform-cloud-agent logs terraform-cloud-agent-84546788bc-jfmtt -f #-f for follow
kubectl -n terraform-cloud-agent logs terraform-cloud-agent-84546788bc-jfmtt terraform-cloud-agent
kubectl -n terraform-cloud-agent describe pod terraform-cloud-agent-84546788bc-jfmtt