Skip to content

Instantly share code, notes, and snippets.

View dlecocq's full-sized avatar

Dan Lecocq dlecocq

  • Albuquerque, NM
View GitHub Profile
@dlecocq
dlecocq / hyperconf.sh
Created July 10, 2012 21:09
Configuring Hypertable
export VERSION=0.9.5.6
export HT_USER=ec2-user
export HT_GRP=ec2-user
# This is the string this host will identify by
export HT_HOST=fresh-hypertable-01
# 0. ldconfig, /etc/hosts
echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf
sudo /sbin/ldconfig
echo "127.0.0.1 $HT_HOST" | sudo tee -a /etc/hosts
@dlecocq
dlecocq / 0-dependencies.sh
Created July 13, 2012 21:45
Accumulo Bootstrap
# Be sure to export the following before running this:
# HOSTNAME = 'name of the host'
# NAMENODE = 'IP address of the name node'
# JOBTRACK = 'IP address of job tracker'
# ZOOKEEPR = 'IP address of zoo keeper'
# MASTER = 'Inernal domain name of master'
# TABLETS = 'newline-separated list of table servers'
# First, we should set the hostname of the machine
sudo hostname $HOSTNAME
@dlecocq
dlecocq / 0-dependencies.sh
Created July 16, 2012 22:59
Cassandra Bootstrap
# A few things must be defined -- see http://wiki.apache.org/cassandra/GettingStarted
# DATA_DIR -> Where data will go
# COMMIT_DIR -> The commit log directory
# CACHES_DIR -> Caches
# STORAGE_PORT -> Port for internal cluster communication
# RPC_PORT -> Where clients will talk to us
# CLUSTER_NAME -> 'nuff said
# INITIAL_TOKEN -> In the token ring
# SEED_IP -> IP Address of the Seed node
#
@dlecocq
dlecocq / 0-dependencies.sh
Created September 6, 2012 22:09
Custom Crawl Cassandra Bootstrap
# A few things must be defined -- see http://wiki.apache.org/cassandra/GettingStarted
# INITIAL_TOKEN -> In the token ring
# SEED_IP -> IP Address of the Seed node
#
# This is, for example, what I used on the first node:
# export INITIAL_TOKEN=0
# export SEED_IP=
@dlecocq
dlecocq / 0-dependencies.sh
Last active October 16, 2022 20:04
ElasticSearch Bootstrap
# Environment
#
# export HOSTNAME=...
# export CLUSTER=...
# export RACK=...
# export ESDIR=
# export AWS_ACCESS_KEY=...
# export AWS_SECRET_KEY=...
# Packages
@dlecocq
dlecocq / 01-all.sh
Created October 12, 2012 15:37
Statsd Bootstrap
# Install zabbix_sender
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
sudo yum -y install zabbix-agent
# Install node
cd && curl -OL http://nodejs.org/dist/v0.8.11/node-v0.8.11.tar.gz
tar xf node-v0.8.11.tar.gz
cd node-v0.8.11 && ./configure && make -j2 && sudo make install
# Download statsd, backend
@dlecocq
dlecocq / 01-packages.sh
Created October 25, 2012 21:56
Riak Bootstrap
# Make sure the log directory is writable
sudo chmod a+rw /var/log
# We need a few tools to make this tick
sudo yum install -y mdadm git boost{,-devel} automake libtool flex bison pkgconfig gcc-c++ {libevent,python,zlib,ruby,ncurses,openssl}{,-devel} make
# Make sure the log directory is writable
sudo chmod a+rw /var/log
@dlecocq
dlecocq / zabbix.py
Created November 19, 2012 20:14
Zabbix Metric Creation
#! /usr/bin/env python
import zabbix_api
# Connect, auth
client = zabbix_api.ZabbixAPI('http://bigzabbix.seomoz.org')
client.login('your', 'credentials')
assert client.test_login(), 'Failed to log in'
# Try to find our Template
@dlecocq
dlecocq / resolve.py
Created November 21, 2012 18:59
Bulk Asynchronous DNS Resolution
import struct
from gevent import pool
from gevent.dns import resolve_ipv4
# Should be a file with one hostname per line
with open('hosts') as fin:
urls = fin.read().split('\n')
def func(host):
try:
# Environment
#
# export HOSTNAME=...
# export CLUSTER=...
# export RACK=...
# export ESDIR=
# export AWS_ACCESS_ID=...
# export AWS_SECRET_KEY=...
# Packages