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
#!/bin/bash | |
# | |
# Jeff Loughridge | |
# July 2014 | |
# jeffl at brooksconsulting-llc.com | |
# This script provides an example of setting up IPv6 static | |
# ND proxy entries. Edit the V6_START to match | |
# what you see in the DO control panel |
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/python | |
""" | |
To use this to mimic the EC2 metadata service entirely, run it like: | |
# where 'eth0' is *some* interface. if i used 'lo:0' i got 5 second or so delays on response. | |
sudo ifconfig eth0:0 169.254.169.254 netmask 255.255.255.255 | |
sudo ./mdserv 169.254.169.254:80 | |
Then: | |
wget -q http://169.254.169.254/latest/meta-data/instance-id -O -; echo | |
curl --silent http://169.254.169.254/latest/meta-data/instance-id ; echo |
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
#!/bin/bash | |
# | |
function get_ip { | |
# Obtain the IPv4 or IPv6 address | |
VERSION=$1 | |
# Use arp to find the IP address you're looking for via its MAC address: | |
IP=$(ip -$VERSION neighbor show | grep $MAC_ADDRESS | awk '{ print $1 }' ) |
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/env snabbswitch | |
local app = require("core.app") | |
local config = require("core.config") | |
local pcap = require("apps.pcap.pcap") | |
local link = require("core.link") | |
local RawSocket = require("apps.socket.raw") | |
local c = config.new() | |
config.app(c, "capture", pcap.PcapReader, "input.pcap") |
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/env python | |
from jnpr.junos import Device | |
def build_dict(xml): | |
jflow = {} | |
# 1st entry in xml is <inline_jflow_flow_information> | |
inline_jflow_flow_information = xml[0] |
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/env python | |
import yaml | |
from jnpr.junos.factory.factory_loader import FactoryLoader | |
from jnpr.junos import Device | |
yml = ''' | |
--- | |
RsvpTable: | |
rpc: get-rsvp-session-information |
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/env python | |
import sys | |
from jnpr.junos.utils.config import Config | |
from jnpr.junos import Device | |
from jnpr.junos.exception import * | |
jdev = Device(user='jeffl', host='10.10.10.1', password='pass123') | |
jdev.open(gather_facts=False) |
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
version 1.0; | |
ns junos = "http://xml.juniper.net/junos/*/junos"; | |
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm"; | |
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; | |
import "../import/junos.xsl"; | |
match / | |
{ | |
<op-script-results> { |
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 NameCheck import NameChecker | |
class NameCheckLibrary(): | |
def __init__(self): | |
self._namechecker = NameChecker() | |
self._name = None | |
self._result = None | |
def Set_name(self, name): |
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/env python | |
class NameChecker(object): | |
def __init__(self): | |
self._name = None | |
def set_name(self, name): | |
self._name = name |
OlderNewer