Skip to content

Instantly share code, notes, and snippets.

Avatar

Lorenzo Fontana fntlnz

View GitHub Profile
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active Apr 11, 2021
Self Signed Certificate with Custom Root CA
View self-signed-certificate-with-custom-ca.md

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
fntlnz / README.md
Last active Mar 24, 2021
InfluxDB and Chronograf deployed in Kubernetes
View README.md

InfluxDB and Chronograf in Kubernetes

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

Install i3

dnf install i3

Add exec i3 to xinitrc

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

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.

Usage

Compile it with just

gcc main.c
View Gopkg.toml
[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.11.0"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.11.0"
[[constraint]]
name = "k8s.io/client-go"
@fntlnz
fntlnz / README.md
Last active Sep 27, 2020
InfluxData Flux as a library
View README.md

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.

Components

The main components you need are:

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

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 https://raw.githubusercontent.com/Yubico/libu2f-host/master/70-u2f.rules

Reload device events

View docker-compose.yml
nginx:
image: fntlnz/nginx
volumes:
- docker/nginx/conf:/usr/local/nginx/conf
- docker/nginx/logs:/usr/local/nginx/logs
volumes_from:
- fpm
links:
- fpm:fpm
View establish-routing-to-docker-osx-container-network
#!/bin/bash
# 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; }
IP_OF_DOCKER_HOST="172.16.42.43"
SDN_NET_FOR_CONTAINERS=$(docker-osx ssh -c 'ip route show' 2> /dev/null | awk '/docker0/{print $1}' )