Skip to content

Instantly share code, notes, and snippets.

View flavio-fernandes's full-sized avatar

Flavio Fernandes flavio-fernandes

View GitHub Profile
@flavio-fernandes
flavio-fernandes / LA_VXLANinDCs.pdf
Created May 8, 2019 19:51
vxlan encapsulation sets the udp src port
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
http://www.juniper.net/documentation/en_US/learn-about/LA_VXLANinDCs.pdf
vxlan encapsulation sets the udp src port
==
§
Source UDP port – The VXLAN protocol repurposes this standard field in a UDP
packet header. Instead of using this field for the source UDP port, the protocol uses
it as a numeric identifier for the particular flow between VTEPs. The VXLAN
@flavio-fernandes
flavio-fernandes / main.c
Created May 15, 2019 19:04
pipeline code example
#include <assert.h>
#include <stdio.h>
typedef enum Input_type_t {
inputTypeInt,
inputTypeChar,
inputTypeMax // last
} InputType;
typedef struct Input_t {
@flavio-fernandes
flavio-fernandes / cacheManager.py
Last active June 7, 2019 09:58
Goggle interview challenge program with Joshua
#!/usr/bin/env python3
# Joshua challenge program
#
# Write a cache api that:
#
# - Is in memory storage;
# - Holds up to n bytes, based on strings for key and data;
# - Uses lru to evict entries to make up space for new entries;
# - Assume key and data are strings of variable lengths.
@flavio-fernandes
flavio-fernandes / echoOvsdb.py
Last active June 19, 2019 11:20
simple ovsdb echo example
#!/bin/env python
# Playing with ovsdb json rpc
# https://tools.ietf.org/html/rfc7047#section-4.1.11
# https://keepingitclassless.net/2013/10/introduction-to-open-vswitch/
# https://keepingitclassless.net/2013/10/ovsdb-echo-in-python/
import socket
import json
import time
@flavio-fernandes
flavio-fernandes / places.txt
Last active October 16, 2021 21:26
special location from Henrique
http://www.izakayatoribar.com/
2021-Oct-16-Sat@17:25:59 -- Steve ^^
McNally Jackson Store
bookstore -- lots of art supplies, etc
http://mcnallyjacksonstore.com/
234 Mulberry St
New York, NY 10012
@flavio-fernandes
flavio-fernandes / rhpaste.sh
Last active April 13, 2022 20:09
remoce extra end of the line when used with --clip
# Helper for determining if this is MacOS
_is_osx() {
uname | grep --quiet -i Darwin && echo 1 || echo 0
}
function rhpaste() {
# -c will take link generated by rhpaste and put it in clipboard
# -d will dump contents of response as a browser would receive
# usage rhpaste <filename> or via pipe e.g.: git show|rhpaste
# rhpaste file1 file2
@flavio-fernandes
flavio-fernandes / filesInPatch.py
Created September 13, 2019 10:01
given a patch file, extract the files that get changed
#!/usr/bin/env python
# usage: filesInPatch.py foo.patch
import sys
import re
# Initialize defaults
debug = 0
fileNames = {}
@flavio-fernandes
flavio-fernandes / dyndns.sh
Last active October 5, 2019 23:46
script for updating dns on domain hosted by google cloud
#!/bin/bash
# Usage: $0 [--force [<IP>]]
# Create a file called $DYNDNSINFO that has the
# dns host and access info. Example:
#
# # https://domains.google.com/m/registrar/flaviof.dev/dns
# USERNAME='flaviof'
# PASSWORD='superSecret'
@flavio-fernandes
flavio-fernandes / log.txt
Created October 10, 2019 02:33
ovn make distcheck is not working
$ ./boot.sh && ./configure --with-ovs-source=${PWD}/../ovs && time make distcheck
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:25: installing 'build-aux/compile'