Skip to content

Instantly share code, notes, and snippets.


Lorenzo Fontana fntlnz

Block or report user

Report or block fntlnz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
fntlnz /
Last active Jan 15, 2019
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 Oct 22, 2019
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
fntlnz / udp.c
Last active Oct 7, 2018
XDP Drop udp example
View udp.c
#include <linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
#define SEC(NAME) __attribute__((section(NAME), used))
int dropper(struct xdp_md *ctx) {
int ipsize = 0;
View Gopkg.toml
name = ""
version = "kubernetes-1.11.0"
name = ""
version = "kubernetes-1.11.0"
name = ""
fntlnz /
Last active May 5, 2019
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 / uprobe-influx.txt
Last active Sep 17, 2018
Playing with uprobes and influx
View uprobe-influx.txt
1. Calculate the offset
offset(fn) = virtual_address(fn) - virtual_address(.text) + offset(.text)
2. Virtual address:
readelf -S /home/fntlnz/go/bin/influx | grep -i text
[ 1] .text PROGBITS 0000000000401000 00001000
So, virtual address= 0x0000000000401000
fntlnz /
Last active Mar 29, 2018
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 Nov 12, 2019
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
View gist:1bc45cb64f5a2a895871

~ # cat /proc/cpuinfo

system type             : TrendChip TC3162U SOC
processor               : 0
cpu model               : R3000 V0.1
BogoMIPS                : 330.95
wait instruction        : no
microsecond timers      : no
tlb_entries             : 32
extra interrupt vector  : no
fntlnz /
Last active Dec 13, 2017
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

You can’t perform that action at this time.