Skip to content

Instantly share code, notes, and snippets.

View estahn's full-sized avatar
👨‍💻
ʕʘ̅͜ʘ̅ʔ – ʕ•̫͡•ʕ*̫͡*ʕ•͓͡•ʔ-̫͡-ʕ•̫͡•ʔ

Enrico Stahn estahn

👨‍💻
ʕʘ̅͜ʘ̅ʔ – ʕ•̫͡•ʕ*̫͡*ʕ•͓͡•ʔ-̫͡-ʕ•̫͡•ʔ
View GitHub Profile
---
- debug: var=name
- name: First include of roleA
include_role:
name: roleA
vars:
name: first include
- name: Second include of roleA
{% import 'roles/cfn-orchestrator/templates/cfn.macros.j2' as cfn with context %}
---
AWSTemplateFormatVersion: '2010-09-09'
{{ cfn.metadata(1) }}
Description: >
Creates a VPC with DNS and Public IPs enabled.
Creates 4 subnets in 2 AZs (a pair of public/private subnets in each AZ).
var handler = require('lambda-formation').resource.create;
var util = require('lambda-formation').util;
var aws = require("aws-sdk");
/**
* Creates a Hosted Zone and supports delegation sets
*
* Type: "AWS::Route53::HostedZone"
* Properties:
* DelegationSetId: <Your delegation set id>
---
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
Version: 1
LastUpdated: 2017-05-16 16:58:35
UpdatedBy: estahn
Comments: Generated by cfn-ansible
Description: >
@estahn
estahn / create.js
Last active May 19, 2017 23:32
lambda-formation Custom::Route53::HostedZone
var handler = require('lambda-formation').resource.create;
var util = require('lambda-formation').util;
var aws = require("aws-sdk");
var uuidV4 = require('uuid/v4');
/**
* Creates a Hosted Zone and supports delegation sets
*
* Type: "AWS::Route53::HostedZone"
* Properties:
@estahn
estahn / metabase.service
Last active January 30, 2023 14:25
Systemd file for Metabase
[Unit]
Description=Metabase server
After=syslog.target
After=network.target
[Service]
WorkingDirectory=/home/data/tools/metabase
ExecStart=/usr/bin/java -jar /home/data/tools/metabase/metabase.jar
Environment=MB_JETTY_PORT=8080
User=data
#!/bin/sh
KUBECTL=$(which kubectl)
echo "CURRENT VERSION:"
kubectl version
echo ""
curl -o ${KUBECTL} -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/darwin/amd64/kubectl
chmod 755 ${KUBECTL}
@estahn
estahn / keybase.md
Created April 26, 2018 05:23
keybase.md

Keybase proof

I hereby claim:

  • I am estahn on github.
  • I am estahn (https://keybase.io/estahn) on keybase.
  • I have a public key ASC2Q8Hprpg4hYZylH_pXmBCVxFxZif6J5JqVOWf0CYHPwo

To claim this, I am signing this object:

@estahn
estahn / aws-iam-delete-user.sh
Last active December 18, 2024 21:24
A script to delete AWS IAM users programmatically.
#!/usr/bin/env bash
_process_user() {
_detach_policies $1 &
_delete_access_keys $1 &
wait
_delete_user $1 &
}
_detach_policies() {
@estahn
estahn / rds-init.sh
Last active May 5, 2022 14:08
A workaround to get all data loaded into AWS RDS MySQL. When a read replica is restored from a snapshot, the replica won't wait for all the data to be transferred from Amazon Simple Storage Service (Amazon S3) to the Amazon Elastic Block Store (Amazon EBS) volume that's associated with the replica DB instance. The replica DB instance is availabl…
#!/bin/bash
host=$1
user=$2
password=$3
echo '' > $0.queue
databases=$(mysql -h $host -u $user -p$password -e "show databases" -sN | grep -v information_schema | grep -v mysql | grep -v sys)
for database in $databases; do
for table in $(mysql -h $host -u $user -p"$password" -N -B -e "show tables from \`$database\`"); do