- Prerequisites
- ubuntu
- java 1.7
- likely want openjdk-7-jre-headless openjdk-7-jre-lib openjdk-7-jdk
#!/bin/bash | |
# ------------------------------------- | |
# Quick and dirty to set up cassandra | |
# CCM with alias'ed ethernet addresses | |
# ------------------------------------- | |
# | |
# ===== # | |
# ARGS # |
SHOW VARIABLES LIKE 'innodb_buffer_pool_size'; | |
SHOW VARIABLES LIKE 'innodb_additional_mem_pool_size'; | |
SHOW VARIABLES LIKE 'innodb_log_buffer_size'; | |
SHOW VARIABLES LIKE 'thread_stack'; | |
SET @kilo_bytes = 1024; | |
SET @mega_bytes = @kilo_bytes * 1024; | |
SET @giga_bytes = @mega_bytes * 1024; | |
SET @innodb_buffer_pool_size = 2 * @giga_bytes; | |
SET @innodb_additional_mem_pool_size = 16 * @mega_bytes; | |
SET @innodb_log_buffer_size = 8 * @mega_bytes; |
#!/bin/bash | |
### | |
# | |
# Find out which ami to use on http://www.alestic.com | |
# | |
# at the time of this writing, Ubuntu 12.04 (Precise) was ami-23d9a94a | |
# with EBS boot | |
# | |
# In order for this to work, tuned your firewall for the following: |
mysql -e "show processlist" | grep -v Rows | grep -v Sleep | grep -oP -A1 "(SELECT|UPDATE|INSERT).*FROM \w+" | sort -h | uniq -c | sort -n |
<?php | |
/** | |
* This script gets EC2 metadata and saves it to an ini file. It should be run | |
* on boot before starting application stuff, such as php-fpm or video | |
* processing. | |
*/ | |
// path to put file | |
$path = '/usr/local/viafoura'; |
#!/usr/bin/env python | |
import math | |
import random | |
import string | |
random.seed(0) | |
# calculate a random number where: a <= rand < b |
#!/bin/bash | |
### | |
# | |
# Find out which ami to use on http://www.alestic.com | |
# | |
# at the time of this writing, Ubuntu 12.04 (Precise) was ami-23d9a94a | |
# with EBS boot | |
# | |
# In order for this to work, tuned your firewall for the following: |
description "Kafka Broker" | |
start on runlevel [2345] | |
stop on starting rc RUNLEVEL=[016] | |
respawn | |
respawn limit 2 5 | |
env CONFIG_HOME="/etc/kafka" | |
env KAFKA_HOME="/usr/lib/kafka" |
import time | |
from threading import Thread | |
try: | |
import socketserver as SocketServer | |
import http.server as SimpleHTTPServer | |
except ImportError: | |
import SocketServer | |
import SimpleHTTPServer | |