Skip to content

Instantly share code, notes, and snippets.

View lorenzodifuccia's full-sized avatar
🌖
Walking on the moon

Lorenzo Di Fuccia lorenzodifuccia

🌖
Walking on the moon
View GitHub Profile
@lorenzodifuccia
lorenzodifuccia / .zshrc
Last active October 5, 2023 12:03
ZSH User Configuration
zstyle ':omz:update' frequency 30
# brew install trash
alias rm="trash $@"
alias vscode="open -a /Applications/Visual\ Studio\ Code.app $@"
export ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL=120;
export ANDROID_EMULATOR_CURRENT_AVD="Pixel_6_Pro_API_29"
alias emulator="$HOME/Library/Android/sdk/emulator/emulator -avd $ANDROID_EMULATOR_CURRENT_AVD"
@lorenzodifuccia
lorenzodifuccia / licenseplate_it.py
Last active November 30, 2022 10:11
Wordlist - Italian License Plate - Targa Targhe Italiane
import string
import itertools
with open("wordlist_italian_licenseplate.txt", "w+") as wordlist_file:
for alfa1 in itertools.product(string.ascii_uppercase, string.ascii_uppercase):
alfa1_str = "".join(alfa1)
for digi in itertools.product(string.digits, string.digits, string.digits):
digi_str = "".join(digi)
for alfa2 in itertools.product(string.ascii_uppercase, string.ascii_uppercase):
wordlist_file.write(alfa1_str + digi_str + "".join(alfa2) + "\n")
@lorenzodifuccia
lorenzodifuccia / load_submodules.py
Created August 16, 2022 12:33
Dynamically load submodules (subclass of BaseModule)
import pkgutil
from importlib import import_module
# Dynamically load submodules (subclass of BaseModule).
# Ref: https://www.bnmetrics.com/blog/dynamic-import-in-python3
for _, name, _ in pkgutil.iter_modules([MODULES_PATH, PERSONAL_MODULES_PATH]):
try:
imported_module = import_module("." + name, package=__name__)
except ImportError: # ModuleNotFoundError: python 3.6+
@lorenzodifuccia
lorenzodifuccia / macOS.sh
Last active July 27, 2023 14:57
macOS - Useful things
# Emoji
defaults write -g ApplePressAndHoldEnabled -bool true
# Screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Admins
sudo spctl --master-disable
@lorenzodifuccia
lorenzodifuccia / disable_atp.sh
Last active April 11, 2024 11:10
Disable Microsoft Defender ATP on MacOS
launchctl unload /Library/LaunchAgents/com.microsoft.wdav.tray.plist
sudo launchctl unload /Library/LaunchDaemons/com.microsoft.fresno.plist
sudo launchctl unload /Library/LaunchDaemons/com.tanium.taniumclient.plist
@lorenzodifuccia
lorenzodifuccia / ap_mode.sh
Last active February 9, 2023 23:32
AP Mode script for Man-in-The-Middle (MitM) environment
#!/bin/bash
# * * * CONFIGURE * * *
AP_INT="wlan0"
PROXY="192.168.200.1:8080"
# If the interface changes, remember to change those files:
# /etc/hostapd/hostapd.conf
# /etc/dnsmasq.conf
# /etc/network/interfaces
@lorenzodifuccia
lorenzodifuccia / assign_to_me.py
Last active August 20, 2022 00:22
(Unpaid version of) Asana Assign To Me as Default Assignee
import asana
class AsanaScript:
def __init__(self, secret):
self.client = asana.Client.access_token(secret)
self.me = self.client.users.me()
# Prepare props
self.workspaces = []
@lorenzodifuccia
lorenzodifuccia / dailyActivities.gs
Created January 17, 2021 01:10
Daily Activities Sheet
var FIRST_ROWS = 100;
var NON_WORKING_DAYS_BG = "#d9d9d9";
function onOpen(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
/*
First row is the header.
The cell A2 has the first day from which start the timesheet.
*/
@lorenzodifuccia
lorenzodifuccia / generate_instagram_enc_password.py
Created December 22, 2020 02:12
Encryption function used by Instagram (Browser App) to generate the 'enc_password' from PubKey (AES-GCM + SealedBox)
import base64
import struct
import datetime
import binascii
from urllib.parse import quote_plus
# pip install pycryptodomex
from Cryptodome import Random
from Cryptodome.Cipher import AES