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 asyncio | |
WaitTimeOut = 600 # -w milliseconds | |
PingProbe = 10 # -n | |
PingSize = 65500 # -l | |
## for Mac 'macosx' | |
## PingSize = 8184 # -s plus 8 bytes of ICMP header | |
ParallelPing = 100 # Concurrent ping stream |
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
var IPHosts = ["192.168.13.128"]; | |
var cmdSNMP = '.\\bin\\snmpwalk.exe -v 2c -c public -r 2 -t 1 -Ovqs -M .\\UPSonlyMIBS\\ '; | |
var SNMPBranch = ['.1.3.6.1.2.1.1.3']; | |
//run cscript snmpPoller_007.js | |
function returnMinutesDate () { | |
var today = new Date(); | |
return (today.getFullYear() + "" + (today.getMonth()+1) + "" + today.getDate() + "" + today.getHours() + "" + today.getMinutes()) | |
} |
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
''' | |
C:\Python389\python.exe -m pip install --upgrade pip | |
C:\Python389\Scripts\pip3.8.exe install virtualenv | |
C:\Python389\python.exe -m virtualenv -p="C:\Python389\python.exe" virtenv | |
Activate.bat | |
C:\Python389\Scripts\pip3.8.exe install junos-eznc | |
C:\Python389\python.exe | |
From https://www.juniper.net/documentation/en_US/day-one-books/DO_PyEZ_Cookbook.pdf | |
Recipe 14 - Adding a Graphical Interface to the PyEZ Script by Peter Klimai |
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
strComputer = "." | |
Dim objShell, objWMIService | |
Set objShell = WScript.CreateObject("WScript.Shell") | |
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") | |
Dim colItems, NumS, MemorySize, CPU1, CPU2, ProcessId, strProcess, strProcessKill, MemorySize1, MemorySize2, AverageCPU | |
Wscript.Sleep 10000 | |
strProcessKill = "'TASKMGR.EXE'" | |
Set colItems = objWMIService.ExecQuery("Select * From Win32_Process Where Name = " & strProcessKill) |
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
<!DOCTYPE html> | |
<head> | |
<title>pfiles process port finder</title> | |
<!--<meta http-equiv="x-ua-compatible" content="ie=11"/>--> | |
<!--<meta http-equiv="x-ua-compatible" content="ie=edge" />--> | |
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta charset="UTF-8"> |
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 requests | |
import json | |
import os | |
from datetime import timedelta, date | |
from math import radians, cos, sin, asin, sqrt | |
def haversine(lon1, lat1, lon2, lat2): | |
""" | |
Calculate the great circle distance between two points | |
on the earth (specified in decimal degrees) |
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
#! /usr/bin/python | |
print "\n*********************************************************************" | |
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version" | |
import os | |
import socket | |
import hashlib | |
import struct | |
# get the host id and host name to calculate the hostkey | |
#hostid=os.popen("hostid").read().strip() # for linux | |
hostid=str(os.popen('hostid')).split()[-1][2:-1] # for Mac OSX 10.9.3 Python 2.7.5 |