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 time, random | |
class StopWatch(): | |
def __init__(self): | |
self.started = 0.0 | |
self.stopped = 0.0 | |
self.elapsed = 0.0 | |
def reset(self): | |
self.__init__() | |
def start(self): |
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
# CIDR Notation to Regex Tool | |
# Original: http://d.xenowire.net/cidr2regex.php | |
# Converted to Python by 112buddyd | |
def cidr_to_regex(cidr): | |
import re | |
# Validation | |
cidr_regex = r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' | |
if not re.match(cidr_regex, cidr): |
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 sqlite3, os, subprocess, datetime, sys, logging, time | |
from multiprocessing.pool import ThreadPool | |
from tqdm import * | |
def welcome(): | |
print('\n') | |
print('╔═══╦══════════════════════════════╦═══╗') | |
print('║ ║ pollengine.py ║ ║') | |
print('║ ║ created by 112buddyd ║ ║') | |
print('║ ║ 2015-12-04 // v0.1 ║ ║') |
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 sqlite3, datetime, subprocess, time | |
from multiprocessing.pool import ThreadPool | |
class Device(object): | |
instances = [] | |
def __init__(self, id, hostname, type, ip, subnet, building, online, last_seen): | |
self.id = id | |
self.hostname = hostname | |
self.type = type | |
self.ip_address = ip |
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 time, threading, paramiko, getpass, logging, sys, datetime | |
from multiprocessing.pool import ThreadPool | |
""" | |
To Do: | |
-Settings file, stores number of threads and debug levels | |
-In get_creds, attempt to login to one device to test credentials instead of many and locking account. | |
-Change reporting at end to declare successful devices and failed devices. | |
""" |
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 paramiko, scp | |
from tkinter import * | |
from tkinter import ttk | |
from netmiko import ConnectHandler | |
win = Tk() | |
win.wm_title('Config Pusher v0.00001') | |
#frames | |
userFrame = Frame(win, width = 400, height=80) |
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
# EasyChallenge 7 - reddit.com/r/dailyprogrammer | |
# Convert morse code | |
# 10 AUG 2015 | |
# Created a dictionary of Letter : Morse | |
morse = { | |
'A' : '.-', 'B' : '-...', 'C' : '-.-.', | |
'D' : '-..', 'E' : '.', 'F' : '..-.', | |
'G' : '--.', 'H' : '....', 'I' : '..', | |
'J' : '.---', 'K' : '-.-', 'L' : '.-..', |