Skip to content

Instantly share code, notes, and snippets.

View vjanelle's full-sized avatar
💭
Day drinking

Vincent Janelle vjanelle

💭
Day drinking
View GitHub Profile
# Remove parameters on resources that aren't exported or tagged public
ExtFilterDefine resources-remove-parameters-nonexported-nonpublic mode=output \
intype=application/json outtype=application/json \
cmd="/usr/bin/jq map(if\ .exported\ or\ (.tags\ |\ contains([\"public\"]))\ then\ .\ else\ .parameters={}\ end)"
@vjanelle
vjanelle / kafka-brokerid.py
Created April 29, 2015 23:49
kafka broker id from host ip address
#!/usr/bin/python
import socket
# The general premise behind this is that kafka needs a unique broker id, and well, the ip address
# of the system has to be unique. They're both 32bit numbers, so why not?
broker_id = int(socket.inet_aton(socket.gethostbyname(socket.gethostname())).encode('hex'),16)
print "kafka_brokerid=%s" % str(broker_id)
@vjanelle
vjanelle / gist:09f715ff0b3a7700e2ad
Created October 16, 2015 18:36
One of these things is not XML
botocore.parsers.ResponseParserError: Unable to parse response (not well-formed (invalid token): line 1, column 0), invalid XML received:
{
"CreateDBInstanceResponse": {
"CreateDBInstanceResult": {
"DBInstance": {
"AllocatedStorage": 10,
"AutoMinorVersionUpgrade": "True",
"AvailabilityZone": "None",
"BackupRetentionPeriod": "1",
"CharacterSetName": null,
resource "null_resource" "subnets" {
triggers {
subnets = "${var.private_subnets.us-west-2a},${var.private_subnets.us-west-2b},${var.private_subnets.us-west-2c}"
}
}
resource "aws_elasticache_subnet_group" "elasticache" {
name = "${var.name}-${var.envtag}"
description = "${var.name} subnet group for ${var.envtag}"
subnet_ids = [ "${compact("${split(",","${null_resource.subnets.triggers.subnets}")}")}" ]
}
#!/usr/bin/env python
import boto3
config = {}
config['region'] = 'us-west-2'
rds = boto3.client('rds', region_name=config['region'])
ec2 = boto3.resource('ec2', region_name=config['region'])
@vjanelle
vjanelle / tmux.conf
Created September 1, 2016 17:23
My tmux config
######################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred
## Status bar design
# status line
@vjanelle
vjanelle / .tmux.conf
Created October 18, 2017 17:17
.tmux.conf
######################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred
## Status bar design
# status line