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 / vbmap-bef-fo-1
Created March 19, 2012 13:09
vbmap-bef-fo-1
{"name":"default","bucketType":"membase","authType":"sasl","saslPassword":"","proxyPort":0,"uri":"/pools/default/buckets/default","streamingUri":"/pools/default/bucketsStreaming/default","flushCacheUri":"/pools/default/buckets/default/controller/doFlush","nodes":[{"systemStats":{"cpu_utilization_rate":0.5414410662224073,"swap_total":11814912000.0,"swap_used":0},"interestingStats":{"curr_items":11177939,"curr_items_tot":22368795,"vb_replica_curr_items":11190856},"uptime":"194492","memoryTotal":67545075712.0,"memoryFree":1611206656,"mcdMemoryReserved":51532,"mcdMemoryAllocated":51532,"replication":1.0,"clusterMembership":"active","status":"healthy","hostname":"10.80.72.238:8091","clusterCompatibility":1,"version":"1.8.0r-55-g80f24f2-enterprise","os":"x86_64-unknown-linux-gnu","ports":{"proxy":11211,"direct":11210}},{"systemStats":{"cpu_utilization_rate":0.41649312786339027,"swap_total":11814912000.0,"swap_used":0},"interestingStats":{"curr_items":11190748,"curr_items_tot":22386216,"vb_replica_curr_items":111954
@farshidce
farshidce / ios202manifest
Created March 20, 2012 00:41
ios 2.0.2 manifest
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="git://github.com/couchbase/" name="couchbase" review="review.couchbase.org"/>
<remote fetch="git://github.com/couchbaselabs/" name="couchbaselabs" review="review.couchbase.org"/>
<default remote="couchbase" revision="master"/>
<project name="CouchCocoa" remote="couchbaselabs" revision="7041bfdd6b16ba600a5c6c3d6529d4f710928ba8"/>
<project name="couchdb" path="vendor/couchdb" revision="312b1528b7e5fb143ccc2cbd81f7388a728d211a"/>
<project name="geocouch" path="vendor/geocouch" revision="1cc3251fecd75ffaae32c509716f9415fb6c5a0d"/>
@farshidce
farshidce / gist:2432350
Created April 20, 2012 22:33
recreating dead partition
#!/bin/sh
vgcreate VolGroup01 /dev/sdb
lvcreate --extents 100%VG --name Data VolGroup01
mkfs -t ext3 -m 0 /dev/VolGroup01/Data
#echo "/dev/VolGroup01/Data /data ext3 defaults 0 0" >> /etc/fstab
mkdir -p /data
mount /data
import os
import sys
import getopt
import exceptions
import struct
from optparse import OptionParser
from couchbase.rest_client import RestConnection
parser = OptionParser()
instructions:
find out which vbuckets are active on node X by running
opt/couchbase/bin/cbstats localhost:11210 checkpoint | grep active
vb_10:state: active
vb_11:state: active
vb_12:state: active
vb_13:state: active
validation :
- replica index enabled and disabled
- failover
todo :
- Replica Index ( Feature Tests )
- Aliaksey to explain when how replica index
@farshidce
farshidce / vbucketpop.py
Created July 26, 2012 00:12
vbucketpop
#!/usr/bin/env python
"""Load data into memcached and an on disk key value store."""
import sys
import getopt
import mc_bin_client
import pickle
def usage(err=None):
err_code = 0
@farshidce
farshidce / kvstore_1024
Created July 26, 2012 00:13
kvstore_1024
(dp0
I0
(lp1
S'zzz_cb_dummy_76'
p2
aS'zzz_cb_dummy_937'
p3
asI1
(lp4
S'zzz_cb_dummy_255'
@farshidce
farshidce / check-jira.py
Created August 2, 2012 17:00
check-jira
#!/usr/bin/env python2.6
# Copyright (c) 2010, Code Aurora Forum. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# # Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# # Redistributions in binary form must reproduce the above
@farshidce
farshidce / tapstatspoller.py
Created August 21, 2012 16:49
tapstatspoller
#!/usr/bin/python
# example ./poller.py localhost bucketname bucketpassword
from mc_bin_client import MemcachedClient
import time
import sys
from threading import Thread
stopped = False
def poller(ip,bucket,password):
mc = MemcachedClient(ip,11210)
mc.sasl_auth_plain(bucket,password)