Skip to content

Instantly share code, notes, and snippets.

View Vegasq's full-sized avatar

Nick Yakovliev Vegasq

View GitHub Profile

During our investigation of QoS state in Juniper contrail we found strange behaviour of NetworkPolicies.

Test Case A

Let's assume we have 2 networks connected with 2 bidirectional policies:

  • Policy 1 should pass any protocol from/to network A with ports [ 0-6000 ] to network B. Also Policy 1 rule have configured QoS that should mark traffic with tag DSCP 30 (TOS 120).

  • Policy 2 should pass any protocol from/to network A with ports [ 6001-20000 ] to network B.

@Vegasq
Vegasq / validate_compaction_strategies.py
Created June 7, 2017 19:26
validate_compaction_strategies.py
#!/usr/bin/python
import sys
try:
from cassandra.cluster import Cluster
except ImportError:
print("Please, install python-cassandra-driver.\n\nsudo apt install python-cassandra-driver")
exit()
from ConfigParser import RawConfigParser
from pprint import pprint
import requests
from lxml import html
def get_downtowns():
result = {}
page = requests.get("https://en.wikipedia.org/wiki/Downtown")
phtml = html.fromstring(page.content)
for i in phtml.iterlinks():
@Vegasq
Vegasq / contrail-node-list.py
Last active January 30, 2018 21:52
Print list of Contrail nodes in cloud. Usage: python contrail-node-list.py --username admin --password admin --tenant admin --contrail-ep http://172.1.1.1:8182/ --keystone-ep http://172.1.1.2:5000/v2.0/
#!/usr/bin/python
# 1.0 basic version
# 1.1 --delete added
__author__ = "Mykola Yakovliev"
__credits__ = ["Mykola Yakovliev"]
__license__ = "GPLv3"
__version__ = "1.1"
__maintainer__ = "Mykola Yakovliev"
@Vegasq
Vegasq / kvapa.py
Last active March 22, 2016 17:36
Custom tool to do snapshot/restore for envs created with fuel-devops. Reason for existing is bug in qemu that do not allow to do snapshots in systems with tough IO.
#!/usr/bin/env python
# 2016, Mykola Yakovliev <[email protected]>
import argparse
import logging
import os
import random
import shutil
import subprocess
import libvirt
@Vegasq
Vegasq / dos_add_disk.py
Last active March 1, 2016 18:41
Fuel devops replace disk
import os
import sys
from devops import models
def main(env_name, node_name, size=300, add=True):
# value in GB
size = size * 1000000000
env = models.Environment.get(name=env_name)
node = env.get_node(name=node_name)
@Vegasq
Vegasq / gist:0c8298054c05a04eafe2
Last active January 15, 2016 16:36
Execute command on openstack node thru fuel
#!/bin/bash
#
# USAGE:
# eoc.sh <FUEL NODE> <COMMAND TO EXECUTE> <NODE TYPE>
#
# FUEL NODE: default 10.20.0.2
# COMMAND: default uname -a
# NODE TYPE: default nova
#
@Vegasq
Vegasq / local.conf
Last active August 29, 2015 14:23 — forked from etoews/local.conf
[[local|localrc]]
# Credentials
DATABASE_PASSWORD=devstack
ADMIN_PASSWORD=devstack
SERVICE_PASSWORD=devstack
SERVICE_TOKEN=devstack
RABBIT_PASSWORD=devstack
# Services
@Vegasq
Vegasq / GetChromeRemoteCode.sh
Last active February 17, 2016 02:38
Make GoogleChrome remote key screenshot
#!/bin/bash
# GetChromeRemoteCode.sh
# Run with CRON like
# * * * * * ~/chrome_remote.sh
# Required:
# google-chrome + chrome remote desktop
# tesseract-ocr