How long did the function run in Go

Go (Golang) is fast. This phrase is everywhere. It’s always interesting how long it takes a function to finish its operation. Here is an example of a helper function, that could be used to check and log the timing: func TimeTrack(start time.Time, name string) { elapsed := time.Since(start) log.Printf("%s took %s", name, elapsed) } It takes a start time and the name (could be a function name) as parameters. Use it with the “defer” statement inside the functions:...

July 1, 2022 · 1 min · Dmitry Golovach

Postman Environment Variables

Using Environment in Postman is one of the best things that we can use during the testing and while playing around with API. Postman makes this development phase much easier. API is getting more to the token-centric authentication and Environment Variable becomes handy. I will use Cisco Sandbox for my examples, that is one of the great ways to get some practice with Cisco products API. Setting up Postman Environment Variables:...

February 3, 2022 · 1 min · Dmitry Golovach

Python Unit Test

Unit Test A unit test verifies that one specific aspect of a function’s behavior is correct. If we have a main file with functions or just a file with functions we want to test different use cases, it is easier to use unittest rather then change the script and run it every time. Here us a function func_to_print_full_name in the func_file.py file: def func_to_print_full_name(first, last): full_name = first + ' ' + last return full_name Create a file (test_func....

December 16, 2021 · 2 min · Dmitry Golovach

Web: HTML - Select vs Datalist

Just found an interesting tag - , which allows to provide the list with options for user to select. I remember while building my web application I used select options and generated the list from some source. How it works with : <form> <div> <input name="country" list="countries" placeholder="Country"> <datalist id="countries"> <option value="Afghanistan"> <option value="Albania"> <option value="Algeria"> <option value="Andorra"> ... </datalist> </div> </form> Found the explanation: element - user must select one of the provided options element - it’s only the list with suggestions, but user can enter anything With <datalist> I can enter anything in there:...

December 8, 2020 · 1 min · Dmitry Golovach

\U0001F40D Python Logging

I decided to take a look into Python Logging and start using it instead of print(). Everything is here: Logging HOWTO. Task you want to perform The best tool for the task Display console output for ordinary usage of a command line script or program print() Report events that occur during normal operation of a program (e.g. for status monitoring or fault investigation) logging.info() (or logging.debug() for very detailed output for diagnostic purposes)...

May 26, 2020 · 3 min · Dmitry Golovach

CiscoChampion 2020

Thrilled to be selected as a CiscoChampion for the first time! Great way to start off 2020!💥

January 6, 2020 · 1 min · Dmitry Golovach

Linux on Windows, Python IDE, and VirtualEnv

Linux on Windows For some tasks, it is still easier to use Windows (Cisco IP Communicator, UCCX Script Editor, CUCM RTMT, etc.), but there is an option to include Linux into the workflow. Recently I discovered the WLS: Windows Subsystem for Linux (WSL), which allows us to install and run sort of Linux on Windows10 side-by-side. Go to Microsoft Store and search for Linux: Get, Install and Launch: Set username and password and you are in Linux:)...

January 2, 2020 · 2 min · Dmitry Golovach

Python: Script structure

I decided to make some Python notes. Since there is a ton of information about Python, these notes will be mostly for my reference but if they help anyone - it will be great. The best way to understand it - try it and make a note:) starting with the basic script structure: starting with the basic script structure: #!/usr/bin/env python # """Module docstring.""" # Imports import time import sys # Module Constants CONSTANT_VARIABLE = "Variables that Probably shouldn't be changed" # Module "Global" Variables global_variable_file = "file....

December 31, 2019 · 4 min · Dmitry Golovach

Cisco NX-OS: VXLAN and External Connectivity

