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'])
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This configuration requires Vagrant 1.1 or newer and two plugins:
#
# vagrant plugin install vagrant-hosts
# vagrant plugin install vagrant-auto_network
#
# If using Vagrant boxes provided by PuppetLabs, verions 4.2.10 of VirtualBox
# is reccomended.
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}")}")}" ]
}
config.vm.provider "vmware_fusion" do |v|
v.vmx["scsi0:1.filename"] = "disk2.vmdk"
v.vmx["scsi0:1.present"] = "TRUE"
v.vmx["scsi0:1.redo"] = ""
end
define foo::test (
$var = 1,
$var_x = "test_${$var}",
) {
notice($var_x)
}
foo::test { 'test': }
foo::test { 'test2':
@vjanelle
vjanelle / find_by_ip_interface.rb
Last active December 14, 2015 08:58
attempts to find an interface that'll serve the IP address
# find_ip_by_interface.rb
#
# Attempts to discover which interface will serve a particular destination
#
require 'ipaddr'
module Puppet::Parser::Functions
newfunction(:find_ip_by_interface, :type => :rvalue) do |args|
address = IPAddr.new(args[0])
@vjanelle
vjanelle / macaddresses.rb
Last active December 14, 2015 03:09
Generates facts to identify the interface a mac address is associated with
# Fact:
# macaddresses to interfaces
#
# Purpose:
# Make a fact to detail the interfaces for a normalized mac address
#
# Caveats:
# Only tested on linux, deals with 802.3ad bonded links, but I have not
# tested other kinds of interfaces
#