Skip to content

Instantly share code, notes, and snippets.

View sulrich's full-sized avatar
🙀
furble plotz

steve ulrich sulrich

🙀
furble plotz
View GitHub Profile
@sulrich
sulrich / parse-gobmp-dump.py
Created July 10, 2024 19:18
script to parse GoBMP dump outputs
#!/usr/bin/env python3
import json
import base64
import argparse
import pprint as pprint
import sys
def parse_logentry(entry):
@sulrich
sulrich / nc-capability.py
Created March 26, 2024 01:35
netconf capabilities dump
#!/usr/bin/env python3
from ncclient import manager
import argparse
NETCONF_PORT = "830"
def parseCliArgs():
"""parse command line options and CLI flag dependencies.

all peers up - dumb, fat, happy.

gnmic --insecure -u admin -p -a 172.20.20.61:6030 --format flat \
get --path /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/.../state/enabled
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=10.10.0.1]/afi-safis/afi-safi[afi-safi-name=IPV4_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=10.10.1.1]/afi-safis/afi-safi[afi-safi-name=IPV4_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=2001:db8:10:10:1::1]/afi-safis/afi-safi[afi-safi-name=IPV6_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[name=BGP][identifier=BGP]/bgp/neighbors/neighbor[neighbor-address=2001:db8:10:10::1]/afi-safi
@sulrich
sulrich / get-anet-eox.py
Last active January 16, 2024 03:41
a python wrapper around the arista EoX API
#!/usr/bin/env python3
import sys
import argparse
import base64
import os
import pprint
import requests
import json
import datetime
#!/usr/bin/env python3
import requests
import base64
import os
import pprint
API_HOST = "www.arista.com"
SESSION_CODE_API_URL = "https://" + API_HOST + "/api/sessionCode/"
#!/usr/bin/env python3
import json
import pprint
import sys
def main():
"""main :returns: the needful"""
with open(sys.argv[1], "r") as json_data:
#!/usr/bin/env python3
import radix
import ipaddress
rtree = radix.Radix()
test_addrs = [
"10.0.0.0/24",
"10.0.1.0/24", # should form a /23 w/the above
#!/bin/bash
if [ "$1" = "" ]
then
cat <<EOFUSAGE
usage:
case-blurb <case-number> - where the case-number is a whitespace-free string
EOFUSAGE
#!/usr/bin/env python3
import radix
import ipaddress
rtree = radix.Radix()
test_addrs = [
"10.0.0.0/24",
"10.0.1.0/24", # should form a /23 w/the above