Skip to content

Instantly share code, notes, and snippets.

View sulrich's full-sized avatar
🙀
furble plotz

steve ulrich sulrich

🙀
furble plotz
View GitHub Profile
#!/bin/bash
if [ "$1" = "" ]
then
cat <<EOFUSAGE
usage:
case-blurb <case-number> - where the case-number is a whitespace-free string
EOFUSAGE
#!/usr/bin/env python3
import radix
import ipaddress
rtree = radix.Radix()
test_addrs = [
"10.0.0.0/24",
"10.0.1.0/24", # should form a /23 w/the above
#!/bin/bash
help() {
cat << EOF
available functions:
EOF
sed -n "s/^##//p" "$0" | column -t -s ":" | sed -e "s/^/ /"
}
if [[ $# -lt 1 ]]; then

demystifying the placement of group variables

group_var integration appears be within the order listed below. there does seem to be merging (or at least non-overlapping variable unions). but if there's an overlap in values within the group_vars evaluation order, the first hit seems to be the one that gets applied. in the case of my test variable (ansible_user) whatever's defined in the $playbook-dir/group_vars directory, seems to hold particularly tight. even tighter than specifying the user in the ansible-playbook command. so if you're trying to be clever by overriding something within your local project directory, think again.

@sulrich
sulrich / gnmic-use-notes.md
Last active March 21, 2021 15:20
random arista gnmi / gnmic notes

getting show commands via gnmi

most/lots of our show commands are json framed (you can check this from the cli by piping the command through |json from the CLI. this is also what we effectively expose via eAPI. this also also accessible via gnmi. you just feed the command in with the origin set to cli. note, the syntax w/gnmic is a little janky, but you get the idea.

krusty(~)% gnmic -a 192.168.1.21:6030 -u admin -p arista --insecure \
 get --path "cli:/show version"
Get Response:
[
  {
#!/bin/bash
# management bridge (mgmt0 - 10.0.0.254/24)
sudo ovs-vsctl add-br mgmt0
sudo ovs-vsctl add-port mgmt0 sulrichR1Lx1
sudo ovs-vsctl add-port mgmt0 sulrichR2Mgmt1
sudo ovs-vsctl add-port mgmt0 sulrichR3Lx1
sudo ovs-vsctl add-port mgmt0 sulrichR4Lx1
sudo ovs-vsctl add-port mgmt0 sulrichR5Lx1
sudo ovs-vsctl add-port mgmt0 sulrichR6Lx1
#!/bin/bash
# R1 - cisco: IOS-XRv-9K
sudo qemu-system-x86_64 \
-smbios type=1,manufacturer="cisco",product="Cisco IOS XRv 9000" \
-drive file=${HOME}/topo/images/r1-iosxrv.qcow2,if=virtio,media=disk,index=1 \
-pidfile ${HOME}/topo/pids/r1.pid \
-cpu host \
-m 8G \
-smp cores=4,threads=1,sockets=1 \

Keybase proof

I hereby claim:

  • I am sulrich on github.
  • I am sulrich (https://keybase.io/sulrich) on keybase.
  • I have a public key ASAeuRlmnjpfKCWYbHilxgQVo14LzvU7-Dep-MDdNvfDdQo

To claim this, I am signing this object:

@sulrich
sulrich / shairport-sync.conf
Last active December 20, 2018 22:44
shairport-sync.conf - keep it simple
// hifi-pi.local. - shairport-sync config
// general settings
general = {
name = "%h";
// This means "Hostname" -- see below. This is the name the service will advertise to iTunes.
// The default is "Hostname" -- i.e. the machine's hostname with the first
// letter capitalised (ASCII only.) You can use the following substitutions:
// %h for the hostname,
// %H for the Hostname (i.e. with first letter capitalised (ASCII only)),
// %v for the version number, e.g. 3.0 and