This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
models = [ | |
Cable, | |
ConsolePort, | |
ConsolePortTemplate, | |
ConsoleServerPort, | |
ConsoleServerPortTemplate, | |
Device, | |
DeviceBay, | |
DeviceBayTemplate, | |
DeviceRole, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from: https://requests.readthedocs.io/en/latest/api/#main-interface | |
import requests | |
import logging | |
# Enabling debugging at http.client level (requests->urllib3->http.client) | |
# you will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA. | |
# the only thing missing will be the response.body which is not logged. | |
try: # for Python 3 | |
from http.client import HTTPConnection | |
except ImportError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net" | |
) | |
func main() { | |
conn, err := net.Dial("tcp", "duckduckgo.com:80") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devices: | |
- hostname: "csr1" | |
platform: "cisco_iosxe" | |
commands: | |
- "show version" | |
- "show interfaces" | |
- hostname: "nxos-spine1" | |
platform: "cisco_nxos" | |
commands: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from pathlib import Path | |
def compute_dscp_class(dscp): | |
quot, rmnd = divmod(dscp, 8) | |
if rmnd == 0: | |
dscpcl = "cs{}".format(quot) | |
elif (quot, rmnd) == (5, 6): | |
dscpcl = "ef" |