Skip to content

Instantly share code, notes, and snippets.

View brentley's full-sized avatar

Brent Langston brentley

View GitHub Profile
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'
#!/usr/bin/env python
import os
import re
import sys
import ansible.errors
import ansible.utils.template
import ansiblelint
import ansiblelint.utils
import jinja2
@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 / backend-architectures.md
Created August 21, 2016 05:10 — forked from eeertekin/backend-architectures.md
Backend Architectures
@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'},
1) First, make sure you local machine has EB CLI, for Mac, simple do brew install awsebcli
2) Create new AWS credentials, add it to your local machine like so
open or create the file:
~/.aws/credentials
add the following in this new file: