Skip to content

Instantly share code, notes, and snippets.

<snip>
set(Key, Value) ->
Flag = random:uniform(65000),
set(Key, Flag, "0", Value).
set(Key, Flag, ExpTime, Value) when is_integer(Flag) ->
set(Key, integer_to_list(Flag), ExpTime, Value);
set(Key, Flag, ExpTime, Value) when is_integer(ExpTime) ->
set(Key, Flag, integer_to_list(ExpTime), Value);
#!/bin/bash
# 1st install Apple's XCode (dev tools, gcc, etc)
# Then... Setup
cat >$HOME/.bash_profile <<\THEEND
export PATH=$HOME/bin:/opt/local/bin:$PATH
export MANPATH=$HOME/man:/opt/local/man:$MANPATH
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
require 'rubygems'
require 'rest_client'
url = "http://user:password@domain:5984/"
database = "database_name"
count = 100
testdocprefix = "doc"
inital_value = "test123"
updated_value = "asdf"
field_name = "test"
#!/usr/bin/ruby
require 'rubygems'
require 'carrot'
def main
queue = "couchdb"
run = true
couchq = Carrot.queue(:queue => queue)
# Author:: Joshua Timberman (<joshua@opscode.com>)
# Author:: Adam Jacob (<adam@opscode.com>)
#
# Copyright:: 2009, Opscode, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
### Cookbook Name:: haproxy
### Recipe:: default
### Author:: Joe Williams <joe@joetify.com>
###
### Copyright 2008, Joe Williams
###
### Licensed under the Apache License, Version 2.0 (the "License");
### you may not use this file except in compliance with the License.
### You may obtain a copy of the License at
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
@joewilliams
joewilliams / erlaws_ec2.erl
Created July 20, 2009 16:45
erlaws partial ec2 support
-define(API_VERSION, "2009-04-04").
-define(API_URL, "http://ec2.amazonaws.com/").
%% The following code was taken from erlaws erlaws_sdb.erl
%% and in some cases modified to work slightly different
%%
%% http://github.com/x6j8x/erlaws/tree/master
%%
%% Copyright (C) 2008 Sascha Matzke
%%
#
# Cookbook Name:: heartbeat
# Attributes:: heartbeat
#
# Copyright 2008, Wikia, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
require 'rubygems'
require 'right_slicehost'
API_KEY="yourapikey"
ZONE = "yourdomain.com."
slicehost = Rightscale::Slicehost.new(API_KEY)
zone_id = nil