Skip to content

Instantly share code, notes, and snippets.

@jpcarey
jpcarey / gcp_ssh_config.py
Created September 28, 2018 14:01
Generate SSH Config for connecting to Google Compute Instances
from collections import namedtuple
import dns.resolver
import ipaddress
import json
import shutil
import os
# AWSURL = 'https://ip-ranges.amazonaws.com/ip-ranges.json'
GCPROOTDNS = '_cloud-netblocks.googleusercontent.com'
@jpcarey
jpcarey / haproxy.cfg
Created July 25, 2018 16:57
ha proxy SNI
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
@jpcarey
jpcarey / collapse_log.go
Last active February 21, 2018 06:30
Remove duplicate stack traces from an elasticsearch log
package main
import (
"bufio"
"flag"
"fmt"
"io"
"log"
_ "net/http/pprof"
"os"
- name: 'Checking that only a single host is in the current play (playbook serial: 1)'
assert: { that: "play_hosts | length == 1" }
# < --- start httplib2 dependency check, and install if necessary
- name: Dummy check to ensure httplib2 is installed
uri:
url: http://127.0.0.1:9200
ignore_errors: True
register: httplib2_check