Skip to content

Instantly share code, notes, and snippets.

View networkop's full-sized avatar
🙏

Michael Kashin networkop

🙏
View GitHub Profile
class TraceParse(object):
def __init__(self, module):
self.std_out = module.params['std_out']
self.dest_host = module.params['dest_host']
def parse(self):
result = {}
path = list()
for line in self.std_out.split("\n"):
@networkop
networkop / README.md
Created September 16, 2018 09:59 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@networkop
networkop / batfish.py
Last active September 27, 2018 12:50
Network-CI 3
# Get the list of all BGP sessions for leaf switches
bgp = bfq.bgpSessionStatus(nodes='leaf.*', includeEstablishedCount=True).answer().frame()
# All leaves should only peer with spines
non_spines = bgp[~bgp['Remote_Node'].str.contains('spine', na=False)]
# Assuming Leaf-2 and Leaf-3 peer with each other
print(non_spines)
Node Local_IP VRF Local_Interface Remote_Node Remote_Prefix Session_Type Configured_Status Established_Neighbors
0 leaf-2 1.1.1.2 default leaf-2:Loopback0 leaf-3 1.1.1.3/32 EBGP_MULTIHOP UNIQUE_MATCH 0
5 leaf-3 1.1.1.3 default leaf-3:Loopback0 leaf-2 1.1.1.2/32 EBGP_MULTIHOP UNIQUE_MATCH 0
@networkop
networkop / connect.sh
Created March 19, 2019 14:19
cvp-netsim
kubectl exec -it acme-dc1s1001-a bash
sh-4.2# telnet localhost 23
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
acme-dc1s1001-a login:
@networkop
networkop / kubernetes.go
Created December 9, 2020 21:45
coredns-headless
func (k *Kubernetes) findServices(r recordRequest, zone string) (services []msg.Service, err error) {
idx := r.service + "." + r.namespace
serviceList = k.APIConn.SvcIndex(idx)
for _, svc := range serviceList {
if svc.ClusterIP == api.ClusterIPNone || r.endpoint != "" {
for _, ep := range endpointsList {
for _, eps := range ep.Subsets {
for _, addr := range eps.Addresses {
for _, p := range eps.Ports {
s := msg.Service{Host: addr.IP, Port: int(p.Port), TTL: k.ttl}
@networkop
networkop / bash
Last active July 26, 2021 21:12
cilium-logs
level=error msg="Command execution failed" cmd="[tc filter replace dev lxc124b240e531e ingress prio 1 handle 1 bpf da obj 1743_next/bpf_lxc.o sec from-container]" error="exit status 1" subsys=datapath-loader
level=warning subsys=datapath-loader
level=warning msg="Prog section 'from-container' rejected: Argument list too long (7)!" subsys=datapath-loader
level=warning msg=" - Type: 3" subsys=datapath-loader
level=warning msg=" - Attach Type: 0" subsys=datapath-loader
level=warning msg=" - Instructions: 3609 (0 over limit)" subsys=datapath-loader
level=warning msg=" - License: GPL" subsys=datapath-loader
level=warning subsys=datapath-loader
level=warning msg="Verifier analysis:" subsys=datapath-loader
level=warning subsys=datapath-loader