Skip to content

Instantly share code, notes, and snippets.

View netopsengineer's full-sized avatar

Joshua netopsengineer

  • USA
View GitHub Profile
@cidrblock
cidrblock / parser_defintion.yml
Created April 13, 2022 10:14
Parse output using native parser
x1 ➜ collection_development ansible-navigator run parse.yml -m stdout --ee false
PLAY [localhost] ***************************************************************
TASK [Define some data] ********************************************************
ok: [localhost]
TASK [Pass text and template_path] *********************************************
ok: [localhost]
@cidrblock
cidrblock / site.yml
Created April 12, 2022 20:17
Validate IPv4 address in lists of interfaces
- hosts: localhost
gather_facts: false
tasks:
- name: Define some data
ansible.builtin.set_fact:
data:
wan:
- name: LAN3
ipv4-address: 100.100.100.1
subnet-mask: 255.255.255.248
@ganeshrn
ganeshrn / sample_choices.py
Created March 15, 2022 07:30
Case insenstive choice example
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
module: sample_choices
short_description: Demo case insensitive choices.
description:
- Demo case insensitive choices.
@jhk75
jhk75 / pdu_snmp_get.py
Last active February 28, 2023 14:52
10.02.2022
#work 09.02.2022
import csv
from pysnmp.entity.rfc3413.oneliner import cmdgen
# Open the file with ips
myfile = open("pdu_list.txt", "r").read().splitlines()
myfile = list(myfile)
print(myfile)
@krishnaprasanthg
krishnaprasanthg / cisco-api.py
Created August 16, 2021 12:25
Cisco services api usage
import os
from itertools import chain
import requests
from dotenv import load_dotenv
load_dotenv()
class CiscoAPIConsole(object):
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active October 22, 2025 20:29
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@craigarms
craigarms / cisco_ios_upgrade.yml
Last active February 3, 2025 21:35
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/"
@thetonus
thetonus / download.py
Last active October 18, 2022 15:29
Download file with Asyncio and Aiofiles
import asyncio
import os
from typing import List
import aiofiles
import httpx
async def download(client: httpx.AsyncClient, link: str, filename: str) -> None:
""" Download link """
@niw
niw / Vagrantfile
Last active October 30, 2025 02:03
A simple Vagrantfile to setup Ubuntu desktop environment with Google Chrome and Japanese input
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider :virtualbox do |v|
v.gui = true
v.memory = 2048
end
# Currently "ubuntu/bionic64" on VirtualBox requires `type: "virtualbox"`
# to make synced folder works.
@dmfigol
dmfigol / dict_to_xml.py
Last active February 4, 2023 21:48
Convert Python dictionary to NETCONF XML payload
from typing import Any, Union, Optional
from lxml import etree
__license__ = "MIT"
# Feel free to re-use the code snippet for any projects without attribution
def dict_to_xml(
data: Any, root: Union[None, str, etree._Element] = None, attr_marker: str = "_"
) -> etree.Element:
"""Converts Python dictionary with YANG data to lxml etree.Element object.