Skip to content

Instantly share code, notes, and snippets.

View AJNOURI's full-sized avatar
💭
I may be slow to respond.

AJ NOURI AJNOURI

💭
I may be slow to respond.
View GitHub Profile
@awfki
awfki / pynetbox_examples.md
Last active November 16, 2023 22:19
pynetbox examples

pynetbox examples

Long time network engineer, did some perl a long time ago and am liking python pretty well but the pynetbox documentation is badly lacking IMO. If I were a python wizard I'm sure it would all be obvious but I'm not and it's really frustrating that more example weren't provided.

Many of the following examples were cadged from various places on the interwebs and HAVE NOT BEEN TESTED.

Prereqs

import pynetbox
NETBOX = 'https://netbox.fq.dn/'
nb = pynetbox.api(NETBOX, get_token('nb'))
description: "Stack built by the yardstick framework for michal on host devel 2016-02-16\
\ 21:03:33.\n All referred generated resources are prefixed with the\
\ template\n name (i.e. demo)."
heat_template_version: '2013-05-23'
outputs:
ares.demo:
description: VM UUID
value: {get_resource: ares.demo}
ares.demo-test-port:
description: Address for interface ares.demo-test-port
@plucena24
plucena24 / gns3_config_generator.py
Last active November 26, 2018 13:27
Automatically generate and apply basic IP addressing config for a GNS3 dynamips topology.
'''
GNS3_auto_ip_script
author: plucena24@gmail.com
Automatically generate and apply basic IP addressing config for a GNS3 dynamips topology.
Example: a network consisting of R1---R2---R3.
Using the script, the links will be numbered as:
@roblayton
roblayton / Vagrantfile
Created June 27, 2015 22:46
A Vagrant multi-machine cluster using a loop
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
cluster = {
"master" => { :ip => "192.168.33.10", :cpus => 1, :mem => 1024 },
"slave" => { :ip => "192.168.33.11", :cpus => 1, :mem => 1024 }
}
@toast38coza
toast38coza / commands
Last active March 3, 2022 11:30
Simple systemd unit for running a django app
# start / stop / restart / status
systemctl start test
systemctl stop test
systemctl restart test
systemctl status test
# logs use journalctl:
# tail the logs for unit `django`
journalctl -f -u django
@ymmt2005
ymmt2005 / github.py
Created September 11, 2012 13:05
GitHub v3 API client in Python
#!/usr/bin/env python
'''
GitHub API v3 client.
@see http://developer.github.com/v3/
@see https://support.enterprise.github.com/entries/21391237-using-the-api
'''
from argparse import ArgumentParser, REMAINDER
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},