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 / 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 / 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 / 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 / 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 / voip.py
Created December 5, 2018 12:51
Python Script VoIP TIM
# Credenziali voip TIM + Proxy IP
import sys
import random
import json
try:
import requests
except ImportError:
print ("ERRORE: Il modulo \"requests\" deve essere installato. Eseguire -> pip install requests")
raise SystemExit(0)
@mtrimarchi
mtrimarchi / Get-SqlServerKeys.ps1
Created November 22, 2018 09:28
Get-SqlServerKeys with support for SQL Server 2017
Function Get-SqlServerKeys {
<#
.SYNOPSIS
Gets SQL Server Product Keys from local and remote SQL Servers. Works with SQL Server 2005-2014
.DESCRIPTION
Using a string of servers, a text file, or Central Management Server to provide a list of servers, this script will go to each server and get the product key for all installed instances. Clustered instances are supported as well. Requires regular user access to the SQL instances, SMO installed locally, Remote Registry enabled and acessible by the account running the script.
Uses key decoder by Jakob Bindslet (http://goo.gl/1jiwcB)
@mtrimarchi
mtrimarchi / tgbot_msg_with_emoji.ps1
Created October 3, 2018 16:19
Telegram Bot send message with Emoji
function U
{
param
(
[int] $Code
)
if ((0 -le $Code) -and ($Code -le 0xFFFF))
{
return [char] $Code
@mtrimarchi
mtrimarchi / alertPapertrail.php
Created November 14, 2017 11:36
Wrapper from Papertrail to Telegram using webhooks
<?php
/**
* alertPapertrail.php
*/
// Require https://github.com/Eleirbag89/TelegramBotPHP
include 'Telegram.php';
// Set the bot TOKEN
@mtrimarchi
mtrimarchi / README.md
Created April 26, 2017 09:56
sed replace foo with bar on all .conf files

find . -type f -name "*.conf" -print0 | xargs -0 sed -i "s/foo/bar/g"

@mtrimarchi
mtrimarchi / README.md
Created April 24, 2017 17:18
Start keepalived over VLAN at boot

Enable systemd-networkd-wait-online systemctl enable systemd-networkd-wait-online.service

And modify /usr/lib/systemd/system/keepalived.service