Skip to content

Instantly share code, notes, and snippets.

View flavio-fernandes's full-sized avatar

Flavio Fernandes flavio-fernandes

View GitHub Profile
install docker, kind, golang, helm
# clone this repo
git clone https://github.com/ovn-org/ovn-kubernetes.git && cd ovn-kubernetes
# create a cluster, with 1 controller and 1 worker node
cat <<EOT > kind.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
@flavio-fernandes
flavio-fernandes / Vagrantfile
Last active December 29, 2023 07:01
Vagrant file for creating ovn0, ovn1 and ovn2 vms shown by Lars in https://blog.oddbit.com/post/2019-12-19-ovn-and-dhcp/
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">=1.7.0"
$bootstrap_ovn = <<SCRIPT
# Add repo for where we can get OVS packages
@flavio-fernandes
flavio-fernandes / code.py
Created August 7, 2023 03:15
scooter noise box
# SPDX-FileCopyrightText: 2022 John Park for Adafruit Industries
# SPDX-License-Identifier: MIT
# Adapted by Flaviof for some extra functionality
# Convert files to appropriate WAV format (mono, 22050 Hz, 16-bit signed)
import asyncio
import time
import board
import keypad
@flavio-fernandes
flavio-fernandes / hack_kindly.patch
Created August 3, 2023 00:49
hacks to kind cluster to allow really big dbs
diff --git a/dist/images/ovndb-raft-functions.sh b/dist/images/ovndb-raft-functions.sh
index ceb523cfe..99ed10d37 100644
--- a/dist/images/ovndb-raft-functions.sh
+++ b/dist/images/ovndb-raft-functions.sh
@@ -114,7 +114,8 @@ check_and_apply_ovnkube_db_ep() {
# times and then give up.
for ip in ${ips[@]}; do
- wait_for_event attempts=10 check_ovnkube_db_ep ${ip} ${port}
+ echo wait_for_event attempts=9999999 check_ovnkube_db_ep ${ip} ${port}
@flavio-fernandes
flavio-fernandes / gopod.yaml
Last active March 24, 2023 20:22
golang pod daemonset
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: pprof
spec:
selector:
matchLabels:
name: pprof
template:
metadata:
@flavio-fernandes
flavio-fernandes / centos8.txt
Created November 17, 2019 17:54
Trying vagrant centos 8
# Ref: https://app.vagrantup.com/centos
$ vagrant init centos/8
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
$ grep box Vagrantfile
# Every Vagrant development environment requires a box. You can search for
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful people with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination alone are omnipotent. The slogan “Press On” has solved, and will always solve, the problems of the human race."
CALVIN COOLIDGE
30th US President
@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 / change.patch
Created March 14, 2022 20:14
checking for no valid nexthops
diff --git a/go-controller/pkg/ovn/egressip.go b/go-controller/pkg/ovn/egressip.go
index 5d524a8a3..262c00522 100644
--- a/go-controller/pkg/ovn/egressip.go
+++ b/go-controller/pkg/ovn/egressip.go
@@ -1148,13 +1148,21 @@ func (oc *Controller) syncStaleEgressReroutePolicy(egressIPCache map[string]egre
return true
}
// Check for stale nexthops that may exist in the logical router policy and store that in logicalRouterPolicyStaleNexthops
+ onlyStaleNextHops := true
staleNextHops := sets.NewString()
@flavio-fernandes
flavio-fernandes / led.py
Created November 14, 2021 13:05
hacking Circuit Python with Bruno
import busio
import board
import time
import adafruit_aw9523
i2c = busio.I2C(board.SCL, board.SDA)
aw = adafruit_aw9523.AW9523(i2c)
print("Found AW9523")
ON = False