Skip to content

Instantly share code, notes, and snippets.

data "aws_eks_cluster" "cluster" {
name = "${var.project}-${var.env}"
}
data "aws_iam_openid_connect_provider" "cluster" {
url = data.aws_eks_cluster.cluster.identity[0].oidc[0].issuer
}
resource "aws_iam_policy" "aws_load_balancer_policy" {
name = "aws_load_balancer_policy"
@tommybobbins
tommybobbins / gist:1d71e57b2aa229644e8aab2e99c522ec
Last active June 24, 2021 10:04
Terraform Associate Revision
Write<->Plan<->Apply
[repo]<->[review]<->provision.
terraform->required_providers {}
->required_version = "~> 0.14"
terraform {
required_providers {
random = {
source = "hashicorp/random"
#!/bin/bash
rm list_of_files.txt
for FILE in MOV*.avi
do
echo "file $FILE" >>list_of_files.txt
done
ffmpeg -f concat -i list_of_files.txt -c copy -y full.avi
@tommybobbins
tommybobbins / gist:46d2c4353b5bf883b4ee
Last active August 29, 2015 14:14
Create nginx failover cluster from scratch
#Cribbed liberally from:
#http://www.weedpi.com/how-to/how-to-create-a-pi-cluster
apt-get -y remove oracle-java8-jdk xserver-xorg xserver-xorg-core xserver-xorg-input-all wolfram-engine gnome-desktop3-data lxde-common lxde-core
apt-get -y autoremove
Make the following files sane:
/etc/hosts; /etc/hostname; /etc/network/interfaces
Cloning cluster members:
On Both nodes:
/etc/init.d/heartbeat stop
/etc/init.d/cman stop
rm /var/lib/heartbeat/hostcache
rm /var/lib/heartbeat/delhostcache
rm /var/lib/heartbeat/hb_uuid
/usr/share/heartbeat/ha_propagate
/etc/init.d/cman start
/etc/init.d/heartbeat start
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 256
#chroot /usr/share/haproxy
user haproxy
group haproxy
@tommybobbins
tommybobbins / gist:3dbbc6afd32718abf5bb
Created December 21, 2014 13:20
OpenWRT /etc/config/firewall
config 'redirect'
option target ACCEPT
config 'redirect'
option 'src' 'wan'
option 'proto' 'tcp'
option 'src_ip' ''
option 'src_dport' '8004'
option 'dest_ip' '10.0.0.111'
option 'dest_port' '80'
@tommybobbins
tommybobbins / gist:87acd39487d549d02da2
Created December 21, 2014 13:19
HA Proxy configuration
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 256
#chroot /usr/share/haproxy
user haproxy
group haproxy
@tommybobbins
tommybobbins / gist:fc9fd1ba5616dafc8321
Last active August 29, 2015 14:11
cib.xml for two node cluster and floating IP /var/lib/heartbeat/crm/cib.xml
<cib epoch="11" num_updates="0" admin_epoch="0" validate-with="pacemaker-1.2" cr
m_feature_set="3.0.6" update-origin="rpi2" update-client="cibadmin" cib-last-wri
tten="Sat Dec 20 22:38:13 2014" have-quorum="1" dc-uuid="edc8b9e8-c444-4533-befd
-47c5cf52754d">
<configuration>
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="1
.1.7-ee0730e13d124c3d58f00016c3376a1de5323cff"/>
<nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-
@tommybobbins
tommybobbins / gist:d3944fdc48897ad3ae3b
Last active August 29, 2015 14:11
Convert Unicorn paint to Python
grep "GET /pixel" unicorn_paint.log | awk '{print $7}' | sed -e 's/\/pixel\//unicorn\.set\_pixel\(/g' | sed -e 's/$/)/g' | sed -e 's/\//\,/g'