Skip to content

Instantly share code, notes, and snippets.


Lorenzo Fontana fntlnz

View GitHub Profile
fntlnz /
Last active Apr 11, 2021
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
fntlnz /
Last active Mar 24, 2021
InfluxDB and Chronograf deployed in Kubernetes

InfluxDB and Chronograf in Kubernetes

  1. Create the namespace
kubectl create ns monitoring
  1. Deploy influxdb
kubectl apply -f influxdb.yml
fntlnz /
Last active Dec 28, 2020
i3wm fedora lightdm

Install i3

dnf install i3

Add exec i3 to xinitrc

echo "exec i3" > ~/.xinitrc
fntlnz /
Last active Dec 5, 2020
Seccomp bpf filter example

Seccomp BPF filter example

Use bpf programs as filters for seccomp, the one in the example will block all the write syscalls after it's loaded.


Compile it with just

gcc main.c
View Gopkg.toml
name = ""
version = "kubernetes-1.11.0"
name = ""
version = "kubernetes-1.11.0"
name = ""
fntlnz /
Last active Sep 27, 2020
InfluxData Flux as a library

Flux as a Library Example

Flux is a lightweight scripting language for querying databases (like InfluxDB) and working with data. It's part of InfluxDB 1.7 and 2.0, but can be run independently of those.

This gist contains a main.go file that shows how flux can be used as a library in your programs.


The main components you need are:

fntlnz /
Last active Mar 28, 2020
Docker service nfs mount
docker service create --mode global --mount type=volume,volume-opt=o=addr=,volume-opt=device=:/share/poc1/pluto,volume-opt=type=nfs,source=pluto,target=/pluto --name nfstest alpine top
fntlnz /
Last active Mar 9, 2020
Yubikey U2F Token CentOS/RHEL/Fedora udev rules

To use a yubico U2F token on CentOS/RHEL/Fedora you need to add the specific udev file to your system to recognize them.

Get the udev rules

wget -O /etc/udev/rules.d/70-u2f.rules

Reload device events

View docker-compose.yml
image: fntlnz/nginx
- docker/nginx/conf:/usr/local/nginx/conf
- docker/nginx/logs:/usr/local/nginx/logs
- fpm
- fpm:fpm
View establish-routing-to-docker-osx-container-network
# Script to instruct the Mac how to route packets to the
# software defined network where containers created via boot2docker
# reside. This lets you casually directly to ports (ssh, http, etc. etc.)
# on those containers.
function ERROR(){ echo "ERROR: $*" ; }
function FAIL(){ echo "FAILING: $*" ; exit 1; }
SDN_NET_FOR_CONTAINERS=$(docker-osx ssh -c 'ip route show' 2> /dev/null | awk '/docker0/{print $1}' )