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
#!/bin/bash | |
period=$1 | |
shift | |
pattern=$@ | |
last_timestamp= | |
while :; do | |
line=$(dmesg | grep "$pattern" | tail -n 1) | |
timestamp=$(echo $line | cut -d" " -f1 | sed 's/[]\[]//g') |
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
#!/bin/bash | |
ip2dec () { | |
local a b c d ip=$@ | |
IFS=. read -r a b c d <<< "$ip" | |
printf '%d\n' "$((a * 256 ** 3 + b * 256 ** 2 + c * 256 + d))" | |
} | |
die () { | |
echo $1 |
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
Adding datacenter | |
syntax: `vipsmart dc add dc-1,192.168.0.99,9610` | |
Tells **local dc** to add **candidate dc** dc-1 to the federation. | |
If **local dc** is not federated yet it will decalre federation consisting | |
of itself and add **candidate dc**. | |
Important assumptions: | |
- **local dc** might not be federated yet, it will create a federation of itself and add **candidate dc** |
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
root@kimogi-MacBookAir:/home/kimogi# ifconfig eth0 # original mac | |
eth0 Link encap:Ethernet HWaddr bc:f6:85:d7:1a:1a | |
UP BROADCAST MULTICAST MTU:1500 Metric:1 | |
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:1000 | |
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | |
root@kimogi-MacBookAir:/home/kimogi# ifconfig eth0 down | |
root@kimogi-MacBookAir:/home/kimogi# ifconfig eth0 hw ether de:ad:be:ef:00:00 |
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
#!/bin/bash -ex | |
replace_template_entries() { | |
MAP=$1 | |
REPLACEMENT_TAG=$2 | |
ACTION=$3 | |
TOOLCHAIN_DOCKERFILE="/tmp/testsetup" |
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
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
"math/big" | |
"os" | |
) | |
type dc struct { |
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
{ | |
"Caterpie": [1.04, 1.08], | |
"Weedle": [1.06, 1.1], | |
"Abra": [1.36, 1.95], | |
"Gloom": [1.48, 1.53], | |
"Oddish": [1.48, 1.51], | |
"Ponyta": [1.48, 1.5], | |
"Bellsprout": [1.54, 1.6], | |
"Bulbasaur": [1.53, 1.58], | |
"Weepinbell": [1.47, 1.59], |
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
Example policy for traffic fro pod to host | |
``` | |
{ | |
"rules": [ | |
{ | |
"ports": [ | |
80 | |
], | |
"protocol": "TCP" | |
} |
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
./romana segment add tenantname segmentname. --externalid <externalid> | |
./romana tenant add <tenantname> --externalid <externalid> |
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 | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
from optparse import OptionParser | |
from urlparse import urlparse, parse_qs | |
import os | |
parser = OptionParser(usage="%prog --port") | |
parser.add_option('--port', default=8080, dest="port", type="int", | |
help="Port number to listen for incoming requests") |