This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo mkfs -t ext4 /dev/xvdf | |
| sudo mkdir /opt/couchbase | |
| sudo mount -t ext4 /dev/xvdf /opt/couchbase | |
| sudo aptitude install libssl0.9.8 | |
| wget http://packages.couchbase.com/releases/2.0.0-developer-preview-4/couchbase-server-community_x86_64_2.0.0-dev-preview-4.deb | |
| sudo dpkg -i couchbase-server-community_x86_64_2.0.0-dev-preview-4.deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo su bigcouch - | |
| sed 's/XXXX/`hostname -f`/' <opt/bigcouch/etc/vm.args.in >/opt/bigcouch/etc/vm.args | |
| curl -X PUT http://10.190.47.125:5986/nodes/bigcouch@`hostname -f` -d {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo mkfs -t ext4 /dev/xvdf | |
| sudo mkdir /opt/couchbase | |
| sudo mount -t ext4 /dev/xvdf /opt/couchbase | |
| sudo apt-get install libssl0.9.8 | |
| wget http://packages.couchbase.com/releases/2.0.0-developer-preview-4/couchbase-server-community_x86_64_2.0.0-dev-preview-4.deb | |
| sudo dpkg -i couchbase-server-community_x86_64_2.0.0-dev-preview-4.deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div style="background-color:#ffffff; color:#000000; padding:20px;"> | |
| <h2>TERMS OF USE</h2> | |
| <h3>ACCEPTANCE OF TERMS</h3> | |
| <p> | |
| <pre> | |
| Terms of Use go here | |
| </pre> | |
| </p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto.mturk | |
| import boto.mturk.connection | |
| import boto.mturk.price | |
| from boto.mturk.question import * | |
| import sys | |
| question = QuestionForm([ | |
| Question( | |
| identifier=1, | |
| content=QuestionContent([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| def message_trafic(): | |
| recv_oct, recv_cnt, send_oct, send_cnt = 0,0,0,0 | |
| pipe = subprocess.Popen("sudo rabbitmqctl list_connections name recv_oct recv_cnt send_oct send_cnt", shell=True, stdout=subprocess.PIPE).stdout | |
| for line in pipe: | |
| record = line.split()... try: | |
| recv_oct += float(record[3]) | |
| recv_cnt += float(record[4]) | |
| send_oct += float(record[5]) | |
| send_cnt += float(record[6]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update | |
| sudo apt-get install haproxy | |
| sudo sed 's/ENABLED\s*=\s*0/ENABLED=1/' < /etc/default/haproxy > /tmp/haproxy | |
| sudo cp /tmp/haproxy /etc/default/haproxy | |
| sudo update-rc.d -f haproxy remove | |
| sudo update-rc.d -f networking remove | |
| sudo update-rc.d haproxy start 37 2 3 4 5 . stop 20 0 1 6 . | |
| sudo update-rc.d networking start 34 2 3 4 5 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_ec2_instances(**tags): | |
| from pprint import pprint | |
| from django.conf import settings | |
| import boto | |
| aws = boto.connect_ec2(settings.AWS_ACCESS_KEY_ID ,settings.AWS_SECRET_ACCESS_KEY) | |
| reservations = aws.get_all_instances() | |
| return [i for r in reservations = aws. for i in r.instances if set(tags.items()) & set(i.tags.item())] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install mdadm | |
| sudo apt-get intall lvm2 | |
| sudo mdadm --verbose --create /dev/md0 --level=5 --chunk=256 --raid-devices=4 /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi | |
| echo 'DEVICE /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi' | sudo tee -a /etc/mdadm.conf | |
| sudo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf | |
| sudo blockdev --setra 128 /dev/md0 | |
| sudo blockdev --setra 128 /dev/xvdf | |
| sudo blockdev --setra 128 /dev/xvdg | |
| sudo blockdev --setra 128 /dev/xvdh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // usage: <td data-bind="jqSlider: points"></td> | |
| ko.bindingHandlers.jqSlider = { | |
| init: function(element, valueAccessor) { | |
| $(element).empty().slider({ | |
| range: "min", | |
| min: 0, | |
| max: 5, | |
| change:function( event, ui ) { | |
| var observable = valueAccessor(); |