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/Python3 | |
| import warnings | |
| warnings.filterwarnings("ignore") | |
| import google.generativeai as genai | |
| google_api_key='<InsertYourAPIKey>' | |
| genai.configure(api_key=google_api_key) | |
| model = genai.GenerativeModel('gemini-2.0-flash') |
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/python3 | |
| ''' | |
| Script to display all the Status information on the Cotek Inverter | |
| Tested with https://www.cotek.com.tw/sc-1200-1200w | |
| 4800Baud and 3 pin serial, so TXD, RXD and GND. | |
| ''' | |
| #*********** | |
| # Version 1.0 - 10-27-25 -- J. Georges | |
| #*********** |
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 python | |
| # -*- coding: utf-8 -*- | |
| # updated Jan 2021. Looks like noipy is requiring an IP on the command line now. | |
| # added two methods to determine IP in case the first method fails. | |
| # | |
| ''' | |
| Script / Daemon to watch external IP and if it changes, send a slack message | |
| ''' | |
| from requests import get |
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 | |
| ''' | |
| Get DHCP bindings sorted. | |
| Make sure you use an account that has JUNOS CLI as the shell; not root. | |
| ''' | |
| # Version 1.0 - 1-11-2021 - Jeremy Georges | |
| # | |
| # Reason for this script, is currently JUNOS on SRX platforms does NOT have | |
| # very good logging for DHCP server address bindings. In ScreenOS, every DHCP |
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 | |
| # Idea here is to run in /mnt/flash/rc.eos | |
| # General Logic | |
| # check to see if veos-config exists. | |
| # if it does, then parse and see if a serial number is set correctly based on ma1 interface mac address. | |
| # if not, then set serial number based on ma1 mac address since this is up at the time that rc.eos is executed. | |
| # if file does not exist...this is easy, just create veos-config file with serial number set. | |
| # We could create an allowance to not change the SERIALNUM variable even if it does not match. Just rem out the sed command |
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 python | |
| """ | |
| Needed this to delete my lab PG and vSwitch stuff... | |
| I create a lot of temporary Port Groups and vSwitches for lab testing and need a way to quickly delete them. | |
| Idea here is to use a prefix naming convention for all PGs and vSwitches based on projects. We just use a regex based | |
| on that prefix to determine whether or not we delete this PG and vSwitch. | |
| """ | |
| from __future__ import print_function | |
| from pyVim.connect import SmartConnectNoSSL, Disconnect | |
| from pyVmomi import vim |
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
| from threading import Timer | |
| # There are other ways to do this, such as use sudo with -n switch so it doesn't prompt for | |
| # a user name. But the frame work for timer and Popen is useful for other use cases. | |
| def RebootSystem(): | |
| ''' | |
| reboot system | |
| user needs rights for this though. | |
| Just to be safe, we'll have a timeout. | |
| ''' | |
| proc=sp.Popen(["sudo","reboot", "now"], shell=False) |
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 python | |
| ''' | |
| Example of how to check for a process that is running and return something. | |
| In this example, just checking to see if ffmpeg is running | |
| ''' | |
| import subprocess as sp | |
| try: |
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 python | |
| # Basic Script to authenticate to Arista Cloudvision (CVP) and get all device | |
| # running configs. | |
| import json | |
| import requests | |
| import urllib3 |
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 python | |
| #Basic Script to authenticate to Arista Cloudvision (CVP) and list all device | |
| #data. | |
| import json | |
| import requests | |
| import urllib3 |
NewerOlder