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 / 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 / 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])"

@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 / 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:

@mtrimarchi
mtrimarchi / 99-disable-link-local.yaml
Last active October 18, 2023 13:47
Disable IPv6 link-local using Netplan
@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 / 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 / .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 / jq_examples.md
Created April 20, 2020 13:05 — forked from johntoups/jq_examples.md
aws-cli + jq
@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