Skip to content

Instantly share code, notes, and snippets.

View Mierdin's full-sized avatar

Matt Oswalt Mierdin

View GitHub Profile
$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=(
@Mierdin
Mierdin / pocketdedupe.py
Last active August 16, 2024 09:42
A Python script to intelligently remove duplicate entries from Pocket
#!/usr/bin/env python
from pocket import Pocket
import webbrowser, sys
# Get consumer key from cmd line
consumer_key = sys.argv[1]
request_token = Pocket.get_request_token(
consumer_key=consumer_key,
~GOPATH/src/gerrit.geomys.net/geomys/geomys/georipd ⮀ master●● ⮀ 1h53m ⮀ go run georipd.go
https://gist.github.com/ea40fa56933aa40ccd97
https://gist.github.com/ea40fa56933aa40ccd97
thisRoute1 := obj.RipRoute{
AddrFamily: 2,
RouteTag: 0,
IpAddr: 0,
Netmask: 4294967040,
NextHop:0,
Metric: 1,
}