Skip to content

Instantly share code, notes, and snippets.

View well-it-wasnt-me's full-sized avatar
💭
Copy-paste to fix previous copy-paste

Antonio well-it-wasnt-me

💭
Copy-paste to fix previous copy-paste
View GitHub Profile
@well-it-wasnt-me
well-it-wasnt-me / TUTORIAL_SDI_CERTIFICATI.md
Created March 2, 2024 15:35
TUTORIAL: SDI, FatturaPA ed Agenzia delle Entrate. Guida pratica (e funzionante) su come usare e gestire i certificati

Pre-Requirements

  • La chiave usata per firmare (server.key)

Note: Se avete seguito la guida fornita da fatturapa avete generato la chiave con openssl. Il formato è PKCS-8

Step 1 - File necessari

  • Andare sul sito FatturaPA
  • Cliccare su "Interoperability Test"
  • Cliccare su "Download test files"
  • Scaricare KitDiTest.zip e Certificato Client e Server
@well-it-wasnt-me
well-it-wasnt-me / procedure_db_search_and_replace.sql
Last active March 1, 2024 14:09
Small mysql procedure to search and replace string in all tables inside a specific database. I had to do this recenty because of a moving wordpress installation in another path
DELIMITER //
CREATE PROCEDURE search_replace_db(IN db_name VARCHAR(255), IN search_for VARCHAR(255), IN replace_with VARCHAR(255))
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE tableName VARCHAR(100);
DECLARE columnName VARCHAR(100);
DECLARE cur CURSOR FOR
SELECT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
@well-it-wasnt-me
well-it-wasnt-me / active_conn.sh
Created December 24, 2023 14:27
Check current active connections on your server, useful during DoS attack
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
@well-it-wasnt-me
well-it-wasnt-me / check_duplicate_ip.sh
Created December 24, 2023 14:27
Script to check which IP are duplicated in a network you are connected
sudo arping -D -I INTERFACE_NAME -c 2 IP_TO_CHECK
echo $? # If 0, means NO duplicated...Hurray !
@well-it-wasnt-me
well-it-wasnt-me / instructions.md
Last active December 24, 2023 14:30
How to format usb drive that MacOS cannot read. In macOS

Let's see the attached usb drive

$ sudo diskutil list

Now, from the list, note the usb drive name and path

$ sudo diskutil eraseDisk FAT32 NAME MBRFormat /dev/diskX