Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Day drinking

Vincent Janelle vjanelle

💭
Day drinking
View GitHub Profile
View .tmux.conf
######################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred
## Status bar design
# status line
View tmux.conf
######################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred
## Status bar design
# status line
View print_tags.py
#!/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'])
View gist:a399044a1d853b581a70761e42c71821
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}")}")}" ]
}
@vjanelle
vjanelle / gist:09f715ff0b3a7700e2ad
Created Oct 16, 2015
One of these things is not XML
View gist:09f715ff0b3a7700e2ad
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,
@vjanelle
vjanelle / kafka-brokerid.py
Created Apr 29, 2015
kafka broker id from host ip address
View kafka-brokerid.py
#!/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)
View gist:18fb94ab2fb6f0e22cf7
# 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)"
View gist:fa60b886aaec0f2225d2
SOLIPSISTIC PUBLIC LICENSE
Version 1, April 2013
Copyright (C) 2013
Everyone is permitted to copy and distiribute verbatim copies of
this license document. Modified copies of this document are
permitted provided that they denouce BOTH the original AND
their copy as mere sense data with no verifiable cause outside the mind.
View gist:d81ac83dc5ea69c15412
:filters - (Array<) One or more filters.
architecture - The instance architecture (i386 | x86_64).
availability-zone - The Availability Zone of the instance.
block-device-mapping.attach-time - The attach time for an Amazon EBS volume mapped to the instance.
block-device-mapping.delete-on-termination - A Boolean that indicates whether the Amazon EBS volume is deleted on instance termination.