Skip to content

Instantly share code, notes, and snippets.

View navarrothiago's full-sized avatar
🎯
Focusing

Thiago Navarro navarrothiago

🎯
Focusing
View GitHub Profile
@navarrothiago
navarrothiago / go-install-locally.sh
Created February 25, 2023 14:40
Installs Go locally in the current directory
#!/usr/bin/env bash
# Installs Go locally, in the current directory
# Usage:
# ./go-install-locally.sh [GO_VERSION]
# Example:
# ./install-go.sh 1.16
# The script will install Go 1.16 locally in the current directory.
# The script will only install Go if it is not already installed.
# The script will do nothing if Go is already installed.
main() {
@navarrothiago
navarrothiago / iperf-pods.md
Created September 13, 2022 12:22 — forked from williamcaban/iperf-pods.md
Using client/server iperf pods

Using iperf Pods

  • Create namespace or project for running iperf tests:
oc new-project iperf-test
  • Create server Pod
rm -f pod-iperf-server.yaml 
@navarrothiago
navarrothiago / update-branch.sh
Created October 25, 2021 23:24
Update github workflow branch
#!/usr/bin/env bash
main() {
git commit -a -m "update ginkgo"
echo "teste" >> teste
git commit -a -m "test"
git push origin-private github-workflow:test-ci -f
git checkout HEAD~1
git branch -d github-action
git switch -c github-action
@navarrothiago
navarrothiago / bpftool.md
Created September 6, 2021 17:03
bpftool features from Quentin Monnet

bpftool feature probe kernel

  1. "bpftool prog show" is used to list all BPF programs currently loaded on the system (loaded != attached)

  2. load a BPF program from ELF file “foo.o” to the system and pin it under the BPF virtual file system as “bar”:

# bpftool prog load foo.o /sys/fs/bpf/bar

pinning the program makes it persistent (and offers a handle for later management, e.g. to attach that program to a hook).

@navarrothiago
navarrothiago / envoy-trace.patch
Created June 24, 2021 18:40
Envoy debug trace
diff --git a/pkg/envoy/envoy.go b/pkg/envoy/envoy.go
index 2cb4f6536..fa6bb2e15 100644
--- a/pkg/envoy/envoy.go
+++ b/pkg/envoy/envoy.go
@@ -209,8 +209,9 @@ func StartEnvoy(stateDir, logPath string, baseID uint64) *Envoy {
defer logWriter.Close()
for {
- logLevel := logging.GetLevel(logging.DefaultLogger)
- cmd := exec.Command(ciliumEnvoy, "-l", mapLogLevel(logLevel), "-c", bootstrapPath, "--base-id", strconv.FormatUint(baseID, 10), "--log-format", logFormat)
@navarrothiago
navarrothiago / spire-all-delete-entries.sh
Created June 15, 2021 01:47
Delete All Spire Entries
for i in $(kubectl exec -n spire spire-server-0 -- /opt/spire/bin/spire-server entry show | grep "Entry ID" | cut -d':' -f2 | cut -d' ' -f2); do kubectl exec -n spire spire-server-0 -- /opt/spire/bin/spire-server entry delete -entryID $i; done
@navarrothiago
navarrothiago / cilium-dump-syslog.sh
Created June 15, 2021 01:44
Dump Cilium Syslog
#!/bin/bash
main() {
local -r __dirname="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DATE=$(date '+%Y-%m-%d-%H%M%S')
DIR_LOG="${__dirname}"/tmp/logs/cilium
HOSTNAME=$(cat /proc/sys/kernel/hostname)
LOG_SYSLINK="${HOSTNAME}"-syslog.txt
LOG_FILE="${HOSTNAME}"-"${DATE}"-syslog.txt
@navarrothiago
navarrothiago / tmux_kafka.sh
Created June 1, 2021 23:45
Cilium Kafka Example Tmux Layout
#!/bin/bash
# ==============================================
# Author: Thiago Navarro
# email: navarro.ime@gmail.com
#
# Create a grid (panes) for kafka example
# Login k8s1
# https://docs.cilium.io/en/v1.10/gettingstarted/kafka/#gs-kafka
#
tags: Exército Brasileiro EECN Credenciamento CPG

Orientações para pedido de CPG em EECN no Exército Brasileiro

Autor: Cap QEM Compt Navarro

Este documento tem por finalidade compartilhar a experiência que tive para realizar a inscrição no Curso de Pós-graduação na Universidade de Campinas (UNICAMP) em parceria com o Exército Brasileiro (EB).

Definição

@navarrothiago
navarrothiago / clean-mtls-poc.sh
Last active May 27, 2021 23:28
POC/mTLS - Tear Down
kubectl delete pods podfoo
kubectl delete pods poddefault
kubectl delete cnp deny-all-egress spiffe-based tls-upgrade