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
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 { |
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
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 |
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
[[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 |
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
#!/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() |
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
#!/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') |
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
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 |
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 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) |
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 argparse | |
import copy | |
import datetime | |
import getpass | |
import locale | |
import os | |
import six | |
import sys | |
import time | |
import mock |
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
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' |
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
# 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 |