Skip to content

Instantly share code, notes, and snippets.

@flores
flores / thin init script
Created February 23, 2011 00:26
(Too?) simple Thin server init script
#!/usr/bin/env ruby
# quick and dirty thin init script
#
# path for thin
thin = "/home/someuser/.rvm/gems/ruby-1.8.7-p72@global/bin/thin"
config = "config/config.ru"
# which dir to run from
path = "/srv/thisapp"
@AshwinJay
AshwinJay / 1) jpmp.sh
Created March 2, 2011 23:05
JPMP (Java's Poor Man's Profiler) [corrected]
# Original version: http://blog.tsunanet.net/2010/08/jpmp-javas-poor-mans-profiler.html
# Usage: ./jpmp.sh <pid> <num-samples> <sleep-time-between-samples>
#!/bin/bash
pid=$1
nsamples=$2
sleeptime=$3
for x in $(seq 1 $nsamples)
@avar
avar / .gitignore
Created March 31, 2011 08:24
A small C utility to parse /proc/*/smaps
_Inline
@jedi4ever
jedi4ever / ruby-1.9.2-to-deb.sh
Created April 14, 2011 11:21 — forked from jtimberman/gist:881058
Ruby 1.9 fp- bash
#!/usr/bin/env bash
sudo apt-get install libssl-dev
sudo gem install fpm
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
tar -zxvf ruby-1.9.2-p180.tar.gz
cd ruby-1.9.2-p180
time (./configure --prefix=/usr && make && make install DESTDIR=/tmp/installdir)
cd ..
@numan
numan / lc_boto.py
Created July 13, 2011 21:43
Setting up a launch configuration using boto
from boto.ec2.autoscale import AutoScaleConnection
from boto.ec2.autoscale import LaunchConfiguration
conn_as = AutoScaleConnection(AWS_ACCESS_KEY, AWS_SECRET_KEY)
#For a complete list of options see http://boto.cloudhackers.com/ref/ec2.html#boto.ec2.autoscale.launchconfig.LaunchConfiguration
lc = LaunchConfiguration(name='my-launch-config-name', image_id='ami-123456',
key_name='webserver-access-key',
security_groups=['webserver-security-group'],
instance_type='t1.micro',
@numan
numan / sp_boto.py
Created July 16, 2011 17:45
Setting up a scaling policy using boto
#For a complete list of options see http://boto.cloudhackers.com/ref/ec2.html#boto.ec2.autoscale.policy.ScalingPolicy
scalingUpPolicy = ScalingPolicy(name='webserverScaleUpPolicy',
adjustment_type='ChangeInCapacity',
as_name='webserver-asg',
scaling_adjustment=2,
cooldown=180)
scalingDownPolicy = ScalingPolicy(name='webserverScaleDownPolicy',
adjustment_type='ChangeInCapacity',
as_name='webserver-asg',
@numan
numan / lb_boto.py
Created July 16, 2011 21:29
Create a load balancer using the boto API
from boto.ec2.elb import ELBConnection
from boto.ec2.elb import HealthCheck
conn_elb = ELBConnection(AWS_ACCESS_KEY, AWS_SECRET_KEY)
#For a complete list of options see http://boto.cloudhackers.com/ref/ec2.html#module-boto.ec2.elb.healthcheck
hc = HealthCheck('healthCheck',
interval=20,
target='HTTP:80/index.html',
@duckpuppy
duckpuppy / compass.rb
Created October 24, 2011 03:34
Jekyll Haml and Compass extensions
begin
require 'compass'
require 'compass/exec'
rescue LoadError
require 'rubygems'
require 'compass'
require 'compass/exec'
end
module Jekyll
@rilindo
rilindo / Ref61.cfg
Created December 17, 2011 23:31
Kickstart Reference System 6.1
# Kickstart file automatically generated by anaconda.
#version=RHEL6
install
url --url http://192.168.15.100/mirrors/centos/6.1/os/x86_64/
lang en_US.UTF-8
keyboard us
text
#skipx
network --device eth0 --bootproto dhcp --hostname centos61.test.monzell.com
@RenatoUtsch
RenatoUtsch / FindMYSQL.cmake
Created January 16, 2012 22:17
Find MySQL with CMake.
# - Try to find MySQL.
# Once done this will define:
# MYSQL_FOUND - If false, do not try to use MySQL.
# MYSQL_INCLUDE_DIRS - Where to find mysql.h, etc.
# MYSQL_LIBRARIES - The libraries to link against.
# MYSQL_VERSION_STRING - Version in a string of MySQL.
#
# Created by RenatoUtsch based on eAthena implementation.
#
# Please note that this module only supports Windows and Linux officially, but