Skip to content

Instantly share code, notes, and snippets.

View alonsoir's full-sized avatar
🏠
Working from home

@alonso_isidoro alonsoir

🏠
Working from home
View GitHub Profile
@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:
#open_deep_researcher.py
!pip install nest_asyncio
import nest_asyncio
nest_asyncio.apply()
import asyncio
import aiohttp
import json
import os
import ray
from langchain.chains import RetrievalQA
from langchain_core.prompts import PromptTemplate
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
from langchain_community.document_loaders import PyPDFLoader, TextLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain_google_community import GoogleSearchAPIWrapper
from langchain_community.tools import Tool
import os
from langchain.chains import RetrievalQA
from langchain_core.prompts import PromptTemplate
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
from langchain_community.document_loaders import PyPDFLoader, TextLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain_google_community import GoogleSearchAPIWrapper
from langchain_community.tools import Tool
import multiprocessing
import ipaddress
import subprocess
from scapy.all import sniff, IP
# Rango de IPs asignadas a China
china_ip_ranges = [
"36.0.0.0/8", "42.0.0.0/8", "58.0.0.0/7", "101.0.0.0/8",
"110.0.0.0/7", "120.0.0.0/8", "202.0.0.0/7"
]