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
@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
@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
#!/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'])
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 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,
@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)
# 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)"
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.
: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.