Skip to content

Instantly share code, notes, and snippets.

View brentley's full-sized avatar

Brent Langston brentley

View GitHub Profile
#!/usr/bin/env python
import os
import re
import sys
import ansible.errors
import ansible.utils.template
import ansiblelint
import ansiblelint.utils
import jinja2
require 'rubygems'
require 'sinatra'
require 'net-ldap'
require 'digest/sha1'
require 'base64'
require 'haml'
LDAP_HOST = 'localhost'
ADMIN_DN = 'cn=admin,dc=company,dc=com'
# Sets reasonable OS X defaults.
#
# Or, in other words, set shit how I like in OS X.
#
# The original idea (and a couple settings) were grabbed from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run ./set-defaults.sh and you'll be good to go.
# Enable crontab processing (according to https://coderwall.com/p/ry9jwg)
2016-09-27 01:59:14.0724 INFO localhost-startStop-1 com.netflix.priam.identity.token.DeadTokenRetriever Looking for a token from any dead node
2016-09-27 01:59:15.0194 INFO localhost-startStop-1 com.netflix.priam.aws.AWSMembership Querying Amazon returned following instance in the ASG: us-west-2b --> i-0b744813
2016-09-27 01:59:15.0194 INFO localhost-startStop-1 com.netflix.priam.identity.token.DeadTokenRetriever Single Account cluster
2016-09-27 01:59:26.0106 INFO localhost-startStop-1 com.netflix.priam.identity.token.DeadTokenRetriever Found dead instances: i-a7a994bf
2016-09-27 01:59:27.0901 INFO localhost-startStop-1 com.netflix.priam.identity.token.DeadTokenRetriever Calling getIp on hostname[10.10.51.143] and token[56713727820156410577229101240595408135]
2016-09-27 01:59:28.0173 INFO localhost-startStop-1 com.netflix.priam.identity.token.DeadTokenRetriever Calling getIp on hostname[10.10.55.88] and token[56713727820156410577229101240595408135]
2016-09-27 01:59:28.0173 INFO localhost-startStop-1 com.netf
@brentley
brentley / rebalance-random-partitioner.sh
Last active February 21, 2017 16:56 — forked from kintarowins/rebalance.sh
Cassandra node rebalancing script
#!/bin/bash
#set -eu
#this looks up the nodes from the ring and rebalances them automatically
# We expect exactly 3 racks (currently)
ip_16="$(hostname -i |cut -f1,2 -d.)"
racks=($(nodetool ring |grep $ip_16 |awk '{print $2}' |sort -u))
rack_0=($(/usr/bin/nodetool ring |grep ${racks[0]} |awk '{print $1}' | sort -n))
@brentley
brentley / etc-init.d-cassandra
Last active March 19, 2017 20:52 — forked from sgomezvillamor/etc-init.d-cassandra
/etc/init.d/cassandra for CentOS
#!/bin/bash
# init script for Cassandra.
# chkconfig: 2345 90 10
# description: Cassandra
# script slightly modified from
# http://blog.milford.io/2010/06/installing-apache-cassandra-on-centos/
. /etc/rc.d/init.d/functions
CASS_HOME=$(ls -d /usr/local/apache-cassandra-*)
@brentley
brentley / 0_reuse_code.js
Created May 24, 2017 05:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@brentley
brentley / onc_converter.py
Created June 23, 2017 04:10 — forked from woodrow/onc_converter.py
Convert OpenVPN config files to ChromeOS ONC files
import argparse
import json
import re
import sys
import uuid
class OpenVPNNetworkConfiguration(object):
KNOWN_CONFIG_KEYS = {
'name': {'key': 'Name'},
@brentley
brentley / backend-architectures.md
Created August 21, 2016 05:10 — forked from eeertekin/backend-architectures.md
Backend Architectures

Keybase proof

I hereby claim:

  • I am brentley on github.
  • I am brentley (https://keybase.io/brentley) on keybase.
  • I have a public key ASBNo9iQrU3_lbXXrgwNOzn9ROkGwko7UQRRl_aX13GcRgo

To claim this, I am signing this object: