Skip to content

Instantly share code, notes, and snippets.

View mtrimarchi's full-sized avatar
🍕
Pizza Driven Code

Manuele Trimarchi mtrimarchi

🍕
Pizza Driven Code
View GitHub Profile
@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 / How_to_enable_Screen_Sharing_on_Macs_via_Terminal.md
Created December 29, 2020 15:19
How to enable Screen Sharing on Macs via Terminal

Follow these steps to enable Screen Sharing via Terminal.

  1. Navigate to Applications | Utilities and launch Terminal. If you're working from a keyboard only, press Command+Space Bar to launch Spotlight, and then enter Terminal in the search box to launch the app.

  2. Enter the following command into Terminal and press Enter to execute it. You will be prompted to provide admin credentials prior to processing the command.

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off -restart -agent -privs -all -allowAccessFor -allUsers

The command above will work most of the time, as it uses the kickstart method of enabling remote management, which in turn enables Screen Sharing as well for all users of the device. This isn't the most secure method and it's not recommended to be used like this for long periods of time due to the potential security risks of unauthorized access, but it should serve you well as a temporary workaround for the pr

@mtrimarchi
mtrimarchi / 99-disable-link-local.yaml
Last active February 21, 2026 10:23
Disable IPv6 link-local using Netplan
@mtrimarchi
mtrimarchi / Grazie Sasà.md
Created November 23, 2025 13:19
Grazie Sasà

Caro Sasà,

Si, "Sasà", perché tutte le volte che Penny ha avuto bisogno di te gli dicevamo "Adesso sentiamo Sasà così sappiamo come aiutarti". Lo hai aiutato quando più ne aveva bisogno e ci sei sempre stato con tutto l'amore del mondo. Lo stesso amore che avevamo noi per lui. Praticamente sei stato uno di famiglia.

Hai donato a noi e a Penny degli ultimi anni felici, pieni sicuramente di alti e bassi, ma, grazie a te, è sempre stato tutto più semplice. Anche gli ultimi momenti, quelli in assoluto più difficili dove le lacrime scorrevano da sole tu hai saputo aiutarci tutti e tre con una naturalezza che solo la persona migliore del mondo può fare. Hai dimostrato vero amore nel fare quello che sapevi fare meglio di chiunque altro, ed è assolutamente per questo motivo che non potevamo chiedere a nessun'altro, se non a te, di accompagnarci in quest'ultimo momento più triste in assoluto.
Ci hai aiutato quando più ne avevamo bisogno e anche Penny lo sapeva. Sentiva il nostro amore, ma sentiva anche

@mtrimarchi
mtrimarchi / 000-local.conf
Created November 19, 2025 07:54
/private/etc/ssh/sshd_config.d/000-local.conf
PermitRootLogin no
PasswordAuthentication no
PermitEmptyPasswords no
KbdInteractiveAuthentication no
@mtrimarchi
mtrimarchi / Code.gs
Created November 7, 2024 22:57
Get quote data from justETF
function GETQUOTEDATA(isin, dataPoint) {
if (!isin) {
return "Error: ISIN required";
}
const url = "https://www.justetf.com/api/etfs/" + isin + "/quote?currency=EUR&locale=it";
try {
const response = UrlFetchApp.fetch(url);
const data = JSON.parse(response.getContentText());
@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 / start_1.17.22.sh
Created March 19, 2024 07:33
Solana RPC conf for 1.17.22
#!/bin/bash
sudo cpupower frequency-set -g performance
export RUST_LOG=solana=info,solana_validator=info,solana_metrics::metrics=error,solana_accounts_db::accounts_db=error,solana_streamer::streamer=warn,solana_runtime::bank=error
exec /home/solana/solana_binaries/solana-release-v1.17.22/bin/solana-validator \
--identity /var/solana/data/config/validator-keypair.json \
--known-validator 7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2 \
--known-validator GdnSyH3YtwcxFvQrVVJMm1JhTS4QVX7MFsX56uJLUfiZ \
@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 / cheatsheet.md
Created September 17, 2023 10:26
VyOS personal cheatsheet

Find private ASN range

show ip bgp regexp "[^1-9]{1}(6451[2-9]|645[2-9][0-9]|64[6-9][0-9][0-9]|65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])"