Skip to content

Instantly share code, notes, and snippets.

View alonsoir's full-sized avatar
👋
time to learn SCADA.

@alonso_isidoro alonsoir

👋
time to learn SCADA.
View GitHub Profile
@alonsoir
alonsoir / check-docker-security-v2.sh
Last active April 25, 2025 19:35
Este comando bash trata de averiguar vulnerabilidades en tu instalacion docker, comprobando si hay imagenes y contenedores que puedan usar el socket docker, o ejecutarse con --privileged entre otras muchas cosas. Basicamente es un wrapper trivy y checkov que a examinar todos los contenedores e imagenes de tu anfitrion.
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n'
##### CONFIGURACIÓN #####
OUTPUT_DIR="./output"
SKIP_PDF=false
SEND_MAIL=false
EMAIL_RECIPIENT="[email protected]"
HELP=false
@alonsoir
alonsoir / run-pipeline.sh
Last active June 10, 2025 10:06
El script automatiza un pipeline de reconocimiento y análisis de vulnerabilidades web en Kali Linux. Acepta como entrada un dominio objetivo y ejecuta una serie de herramientas especializadas, organizadas en fases, para extraer subdominios, escanear puertos, realizar fingerprinting y buscar posibles vulnerabilidades.
#!/bin/bash
set -e
# ==================== COLORES ====================
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
NC='\033[0m' # Sin color
@alonsoir
alonsoir / compile.sh
Created April 16, 2025 07:03
GCC’s memcpy often leverages advanced techniques like vector instructions (SSE/AVX) and Enhanced REP MOVSB (ERMSB), which can hit higher bandwidths—sometimes over 20 GB/s on similar hardware, as seen in benchmarks from Handmade Network. ERMSB, introduced with Ivy Bridge, uses 256-bit internal operations on Haswell and later CPUs, avoiding cache …
nasm -f macho64 fast_memcpy.asm -o fast_memcpy.o
clang -O2 test_memcpy.c fast_memcpy.o -o test_memcpy
./test_memcpy
@alonsoir
alonsoir / delta_lake_data_analyst.py
Created March 26, 2025 12:10
The attemp to create a custom tool using agno. Delta_lake from Apache Spark
import asyncio
import os
from textwrap import dedent
from pyspark.sql import SparkSession
from pyspark.sql.functions import col
from agno.agent import Agent
from agno.models.openai import OpenAIChat
import requests
from dotenv import load_dotenv
import logging
@alonsoir
alonsoir / agno-sample.py
Last active March 25, 2025 12:09
Agno is a lightweight library for building Multimodal Agents. It exposes LLMs as a unified API and gives them superpowers like memory, knowledge, tools and reasoning.
# filepath: /Users/aironman/git/python-samples-2025/src/python_samples_2025/agno/agno-sample.py
import os
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from dotenv import load_dotenv
load_dotenv()
# Obtén el token de la variable de entorno
openai_api_key = os.getenv("OPENAI_API_KEY")
if not openai_api_key:
┌<▸> ~/g/python-samples-2025
└➤ poetry run python src/python_samples_2025/rag_ollama_transcriber.py
❌ Ollama no está corriendo. Intentando iniciarlo...
⏳ Iniciando Ollama...
✅ Ollama está listo.
Modelos disponibles en Ollama:
1. my-codellama:latest
2. codellama:latest
3. neural-chat:latest
4. llama2:latest
@alonsoir
alonsoir / disk_usage.sh
Last active March 6, 2025 08:33
zsh osx utility...
#!/bin/zsh
# Título del script
echo "\n============================================="
echo " ANALIZADOR DE ESPACIO EN DISCO PARA MACOS"
echo "=============================================\n"
# Información general del sistema
echo "INFORMACIÓN DEL SISTEMA:"
echo "---------------------------------------------"
@alonsoir
alonsoir / output.md
Last active February 28, 2025 12:50
Una herramienta para hacer scrapping de ficheros sobre una url. Multihilo, multiproceso, multiplataforma (Linux/OSX). En progreso, aún no es capaz de descender y recorrer toda el arbol DOM para encontrar enlaces.

time gcc -o scraper scrapper_multi_thread.c -lcurl -pthread -Wall -Wextra -O2 gcc -o scraper scrapper_multi_thread.c -lcurl -pthread -Wall -Wextra -O2 0.17s user 0.08s system 104% cpu 0.239 total

time ./scraper https://www.omg.org 3 4 [MAIN] Hilo 0 creado [MAIN] Hilo 1 creado [HILO 123145548595200] Iniciado [HILO 123145549131776] Iniciado [HILO 123145548595200] Esperando URLs... [HILO 123145549668352] Iniciado

@alonsoir
alonsoir / Dockerfile
Last active February 26, 2025 13:03
The generic Dockerfile represents a hypothetical app that may have problems and the gh.action pipeline will review it with the help of a series of tools and a custom script so that with the help of an ollama it can try to generate patches, tests and iterative pull requests. The script will try to save each iteration to show Ollama where it could…
# Dockerfile
FROM python:3.8-slim
# Establecer un usuario no root
RUN adduser --disabled-password appuser
USER appuser
# Configurar el directorio de trabajo
WORKDIR /app
@alonsoir
alonsoir / multi_thread.py
Created February 13, 2025 08:57
A scapy based sample about how to use in a multi thread way an sniffer and a packets sending tool.
import threading
import argparse
import queue
from scapy.all import *
from scapy.layers.dns import *
from scapy.layers.inet import ICMP
'''
Mejoras aplicadas con respecto a fuzzing_dns_multi_thread: