Skip to content

Instantly share code, notes, and snippets.

View OldCrowEW's full-sized avatar
👾
Working from 🏃💨

John OldCrowEW

👾
Working from 🏃💨
View GitHub Profile
@OldCrowEW
OldCrowEW / aws-ec2-redis-cli.md
Created September 28, 2023 12:56 — forked from todgru/aws-ec2-redis-cli.md
AWS redis-cli on EC2

Setting up a local DNS server with bind on OSX Mavericks

This is really just an approach for locally testing DNS changes, which can easily be done with a HOSTS file if the change involves an IP address, but gets a bit trickier when things like CNAMEs are involved. This is only meant to test locally off a single machine.

  1. Install bind using homebrew

    brew install bind

  2. Follow the installation steps to start up bind

resource "github_team_repository" "tf_test" {
for_each = local.repo_tf_test.permission
repository = github_repository.tf_test_repo.name
team_id = each.key
permission = each.value
}
@OldCrowEW
OldCrowEW / approle.sh
Created July 31, 2021 20:45 — forked from greenbrian/approle.sh
Vault CLI testing AppRole
#!/bin/bash
# start vault
VAULT_UI=true vault server -dev -dev-root-token-id=root -dev-listen-address=127.0.0.1:8200
# login as root - DO NOT DO THIS IN PRODUCTION
vault login root
# write some secrets
vault kv put secret/test color=blue number=eleventeen
@OldCrowEW
OldCrowEW / etc_systemd_resolved.conf
Created October 9, 2020 12:38
Consul resolved config
[Resolve]
DNS=127.0.0.1
#FallbackDNS=
Domains=~consul
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes
@OldCrowEW
OldCrowEW / dummy0.netdev
Created October 9, 2020 11:36 — forked from kquinsland/dummy0.netdev
How to get consul-agent and systemd.resolvd to co-exist peicefully and still be able to resolve *.consul hostsnames from within docker
# Creates a "dummy" network interface
# we'll configure this interface with a link-local address
# See: https://www.freedesktop.org/software/systemd/man/systemd.netdev.html
##
[NetDev]
Name=dummy0
Kind=dummy
def applyRun(runid) {
def response = httpRequest(
customHeaders: [
[ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ],
[ name: "Content-Type", value: "application/vnd.api+json" ]
],
httpMode: 'POST',
responseBody: '{ comment: "Apply confirmed" }',
url: "https://app.terraform.io/api/v2/runs/${runid}/actions/apply"
)
def overridePolicy(policyid) {
def response = httpRequest(
customHeaders: [
[ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ],
[ name: "Content-Type", value: "application/vnd.api+json" ]
],
httpMode: 'POST',
url: "https://app.terraform.io/api/v2/policy-checks/${policyid}/actions/override"
)
def data = new JsonSlurper().parseText(response.content)
def getPlanStatus(runid) {
def result = ""
def response = httpRequest(
customHeaders: [[ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ]],
url: "https://app.terraform.io/api/v2/runs/${runid}"
)
def data = new JsonSlurper().parseText(response.content)
switch (data.data.attributes.status) {
case 'pending':
result = "noop"
def startPlan() {
def payload = buildPayload()
def response = httpRequest(
customHeaders: [
[ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ],
[ name: "Content-Type", value: "application/vnd.api+json" ]
],
httpMode: 'POST',
requestBody: "${payload}",
url: "https://app.terraform.io/api/v2/runs"