Skip to content

Instantly share code, notes, and snippets.

@hellt
hellt / pycatjify.js
Last active July 29, 2019 08:29
javascript portion of the pycatjify web service
$(function () {
$('#convert_btn').click(function () {
var data = {} // object to hold the user input data
// store user data in a data["pycatj_data"]
if ($('#yaml_switch').prop("checked")) {
data["pycatj_data"] = $('#in_form').val() // in case of YAML data - store it as a string
} else {
data["pycatj_data"] = JSON.parse($('#in_form').val()) // in case of JSON data - store it as an object
}
<data>
<state xmlns="urn:nokia.com:sros:ns:yang:sr:state">
<router>
<router-name>Base</router-name>
<isis>
<isis-instance>0</isis-instance>
<oper-system-id>0110.1101.1011</oper-system-id>
<oper-router-id>11.11.11.11</oper-router-id>
<db-export-igp-asn>0</db-export-igp-asn>
<oper-state>up</oper-state>
<domain type='kvm' id='254'>
<name>PE-1-SR</name>
<uuid>af76b9d5-8bab-4156-b013-ec00968117f9</uuid>
<description>Timos VM</description>
<memory unit='GiB'>6</memory>
<currentMemory unit='GiB'>6</currentMemory>
<vcpu placement='static'>2</vcpu>
<resource>
<partition>/machine</partition>
</resource>
@hellt
hellt / nsp-curl.sh
Last active March 19, 2020 19:03
nsp-curl
while [ $# -gt 0 ]; do
case "$1" in
# IP address or the domain name of the NSP server (without http(s) schema)
--nsp_url=*)
NSP_URL="${1#*=}"
;;
# http proxy which will be used by curl if set
--proxy=*)
HTTP_PROXY="${1#*=}"
;;
{
"response": {
"data": {
"network": {
"UUID_1": {
"key1": "val1",
"key2":{
"UUID_3": {
"key3": "val3"
}
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<card>
<slot-number>1</slot-number>
<mda>
<mda-slot>1</mda-slot>
<mda-type>s36-100gb-qsfp28</mda-type>
</mda>
<fp>
<fp-number>1</fp-number>
</fp>
@hellt
hellt / yang.txt
Created May 18, 2020 07:20
yang tree example
| | | +--rw ipv4
| | | | +--rw multicast? boolean
| | | | +--rw apply-groups* -> ../../../../../groups/group/name
| | | | +--rw monitor-oper-group
| | | | +--rw name? -> ../../../../../../service/oper-group/name
| | | | +--rw operation? enumeration
| | | | +--rw priority-delta? uint32
| | | +--rw ipv6
| | | | +--rw multicast? boolean
| | | | +--rw apply-groups* -> ../../../../../groups/group/name
@hellt
hellt / R1_nokia.cfg
Created June 17, 2020 10:04
R1 Nokia baseline config
# TiMOS-B-14.0.R4 both/i386 Nokia 7750 SR Copyright (c) 2000-2016 Nokia.
# All rights reserved. All use subject to applicable license agreements.
# Built on Thu Jul 28 17:26:53 PDT 2016 by builder in /rel14.0/b1/R4/panos/main
# Generated SUN MAR 13 06:28:52 2016 UTC
exit all
configure
#--------------------------------------------------
echo "System Configuration"
@hellt
hellt / R2_baseline.cfg
Created June 17, 2020 10:05
R2 Juniper baseline config
## Last changed: 2016-11-06 18:41:14 UTC
version 14.1R1.10;
system {
host-name R2;
root-authentication {
encrypted-password "****"; ## SECRET-DATA
}
syslog {
user * {
any emergency;