Skip to content

Instantly share code, notes, and snippets.

@ajayhn
ajayhn / coreos-on-do.sh
Created September 27, 2017 16:47
coreos-on-do.sh
#!/bin/bash
set -e
# Forked from https://raw.githubusercontent.com/ibuildthecloud/coreos-on-do/master/coreos-on-do.sh
CHANNEL=${CHANNEL:-alpha}
VERSION=${VERSION:-current}
install_kexec()
{
@ajayhn
ajayhn / README.md
Created September 26, 2017 22:14 — forked from andyshinn/README.md
CoreOS on Digital Ocean using Terraform

Terraform, CoreOS, and Digital Ocean

Let's use Terraform to easily get a CoreOS cluster up on Digital Ocean. In this example we will get a 5 node CoreOS cluster up and running on the Digital Ocean 8GB size.

Install Terraform

Grab a copy of Terraform for your platform from http://www.terraform.io/downloads.html. Follow the instructions at http://www.terraform.io/intro/getting-started/install.html by getting Terraform in your PATH and testing that it works.

Digital Ocean API Key

@ajayhn
ajayhn / .tmux.conf
Last active June 5, 2017 02:50
tmux settings
# unset C-b as leader and set backtick as leader
unbind C-b
set-option -g prefix `
# backtick+e for backtick
bind e send-prefix
# backtick+backtick for toggle
bind ` last-window
@ajayhn
ajayhn / az01-churches.geojson
Last active May 16, 2017 21:40
List of Churches at AZ-01 congressional district.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajayhn
ajayhn / create-net-audit-log
Last active October 11, 2016 20:21
create-net-audit-log
root@a5s8:~# neutron net-create test-net-1
Created a new network:
+-------------------------+--------------------------------------+
| Field | Value |
+-------------------------+--------------------------------------+
| admin_state_up | True |
| contrail:fq_name | default-domain |
| | admin |
| | test-net-1 |
| contrail:instance_count | 0 |
@ajayhn
ajayhn / ifmap-server-error-handling
Created September 15, 2016 18:14
ifmap-server-error-handling
1. timeout when publishing to ifmap-server (mapclient.call())
when timeout happens keep retrying
2. ifmap-server code needs to inspect healthcheck object publish and if it misses n of them, exit() OR
config-nodemgr keeps reading healthcheck object from ifmap-server and if it can't read in n secs or value is stale, kill ifmap-server
3. control-node keeps reading healthcheck object from ifmap and it sees stale, move to a new ifmap-server
4. ifmap-publish-greenlet enqueue finds q-full, no change from current
@ajayhn
ajayhn / gist:ab379ae36a0e07d101e4861587541828
Created September 9, 2016 06:22
satisfy any import from vnc_api.types.
in vnc_api/__init__.py
```
import sys
import imp
class MyImportFinder(object):
def find_module(self, fullname, path=None):
print fullname
@ajayhn
ajayhn / setup-aptly.sh
Created August 25, 2016 01:11
setup-aptly-on-ubuntu
#!/bin/bash
sudo echo "deb http://repo.aptly.info/ squeeze main" > /etc/apt/sources.list.d/aptly.list
wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -
sudo apt-get update
sudo apt-get install aptly
@ajayhn
ajayhn / analytics-on-separate-db-node.md
Created June 22, 2016 20:42
analytics-on-separate-db-node
  1. Install 3 new servers with base OS same s4,5,6
  2. Install analytics and database packages on the 3 new servers s4,5,6
    • which packages kafka too?
  3. service supervisor-analytics stop; service cassandra stop; kafka?
  4. Determine whether old analytics DB is to be migrated or built anew 4.1 To be anew 4.1.1 service supervisor-analytics stop on s1,2,3 4.1.2 provision cassandra.yaml and cassandra-env.sh to have a cluster of s4,5,6 4.1.3 provision analytics processes - discovery-ip should be VIP. 4.1.4 service supervisor-analytics start; service cassandra start; kafka?
@ajayhn
ajayhn / contrail-controller-dockerfile.r3.0
Last active January 30, 2018 21:31
contrail-controller-dockerfile.r3.0
FROM ubuntu:14.04
# e.g. docker build --build-arg REPO_URL=http://hajay-repo:8080/kilo-3.0.0.0-2723-kilo/ --build-arg REPO_DIST=opencontrail-R3.0 .
ARG REPO_URL=http://hajay-repo:8080/kilo-3.0.0.0-2723-kilo/
ARG REPO_DIST=opencontrail-R3.0
RUN echo "deb ${REPO_URL} ${REPO_DIST} main" >> /etc/apt/sources.list.d/opencontrail.list
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated curl strace tcpdump
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated cassandra zookeeper rabbitmq-server