View check_website.py
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 smtplib | |
from email.mime.text import MIMEText | |
# Website Checker: Compares the number of <keyword> mentions to a static value and notifies of changes by email | |
url = 'www.example.com' | |
header = {'User-Agent': 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0'} | |
keyword = 'example' |
View diagrams.csv
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 7.
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
## diagrams.net via CSV example | |
## Menu: Arrange > Insert > Advanced > CSV | |
## | |
# label: %step% | |
# style: rounded=1;fillColor=%fill%; | |
# namespace: csvimport- | |
# connect: {"from":"refs", "to":"id", "invert":true, "style":"curved=0;endArrow=blockThin;endFill=1;"} | |
# padding: 15 | |
# ignore: id,fill,refs | |
# layout: auto |
View main.py
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
from fastapi import FastAPI, Form | |
import requests, json | |
SLACK_VERIFICATION_TOKEN = "OnLmGpOwclDyXMNuNSRI5HAQ" | |
APIC_URL = 'sandboxapicdc.cisco.com' | |
APIC_USERNAME = 'admin' | |
APIC_PASSWORD = 'ciscopsdt' | |
def apic_login(apic: str, username: str, password: str) -> dict: | |
""" APIC login and return session cookie """ |
View ise.yml
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
# REST-Call to provision new device with Cisco ISE for TACACS access | |
# | |
# The 'NetworkDeviceGroupList' in the request body needs to be adapted to your environment, or substituted with variables. | |
--- | |
- name: ISE | |
hosts: test_switch | |
gather_facts: false | |
connection: network_cli | |
vars: |
View apic_query.py
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, json | |
apic_url = 'sandboxapicdc.cisco.com' | |
apic_username = 'admin' | |
apic_password = 'ciscopsdt' | |
def apic_login(apic: str, username: str, password: str) -> dict: | |
""" APIC login and return session cookie """ | |
apic_cookie = {} | |
credentials = {'aaaUser': {'attributes': {'name': apic_username, 'pwd': apic_password }}} |
View grafana_ping_panel.json
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
{ | |
"aliasColors": {}, | |
"dashLength": 10, | |
"datasource": "InfluxDB", | |
"fieldConfig": { | |
"defaults": { | |
"custom": {}, | |
"links": [] | |
}, | |
"overrides": [] |
View syslog_nxos.yml
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
# Syslog configuration with Cisco NX-OS devices | |
# | |
# Usage: ansible-playbook -k -u <cli_user> syslog_nxos.yml | |
# Specify the syslog servers in the 'vars:' section of the playbook header. | |
--- | |
- name: Ensure desired state - syslog server | |
hosts: all | |
gather_facts: false | |
connection: network_cli |