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
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
fn main () {
println!("{}", hg(1,8,3,4));
}
fn hg(a: i64, b: i64, c: i64, z: i64) -> i64 {
let mut j = 10;
loop {
let snp1 = inner_hg(a,b,c,z,j+1);
let sn = inner_hg(a,b,c,z,j);
if (((snp1 - sn).abs() / sn) as f64) < 0.001f64 {
# There can only be a single job definition per file.
# Create a job with ID and Name 'example'
job "example" {
# Run the job in the global region, which is the default.
# region = "global"
# Specify the datacenters within the region this job can run in.
datacenters = ["dc1"]
# Service type jobs optimize for long-lived services. This is

Keybase proof

I hereby claim:

  • I am achanda on github.
  • I am achanda (https://keybase.io/achanda) on keybase.
  • I have a public key whose fingerprint is ED99 4AC8 2AFA 05F6 F766 7C52 D845 C1C2 91D0 6A0C

To claim this, I am signing this object:

@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'