Skip to content

Instantly share code, notes, and snippets.

View farshidce's full-sized avatar

Farshid Ghods farshidce

  • LinkedIn
  • San Francisco
View GitHub Profile
@farshidce
farshidce / gist:1093217
Created July 19, 2011 17:39
hash-detail-and-print-vbucket-mismatch
import commands
ips = ["10.1.5.38","10.1.5.53","10.1.5.54","10.1.5.57","10.1.5.58","10.1.5.59"]
def mapit(stuff):
rows = stuff[1].split("\n")
map = {}
for row in rows:
#get bucket id
vid = row[row.find("_")+1:row.find(":")]
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template EC2InstanceSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example uses the default security group, so to SSH to the new instance using the KeyPair you enter, you will need to have port 22 open in your default security group. **WARNING** This template an Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type" : "String"
}
@farshidce
farshidce / cf1.json
Created November 16, 2011 00:49
cf1
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template EC2InstanceSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example uses the default security group, so to SSH to the new instance using the KeyPair you enter, you will need to have port 22 open in your default security group. **WARNING** This template an Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type" : "String"
}
@farshidce
farshidce / ec2-cf-ini-1
Created November 17, 2011 07:22
ec2-cf-ini-1
[global]
username:root
ssh_key:/var/lib/jenkins/key.pem
port:8091
[servers]
1:@IP1@
1:@IP2@
3:@IP3@
import sys
import os
import uuid
sys.path.append(".")
sys.path.append("lib")
from mc_bin_client import MemcachedClient
from memcached.helper.data_helper import MemcachedClientHelper
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_225:num_checkpoints: 3
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_496:num_checkpoints: 3
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_497:num_checkpoints: 3
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_124:num_checkpoints: 3
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_309:num_checkpoints: 3
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_380:num_checkpoints: 3
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_381:num_checkpoints: 3
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_412:num_checkpoints: 3
tapcheckpointstats-umami-201111232025/checkpointstats.umami.201111232025.txt: vb_490:num_checkpoints: 3
tapchec
rm -rf ~/capture.out
while [ 1 ]
do
date >> ~/capture.out
/opt/couchbase/bin/cbstats localhost:11210 timings >> ~/capture.out
sleep 1800
done
for 1 hr change sleep to 3600
rm -rf ~/capture.out
while [ 1 ]
do
date >> ~/capture.out
./sqlite3_analyzer /mnt/ebs/default-data/default-1.mb >> ~/capture.out
sleep 1800
done
for 1 hr change sleep to 3600
@farshidce
farshidce / gist:1571422
Created January 6, 2012 16:55
clean build machine
make do-hard-clean-xfd-couchdb
make do-hard-clean-xfd-ep_engine
make do-hard-clean-xfd-ep-engine
make do-hard-clean-xfd-ns-server
make do-hard-clean-xfd-ns_server
make do-hard-clean-xfd-memcached
make do-hard-clean-xfd-libmemcched
make do-hard-clean-xfd-libmemcached
make do-hard-clean-xfd-bucket_engine
make do-hard-clean-xfd-membase-cli
@farshidce
farshidce / rename-rel
Created January 6, 2012 16:56
rename rel files
import os
find = "1.8.0r-55-g80f24f2"
replace = "1.8.0"
files = os.listdir(".")
for f in files:
if f.index(find) != -1:
newf = f.replace(find,replace)
print newf
os.rename(f,newf)