Skip to content

Instantly share code, notes, and snippets.

@craigarms
craigarms / chatgpt_sequence_diagram_3.py
Last active January 15, 2024 16:26
ChatGPT Corrected Sequence Diagram FInal
from graphviz import Digraph
# Create a Digraph from the DOT content
graph = Digraph(format='png')
graph.attr(dpi='300')
graph.attr(size='8,5')
graph.node_attr.update(color='lightblue2', style='filled')
graph.attr('node', shape='box', fontname="Arial", style='filled, rounded', fillcolor='#e2e2f0')
graph.node('b_start', label='Bob')
@craigarms
craigarms / chatgpt_sequence_diagram_2.py
Created January 15, 2024 16:17
ChatGPT Sequence Diagram Corrected
from graphviz import Digraph
graph = Digraph(format='png')
graph.attr(dpi='300')
graph.attr(size='8,5')
graph.node_attr.update(color='lightblue2', style='filled')
graph.attr('node', shape='box', fontname="Arial", style='filled, rounded', fillcolor='#e2e2f0')
graph.node('b_start', label='Bob')
graph.node('b_0', label='', shape='point', height='0')
@craigarms
craigarms / chatgpt_sequence_diagram.py
Created January 15, 2024 15:43
ChatGPT Generated Sequence Diagram for Blog Article
from graphviz import Digraph
dot_content = '''
digraph {
splines=false
node [shape=box
fontname="Arial"
style="filled, rounded"
fillcolor="#e2e2f0"]
@craigarms
craigarms / cisco_device_backup.yml
Created February 19, 2020 09:47
Ansible playbook to Idempotently retrieve and backup information from Cisco Devices
---
- hosts: sw_ios
gather_facts: false
connection: local
tasks:
- name: save config
ios_command:
commands:
- write mem
@craigarms
craigarms / cisco_reload_switches.yml
Created February 17, 2020 11:30
Ansible Playbook to reload Cisco Switches and verify the version is at the target
---
- hosts: sw_ios
gather_facts: false
models:
"WS-C2960XR-48FPD-I":
ios_version: "15.2(7)E0a"
ios_path: "IOS/"
ios_archive: "c2960x-universalk9-tar.152-7.E0a.tar"
ios_binary: "c2960x-universalk9-mz.152-7.E0a.bin"
ios_md5: "07195a8c7866ac2a91c64b716465c516"
@craigarms
craigarms / cisco_ios_upgrade.yml
Last active March 5, 2024 13:39
Ansible Playbook for loading IOS to cisco Device Flash and copying to other stack members
---
- hosts: enterprise_l2
gather_facts: false
connection: local
vars:
models:
"WS-C2960XR-48FPD-I":
ios_version: "15.2(7)E0a"
ios_path: "IOS/"