Skip to content

Instantly share code, notes, and snippets.

View Mierdin's full-sized avatar

Matt Oswalt Mierdin

View GitHub Profile
08:47:31.784 [main] TRACE o.o.o.l.j.JsonRpcEndpoint - {"id":"c927ed19-f42d-4ed3-bb0c-ce0b9e14c47e","method":"list_dbs","params":[]}
08:47:31.819 [nioEventLoopGroup-3-1] TRACE o.o.o.l.j.JsonRpcEndpoint - Response : {"id":"c927ed19-f42d-4ed3-bb0c-ce0b9e14c47e","result":["hardware_vtep","Open_vSwitch"],"error":null}
08:47:31.869 [main] TRACE o.o.o.l.j.JsonRpcEndpoint - {"id":"c2f22bea-445b-4699-9bc0-b5d380ec1a5f","method":"get_schema","params":["hardware_vtep"]}
08:47:31.903 [nioEventLoopGroup-3-1] TRACE o.o.o.l.j.JsonRpcEndpoint - Response : {"id":"c2f22bea-445b-4699-9bc0-b5d380ec1a5f","result":{"tables":{"Physical_Port":{"columns":{"name":{"type":"string"},"description":{"type":"string"},"vlan_stats":{"type":{"key":{"maxInteger":4095,"minInteger":0,"type":"integer"},"min":0,"value":{"type":"uuid","refTable":"Logical_Binding_Stats"},"max":"unlimited"}},"vlan_bindings":{"type":{"key":{"maxInteger":4095,"minInteger":0,"type":"integer"},"min":0,"value":{"type":"uuid","refTable":"Logical_Switch"},"max":"unlimited"}
public boolean checkSchema() throws IOException, ExecutionException, InterruptedException, TimeoutException {
if (this.ovs == null) {
this.ovs = getTestConnection();
HardwareVtepSchemaSuiteIT.setOvsdbClient(this.ovs);
//retrieve list of databases from OVSDB server
ListenableFuture<List<String>> databases = ovs.getDatabases();
List<String> dbNames = databases.get();
Assert.assertNotNull(dbNames);
Assume.assumeTrue(super.checkSchema());
$VNTemp = Get-UcsVnicTemplate -Name "Guest-A"
for ($i=1000; $i -le 1499; $i++)
{
$vlanName = Get-UcsVlan -Id $i | select name
Add-UcsVnicInterface -VnicTemplate $vNicTemplate -name $vlanName.name -DefaultNet false
}
~ ❯❯❯ cat ./getconsole.sh
screen /dev/tty.Airconsole-1 9600
@Mierdin
Mierdin / ucsfilter.py
Last active August 29, 2015 14:08
Example Filter in Python for Cisco UCS
#This was not documented at all. I had to use the UCS Visore tool to get the XML needed to do filtering,
#Then I took that request and used the PowerShell ConvertTo-UcsCmdlet function to convert to Python.
# PS C:\Users\Mierdin> ConvertTo-UcsCmdlet -Xml -Request '<configResolveClass classId="lsServer" cookie="1414451334/d63131a4-a4bc-420b-beba-f59e0b520d33" inHierarchical="false"><inFilter><and><eq class="lsServer" property="type" value="instance" /><wcard class="lsServer" property="dn" value="^org-root/" /></and></inFilter></configResolveClass>' -Python
inFilter = FilterFilter()
andFilter0 = AndFilter()
eqFilter = EqFilter()
eqFilter.Class = "lsServer"
#!/bin/bash
# Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@Mierdin
Mierdin / assembleroles.sh
Created December 30, 2014 17:01
A shell script to assemble a list of ansible roles from GitHub repos in my profile (for a big upcoming demonstration)
#!/bin/bash
set -euo pipefail # Unofficial bash strict mode
IFS=$'\n\t'
# This script will clone each GitHub repo containing a desired
# Ansible role, and extract the role contained within. Used to
# assemble a list of Ansible roles, specifically for demo purposes
# Create array containing repository names
declare -a REPOS=(
~GOPATH/src/gerrit.geomys.net/geomys/geomys/georipd ⮀ master●● ⮀ 1h53m ⮀ go run georipd.go
https://gist.github.com/ea40fa56933aa40ccd97