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
host_conf = ['show ip arp vlan 11', 'show ip arp vlan 12', 'show ip arp vlan 13', 'show ip arp vlan 32', 'show ip arp vlan 50', 'show ip arp vlan 102', 'show ip arp vlan 112', 'show ip arp vlan 145', 'show ip arp vlan 150', 'show ip arp vlan 155', 'show ip arp vlan 160', 'show ip arp vlan 161', 'show ip arp vlan 171', 'show ip arp vlan 172', 'show ip arp vlan 327', 'show ip arp vlan 328', 'show ip arp vlan 331', 'show ip arp vlan 332', 'show ip arp vlan 374', 'show ip arp vlan 380', 'show ip arp vlan 401', 'show ip arp vlan 409', 'show ip arp vlan 433', 'show ip arp vlan 434', 'show ip arp vlan 435', 'show ip arp vlan 436', 'show ip arp vlan 334', 'show ip arp vlan 343', 'show ip arp vlan 403', 'show ip arp vlan 404', 'show ip arp vlan 406', 'show ip arp vlan 447','exit'] | |
# To implement config changes your config would be implemented in list format | |
# host_conf = ['config t', 'interface lo10', 'description TEST-CONFIG-SCRIPT-3', 'end', 'show run int loop 10'] |
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
# | |
# | |
# add your configurations in a list format | |
# | |
host_conf = ['config t', 'interface lo10', 'description TEST-CONFIG-SCRIPT-3', 'end', 'show run int loop 10'] |
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
- name: configure cisco routers | |
hosts: routers | |
connection: ansible.netcommon.network_cli | |
gather_facts: no | |
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
#wage | |
name1_wage = <> | |
name2_wage = <> | |
name3_wage = <> | |
name4_wage = <> | |
#overtime wage | |
name1_ot = (name1_wage/2) + name1_wage | |
name2_ot = (name2_wage/2) + name2_wage | |
name3_ot = (name3_wage/2) + name3_wage |
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/python3 | |
#(c) 2020 Todd Riemenschneider | |
# | |
#Enable Multiprocessing | |
from multiprocessing import Pool | |
#getpass will not display password | |
from getpass import getpass | |
#ConnectionHandler is the function used by netmiko to connect to devices | |
from netmiko import ConnectHandler | |
#Time tracker |
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
#Trying to understand the benefit of this method of writing to a file... | |
def main(): | |
fname = input("Enter filename: ") | |
dfname = input("Destination Filename: ") | |
infile = open(fname, "r") | |
outfile = open(dfname, "a") | |
data = infile.read() | |
print(data) | |
infile.close() |
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
#Comparing write method to print method to writing to file. | |
def main(): | |
fname = input("Enter filename: ") | |
dfname = input("Destination Filename: ") | |
infile = open(fname, "r") | |
with open(dfname, "a") as f: | |
data = infile.read() | |
infile.close() |
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 keyword | |
def kw_count(): | |
a = 0 | |
for kw in keyword.kwlist: | |
a+=1 | |
print(f"{a} ", kw) | |
kw_count() |
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
/* | |
Specify a number of pushups you want to do in a set. | |
Every 30 secs do another set - 1 rep. Repeat until you reach 0. | |
This program will calculate how many pushups you do in total | |
*/ | |
package main | |
import ( | |
"fmt" |
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
#sample Source List | |
ip_address = ["10.0.0.1", "10.0.0.1", "10.0.0.2", "12.0.3.1", "10.9.0.1", "12.0.1.1", "10.0.0.2"] | |
ip_counts = {ip: ip_address.count(ip) for ip in set(ip_address)} | |
for ip, count in ip_counts.items(): | |
if count > 1: | |
print(f"Dup IP:{ip} number of dup hosts {count}") | |
else: | |
continue |
NewerOlder