This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """ | |
| junos_log_tally.py | |
| ================== | |
| Counts Junos syslog message mnemonics inside one or more log files/directories | |
| and prints them as NAME / COUNT / DESCRIPTION. | |
| • Reads the official Juniper “System Log Messages” spreadsheet exported to CSV | |
| (column headers must include NAME and DESCRIPTION). | |
| • Accepts any number of log paths (files or directories) and walks directories |
This file contains hidden or 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
| # Initialize an empty array to store the results | |
| $resultArray = @() | |
| # Retrieve a list of all VMs from vCenter | |
| $vmlist = Get-VM | |
| # Select 4 random VMs from the list for processing | |
| $testList = $vmlist | Get-Random -Count 4 | |
| # Loop through the randomly selected VMs |
This file contains hidden or 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
| #!/bin/bash | |
| ################################################################################### | |
| # Network Testing Script | |
| # | |
| # This script performs comprehensive network testing using iperf3 with both TCP and UDP | |
| # protocols. It supports IMIX packet sizes and various bandwidth configurations. | |
| ################################################################################### | |
| # Configuration file and logging setup |
This file contains hidden or 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
| #!/usr/bin/python | |
| """ | |
| Network Topology Visualization Generator | |
| This script generates a PDF file representing the network topology using CDP (Cisco Discovery Protocol) | |
| and LLDP (Link Layer Discovery Protocol) data from LibreNMS. It visualizes network device connections | |
| using the Graphviz library to create a directed graph representation. | |
| Requirements: | |
| - requests: For API interactions |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # Standard library imports | |
| import requests | |
| # Authentication and API Configuration | |
| # Replace **** with actual authentication token in production | |
| AUTH_TOKEN = "****" | |
| # API endpoint URLs |
This file contains hidden or 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
| #!/bin/bash | |
| # Define the API URL and token (use the updated base URL) | |
| API_URL="http://dfw1anetlnms01/api/v0/devices/" | |
| API_TOKEN="*****" | |
| # Fetch device names and save to a text file | |
| curl -s -H "X-Auth-Token: $API_TOKEN" "$API_URL" | jq -r '.devices[].hostname' > /tmp/devices_list.txt | |
| echo "Device names have been saved to //tmp/devices_list.txt" |
This file contains hidden or 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 required libraries | |
| import dns.resolver # For DNS resolution | |
| from netmiko import ConnectHandler # For SSH connections to network devices | |
| import getpass # For secure password input | |
| # Configuration details for the Cisco device | |
| cisco_device = { | |
| 'device_type': 'cisco_ios', # Specifies that we're connecting to a Cisco IOS device | |
| 'host': '10.1.2.3', # IP address of the Cisco device | |
| } |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """ | |
| Juniper Firmware Transfer Utility | |
| This script performs parallel SCP transfers of firmware files to multiple Juniper devices | |
| and verifies the transfer using MD5 checksums. | |
| Usage: | |
| 1. Install required libraries: | |
| pip install paramiko |
This file contains hidden or 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
| #!/bin/bash | |
| # Array of target Juniper systems | |
| # Replace these with your actual target systems | |
| systems=("10.1.2.3" "juniper2.example.com" "juniper3.example.com") | |
| # Prompt for username and password | |
| # Note: Storing passwords in plain text is not secure. Consider using SSH keys instead. | |
| read -p "Enter your username: " username | |
| read -s -p "Enter your password: " password |
This file contains hidden or 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
| #claud.ai | |
| import subprocess | |
| import ipaddress | |
| import re | |
| def whois_lookup(ip_prefix): | |
| try: | |
| result = subprocess.run(['whois', ip_prefix], capture_output=True, text=True, timeout=10) | |
| return result.stdout | |
| except subprocess.TimeoutExpired: |
NewerOlder