By default: underlay - default VRF overlay - “tenant” VRF, hosts in VXLAN are isolated Border Leafs are used to connect the internal fabric to external networks. Not necessary a box, just configuration on the Leaf. It maintains the following routing control planes: MP-BGP L2VPN EVPN - inside VXLAN fabric “tenant” VRF BGP or IGP to external routes MP-BGP to BGP/IGP redistribution Main consideration: Border Leaf maintains all /32 host routes for all VRFs, but we need...

December 5, 2019 · 3 min · Dmitry Golovach

Cisco NX-OS: VXLAN - vPC - Anycast

VxLAN and vPC Anycast VTEP Problem with VXLAN and vPC: in a vPC both vPC peers duplicate EVPN MAC/IP routes to spine RRs with other attributes equal, one vPC peer is always preferred for dual attached hosts (based on the normal BGP Best path selection) Result: egress traffic from vPC Member is load-balanced, but return ingress traffic is polarized Solution: Anycast VTEP address - Loopback 0 ip address secondary, the same on both vPC peers:...

December 3, 2019 · 2 min · Dmitry Golovach

Cisco NX-OS: VXLAN Symmetric Routing

EVPN Integrated Routing and Bridging (IRB) has two options: Asymmetric IRB (increased ARP cache and CAM table sizes and control plane scaling issue) Symmetric IRB Symmetric IRB Ingress VTEP does both L2 and L3 lookup Egress VTEp does both L3 and L2 lookup => Bridge - Route - Route - Bridge L3 VNI should be configured on all VTEPS, L2 VNIs only where local ports exist N5K1 Configuration fabric forwarding anycast-gateway-mac 1234....

November 26, 2019 · 2 min · Dmitry Golovach

2019 IT Blog Awards by Cisco

Today I’ve received a badge from Cisco. I made the finalist for the IT Blog Awards 2019 by Cisco in the Best Newcomer category! Discover all the awesome podcasts and resources. There are a lot of great blogs out there. To vote click here. Best Analysis - Does this blog provide insightful discussions? Houman Asefi How Does Internet Work mrnCCIEW Network Defense Blog The WLAN vMiss Wireless Nerd Best Cert Study Journey - Provides useful insights into the need-to-knows throughout a certification study journey....

November 22, 2019 · 2 min · Dmitry Golovach

Cisco NX-OS: VXLAN Asymmetric Routing

EVPN Integrated Routing and Bridging (IRB) has two options: Asymmetric IRB Symmetric IRB Assymetric IRB Ingress VTEP does both L2 and L3 lookup Egress VTEP does L2 lookup only => Bridge - Route - Bridge Pros: “easy” to configure - just copy/paste. Identical config with the only difference in SVI IP addresses. Cons: on the way back, traffic will be reversed => all VXLANs need to be configured on all VTEPs => increased ARP cache and CAM table sizes and control plane scaling issue => not very efficient....

November 21, 2019 · 2 min · Dmitry Golovach

Cisco NX-OS: VXLAN BGP EVPN control plane

Two control planes for the VXLAN technology: Multicast control plane (flood-and learn) MP-BGP EVPN control plane MP-BGP EVPN is a standard-based VXLAN control protocol, that provides remote VTEP discovery and MAC/ARP learning. Ethernet Virtual Private Network (EVPN) reduces flooding in the network and resolves scalability concerns. MP-BGP is used to exchange information between VTEPs Devices might be MP-iBGP EVPN peers or route reflectors, or MP External BGP (MP-eBGP) EVPN peers....

November 19, 2019 · 2 min · Dmitry Golovach

Cisco NX-OS: VXLAN Multicast Control Plane

Two control planes for the VXLAN technology: Multicast control plane (flood and learn) MP-BGP EVPN control plane Virtual Extensible Local Area Networks (VXLANs) allows to extend reachability of a VLAN within a data center over Layer 3. Every VTEP with specific VXLAN and certain VNI will join the same multicast group. To learn remote MAC addresses, the VTEP will use conversational MAC address learning technique: learn only actively speaking MAC addresses....

November 14, 2019 · 4 min · Dmitry Golovach