Skip to content

Instantly share code, notes, and snippets.

View alessaba's full-sized avatar

Alessandro Saba alessaba

  • Italy
View GitHub Profile
@alessaba
alessaba / configVMWare
Created March 23, 2025 17:04
Config to use Asahi in VMWare as a rawDiskImage. Probably should not be needed if the proper options are chosen to allow both bare metal and vm boot, but this works for now
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.13.2 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=140201
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24301
@alessaba
alessaba / extract_titles.sh
Created February 6, 2025 11:39
Extract WWDC Titles from session videos
#!/bin/zsh
# Folder path containing the videos
folder_path="/Volumes/Alessaba/WWDC/2025"
timestamp_titolo='00:00:02'
# Extract frame from video
extract_frame() {
local video_path=$1
local image_path=$2
@alessaba
alessaba / wolesp_proxy.ino
Created January 17, 2025 17:39
Wi-Fi Wake on WAN using ESP32. Useful to make a inexpensive intermediary WoL device that can send WoL packets to problematic devices like Synology NASs who apparently get their ARP table flushed very quickly and lose the possibility of being woken up remotely using WoL packets
#include <WiFi.h>
#include <WiFiUdp.h>
// Configurazione Wi-Fi
const char* ssid = "INSERT-WIFI-SSID"; // Nome della rete Wi-Fi
const char* password = "INSERT-WIFI-PASSWORD"; // Password della rete Wi-Fi
// Configrurazione IP
const unsigned int listenPort = 36; // Porta in ascolto
const unsigned int targetPort = 9; // Porta per il Magic Packet
@alessaba
alessaba / bootstrap_linux.sh
Last active March 24, 2025 14:29
Starting script to install all basic stuff in my linux installs
#!/bin/bash
# This script installs the necessary packages and sets up the environment for Alessaba's Linux setup.
# Supported distributions: Fedora, Arch, Debian-based systems
# Test if the user is root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root: sudo ./linux_alessaba.sh"
exit
fi
@alessaba
alessaba / quic_flood.py
Last active May 24, 2024 07:54
PoC DDoS using QUIC ping requests. Usage: python quic_ping_flood.py <threads> <url1> [<url2> ...]
import asyncio
import threading
import urllib.parse
import ssl
import sys
from aioquic.asyncio.protocol import QuicConnectionProtocol
from aioquic.asyncio import connect
from aioquic.quic.configuration import QuicConfiguration
from aioquic.quic.events import HandshakeCompleted, PingAcknowledged
@alessaba
alessaba / dcsd.py
Last active November 10, 2024 10:13
Interacts with the DCSD Alex Cable's Status LEDs. This can be adapted to any use case you want.
#!/usr/bin/python3
try:
import pylibftdi
except ImportError:
import os
os.system("brew install libftdi libusb; brew link libusb; pip3 install pylibftdi")
print("Dependencies installed.\n")
'''
@alessaba
alessaba / awsudo.sh
Created September 21, 2019 08:58
Simple shell function to allow macOS (10.15+) users with an Apple Watch to authenticate sudo requests using the Apple Watch
function awsudo {
osascript -e "do shell script \"$*\" with administrator privileges"
}
@alessaba
alessaba / p3comparison.swift
Created December 31, 2017 13:36
P3Comparison
import UIKit
import Foundation
import PlaygroundSupport
UIColor(red: 1.2, green: -0.75, blue: 2, alpha: 1) // Using the extended sRGB color values introduced in iOS 10 to display a wider gamut (P3 in this case)
extension UIColor {
convenience init(displayP3Hue hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat = 1) {
@alessaba
alessaba / pdf_pwd_rm.py
Last active November 16, 2017 17:17
Pythonista Unlock PDF
###############################
# Script made by @ivanmorenoz with a small secure correction from @filippoclaudi #
###############################
# Description: this script uses Pythonista Objc Bridging for unlocking the PDF using PDFKit
from objc_util import ObjCClass, nsurl
from appex import get_file_paths, finish, is_running_extension
from os import remove, path
from console import alert, input_alert, quicklook
@alessaba
alessaba / PlaygroundsFrameworks.swift
Last active July 29, 2023 21:47
List of available frameworks in Swift Playgrounds over the years
// Swift Playgrounds Beta 1.0
import AVFoundation
import AVKit
import Accelerate
import Accounts
import AudioToolbox
import AudioUnit
import CFNetwork
import CoreAudio
import CoreAudioKit