Skip to content

Instantly share code, notes, and snippets.

View jsenecal's full-sized avatar

Jonathan Senecal jsenecal

View GitHub Profile
@jsenecal
jsenecal / revert_changes.py
Created April 10, 2024 18:35
Netbox revert_changes.py
from extras.scripts import Script, StringVar
from utilities.exceptions import AbortScript
from extras.models import ObjectChange
from dcim.models import Site
class revert_change(Script):
class Meta:
name = "Revert Change"
description = "Revert a change made to an object"
@jsenecal
jsenecal / rebuild.py
Created May 15, 2023 12:54
Netbox Script to rebuild device types and modules
from typing import List, Union
from dcim.models import (
ConsolePort,
ConsoleServerPort,
Device,
DeviceBay,
FrontPort,
Interface,
Module,
@jsenecal
jsenecal / arin.py
Created April 24, 2023 17:16
NETBOX REGRWS
# system
import os
from typing import Literal
from unidecode import unidecode
import googlemaps
# netbox
from dcim.models.sites import Site
import requests
import pynetbox
from termcolor import colored
from nornir import InitNornir
from nornir_utils.plugins.functions import print_result
from nornir_napalm.plugins.tasks import napalm_get
from nornir.core.filter import F
# NetBox Layer 3 switches (Base Inventory Group Defined in the config file below)
@jsenecal
jsenecal / iperf3.service
Created August 31, 2020 02:22 — forked from auipga/iperf3.service
systemd service unit for iperf3
# /etc/systemd/system/iperf3.service
# User service: $HOME/.config/systemd/user/iperf3.service
[Unit]
Description=iperf3 server
After=syslog.target network.target auditd.service
[Service]
Restart=always
RestartSec=3