Skip to content

Instantly share code, notes, and snippets.

View kecorbin's full-sized avatar

Kevin Corbin kecorbin

  • HashiCorp
  • United States
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kecorbin on github.
  • I am kcorbin (https://keybase.io/kcorbin) on keybase.
  • I have a public key whose fingerprint is 04AE 987E 0355 328F C611 4D82 DAC1 99B7 6E41 8C8F

To claim this, I am signing this object:

policy rule EnabledInterfacesRequireDescription
foreach /devices/device/config/nx:interface/Ethernet[not(shutdown)]
expr ./description
warning-message "Interface {./name} on {../../../name} needs description"
@kecorbin
kecorbin / port-in-use.py
Created October 9, 2018 21:29
Determine if a port is in use on ACI
#!/usr/bin/env python
"""
Find out where a DN is used
"""
from acitoolkit import Credentials, Session
from tabulate import tabulate
data = []
@kecorbin
kecorbin / where-used.py
Created May 8, 2018 20:51
A sample script to determine where a DN is used in the ACI object model.
"""
Find out where a DN is used
"""
from acitoolkit import Credentials, Session
from tabulate import tabulate
data = []
def main():
@kecorbin
kecorbin / check_save.py
Created March 7, 2018 23:40
netmiko script to detect unsaved changes on NX-OS devices
from netmiko import ConnectHandler
def run_commands(host, user, pw, command, device_type="cisco_nxos"):
"""
Executes a commands on a device
:param host: IP/hostname
:param user: username to login to the switch
:param pw: password to login to the switch
:param command: list of commands to execute on each device
:param device_type: netmiko device type
@kecorbin
kecorbin / connect.py
Created December 12, 2017 18:00
simple pyats connection
from ats.topology import loader
from unicon import Unicon
testbed = loader.load('testbed_working.yaml')
testbed.devices.ios2.connect(cls=Unicon)
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name