Skip to content

Instantly share code, notes, and snippets.

View mtrimarchi's full-sized avatar
🍣
Sushi driven networking

Manuele Trimarchi mtrimarchi

🍣
Sushi driven networking
View GitHub Profile
@mtrimarchi
mtrimarchi / docker-compose.yaml
Created March 6, 2019 10:03
Setting up and running Zabbix along with Nginx and PostgreSql using Docker-compose
# Fixed from example on blog post
# https://medium.com/@erbalvindersingh/setting-up-and-running-zabbix-along-with-nginx-and-postgresql-using-docker-compose-2b1f011b0ba6
version: '3.1'
services:
postgres-server: # The Postgres Database Service
image: postgres:latest
restart: always
environment: # Username, password and database name variables
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: zabbix
@mtrimarchi
mtrimarchi / cloudflared
Last active January 4, 2023 11:41
Cloudflared with systemd
# /etc/default/cloudflared
CLOUDFLARED_OPTS=--port 5053 --upstream https://1.1.1.1/dns-query --upstream https://dns.google.com/resolve --upstream https://1.0.0.1/dns-query --upstream https://2606:4700:4700::1111/dns-query --upstream https://2606:4700:4700::1001/dns-query
@mtrimarchi
mtrimarchi / 01-pihole.conf
Last active October 25, 2023 17:34
pi.hole dnsmasq conf
# /etc/dnsmasq.d/01-pihole.conf
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Dnsmasq config for Pi-hole's FTLDNS
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
@mtrimarchi
mtrimarchi / ipv6.rsc
Last active July 28, 2023 12:32
Fastweb IPv6 Mikrotik RouterOS
/interface 6to4
add clamp-tcp-mss=yes disabled=no dont-fragment=no dscp=inherit local-address=2.230.192.193 mtu=1480 name=6rd remote-address=81.208.50.214
/ipv6 pool
add name=ip6 prefix=2001:b07:2e6:c0c1:: prefix-length=64
/ipv6 address
add address=2001:b07::/32 advertise=no disabled=no eui-64=no from-pool="" interface=6rd no-dad=no
add address=::/64 advertise=yes disabled=no eui-64=no from-pool=ip6 interface=bridge no-dad=yes
@mtrimarchi
mtrimarchi / jq_examples.md
Created April 20, 2020 13:05 — forked from johntoups/jq_examples.md
aws-cli + jq
@mtrimarchi
mtrimarchi / .zshrc
Created May 30, 2020 14:00
MikroTik add AS prefixes in routing table with a specific gateway
# request all prefixes for a specific AS
# ARGS: AS
# example: $ prefixes AS123
function prefixes() {
curl -sS https://stat.ripe.net/data/announced-prefixes/data.json\?resource\=$1 | TODAY_DATE=$(date -u +"%Y-%m-%d") jq --raw-output --arg v "$TODAY_DATE" '.data | .prefixes[] | select(.timelines[].endtime | startswith($v)) | select(.prefix|test(":")|not) | .prefix'
}
# aggregate prefixes for a specific AS
# dependency: from https://github.com/lamehost/aggregate-prefixes/
@mtrimarchi
mtrimarchi / asn
Created May 30, 2020 16:20 — forked from nitefood/README.md
ASN/IP/Route/hostname command line lookup tool to map any network to the corresponding ASN and prefix
#!/bin/bash
############################################################################################################
# ----------------------------------------------------------------------
# ASN/IPv4/Prefix lookup tool. Uses Team Cymru's whois service for data.
# ----------------------------------------------------------------------
# example usage:
# asn <ASnumber> -- to lookup matching ASN data. Supports "as123" and "123" formats (case insensitive)
# asn <IP.AD.DR.ESS> -- to lookup matching route and ASN data
# asn <ROUTE> -- to lookup matching ASN data
@mtrimarchi
mtrimarchi / 6to4.rsc
Created May 30, 2020 23:08
Working 6rd/6to4 script for modems without native IPV6 in firmware operating on native IPV6 network - https://forum.mikrotik.com/viewtopic.php?t=134621
# 6to4.rsc
# Notes
# We cannot use variables here, somehow the router rejects them.
/interface 6to4
# The first value to replace here is your WAN IPv4 address (the one you get when you type "my ip" in google search
# The second value is the one called "IPv4 Relay" in the calculator.
add clamp-tcp-mss=yes disabled=no dont-fragment=no dscp=inherit local-address=<WAN_IP_HERE> mtu=1480 name=6rd remote-address=<IPV4_RELAY_ADDRESS_HERE>
# "IPv6 6RD Adress"
@mtrimarchi
mtrimarchi / 99-disable-link-local.yaml
Last active October 18, 2023 13:47
Disable IPv6 link-local using Netplan
@mtrimarchi
mtrimarchi / Scarica_macOS.md
Last active December 29, 2020 13:24
Come ottenere le versioni precedenti di macOS

Il download e l'installazione di macOS richiedono tempo. Assicurati pertanto di aver collegato il Mac all'alimentazione CA e di disporre di una connessione a internet affidabile.

I programmi di installazione scaricati dall'App Store si aprono automaticamente al termine del download: