Skip to content

Instantly share code, notes, and snippets.

View achanda's full-sized avatar
🏠
Working from home

Abhishek Chanda achanda

🏠
Working from home
View GitHub Profile
@achanda
achanda / gist:5751126
Created June 10, 2013 18:39
Devstack install script
#!/bin/sh
apt-get update
apt-get install -qqy git
git clone https://github.com/openstack-dev/devstack.git
cd devstack
echo ADMIN_PASSWORD=password > localrc
echo MYSQL_PASSWORD=password >> localrc
echo RABBIT_PASSWORD=password >> localrc
echo SERVICE_PASSWORD=password >> localrc
echo SERVICE_TOKEN=tokentoken >> localrc
@achanda
achanda / gist:5758936
Last active December 18, 2015 09:09
Devstack and Quantum single node
# add user stack and add to sudoers
adduser stack
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
su - stack
#!/bin/sh
apt-get update
apt-get install -qqy git
git clone https://github.com/openstack-dev/devstack.git
cd devstack
irb(main):029:0> agent.keep_alive = false
=> false
irb(main):030:0> landing_page = login_form.submit
Net::HTTP::Persistent::Error: too many connection resets (due to end of file reached - EOFError) after 0 requests on 70114964825340, last used 1383267550.2734878 seconds ago
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/protocol.rb:153:in `read_nonblock'
@achanda
achanda / gist:7990477
Last active December 31, 2015 13:08
Measure performance of two implementations
import argparse
import copy
import datetime
import getpass
import locale
import os
import six
import sys
import time
import mock
def znode_bind_ip
#Needs to load on call so it gets recently written changes
site_conf = SC.load
result = nil
addrs = Socket.ip_address_list
mngmt_cidr = NetAddr::CIDR.create(site_conf.management_cidr)
addrs.each do |addr|
valid_ip = NetAddr.validate_ip_addr(addr.ip_address, :Version => 4) rescue false
if valid_ip
if mngmt_cidr.matches?(addr.ip_address)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
netmask 255.255.255.0
hwaddress ether e8:9a:8f:91:a9:f0
network_name management
address 172.20.0.13
auto eth1
@achanda
achanda / pika_server.py
Last active August 29, 2015 14:10
Server
#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='test_header', type='headers')
channel.exchange_declare(exchange='test_direct', type='topic')
@achanda
achanda / pika_client.py
Created November 19, 2014 21:36
Client
#!/usr/bin/env python
import pika
import uuid
class FibonacciRpcClient(object):
def __init__(self):
self.connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
self.channel = self.connection.channel()
@achanda
achanda / local.conf
Created December 15, 2014 17:57
Working bare min local conf with neutron
[[local|localrc]]
ADMIN_PASSWORD=secrete
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
HOST_IP=10.240.144.35
FIXED_RANGE=10.0.0.0/24
FLOATING_RANGE=192.168.27.0/24
PUBLIC_NETWORK_GATEWAY=192.168.27.2
@achanda
achanda / local.conf
Last active June 10, 2017 20:52
working local config
IP_VERSION=4
FIXED_RANGE=10.0.0.0/24
NETWORK_GATEWAY=10.0.0.1
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0
ADMIN_PASSWORD=password
MYSQL_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=helloStackinsider