Skip to content

Instantly share code, notes, and snippets.

@mwiget
mwiget / say-hello.py
Last active May 18, 2017 08:12
fetch Junos op script from URL at startup
'''
Configure script in Junos:
set system scripts op file say-hello.py
set system scripts language python
Create an event-policy that gets triggered during startup to fetch me:
set event-options policy fetch-my-scripts events JTASK_TASK_BEGIN
set event-options policy fetch-my-scripts then execute-commands commands "request system scripts refresh-from op file say-hello.py url https://gist.githubusercontent.com/mwiget/5f77416cce02e5e3eaa9bae17fb98289/raw/3db9f896383d8fe8ca087ed1a336bfb33854095f/say-hello.py"
'''
@mwiget
mwiget / getconfig.py
Created August 11, 2017 11:45
getconfig via grpc response limit
__author__ = ""
__copyright__ = "Copyright (c) 2017 Juniper Networks, Inc."
import os
from grpc.beta import implementations
import op.protos.authentication_service_pb2 as authentication_service_pb2
import op.protos.openconfig_service_pb2 as openconfig_service_pb2
import common.app_globals
import json
@mwiget
mwiget / launch-docker-container.sh
Created February 22, 2018 08:17
Launch Docker containers like native apps with current directory (rw) mounted
#!/bin/sh
name=$(basename $0)
if [ $name == "launch-docker-container" ]; then
cat <<EOF
$0
please link this script to the container image you like to run
e.g. to launch latest alpine image with the current working directory mounted:
@mwiget
mwiget / xmlproxyd_sysusers.yang
Last active March 4, 2018 17:29
User-defined Junos Telemetry Interface YANG file to stream 'show system users'
/*
Example yang for generating OC equivalent of show system users
Requirements:
Junos Openconfig and na telemetry packages loaded:
- junos-openconfig-x86-32-0.0.0.8.tgz
- network-agent-x86-32-17.4R1.16-C1.tgz
Installation:
1) Load this file in Junos (17.3R1 or newer) with
/*
* Example yang for generating OC equivalent of internal meta tree
save as "xmlproxyd_krtState.yang" on router.
cli : show krt state
*/
module krtState {
yang-version 1;
namespace "http://juniper.net/yang/software";
@mwiget
mwiget / install_pktgen.sh
Last active July 23, 2021 12:01
compile pktgen with lua
#!/usr/bin/bash
dpdk_version=21.05
pktgen_version=21.05.0
DPDK_VER=$dpdk_version
PKTGEN_VER=$pktgen_version
export RTE_TARGET=x86_64-native-linuxapp-gcc
export RTE_SDK=$PWD/dpdk-$DPDK_VER
echo DPDK_VER=${DPDK_VER}
echo PKTGEN_VER=${PKTGEN_VER}
@mwiget
mwiget / lb.yaml
Last active March 20, 2022 20:37
lb-ike-4500
apiVersion: v1
kind: Service
metadata:
annotations:
cloud.google.com/neg: '{"ingress":true}'
name: lb
namespace: ves-system
spec:
externalTrafficPolicy: Local
ports:
@mwiget
mwiget / README.md
Last active June 21, 2023 12:19
Deploy F5 XC Kubernetes CE Pod on Openshift 4.10 using Redhat Assisted Installer (SaaS)

Deploy Kubernetes CE on Openshift 4.10

Redhat Openshift provides a matrix showing what Kubernetes API version is supported with each OpenShift 4.x release: https://access.redhat.com/solutions/4870701

F5 XC uses Kubernetes API v1.23 when this document was created. This matches with OpenShift 4.10.

Instructions to deploy OpenShift using Redhat can be found in this excellent Blog from James Wilkins: "Installing OpenShift with Assisted Installer" at https://jameswilkins.co.uk/install-openshift/