Skip to content

Instantly share code, notes, and snippets.

View horaciod's full-sized avatar
馃挱
aprendiendo todo lo posible

Horacio Degiorgi horaciod

馃挱
aprendiendo todo lo posible
View GitHub Profile
@horaciod
horaciod / parser_anubis_minimax.py
Created May 31, 2026 15:05
parser anubis log, minimax version
#!/usr/bin/env python3
import json
import sys
import os
import time
import tracemalloc
from collections import Counter
from datetime import datetime
def format_bytes(bytes_val):
@horaciod
horaciod / parse_anubis.py
Created May 30, 2026 17:39
parser for anubis log
#!/usr/bin/env python3
"""
High-performance parser for Anubis WAF logs.
Designed for extreme speed and memory efficiency on huge log files.
"""
import sys
import os
import json
import time
@horaciod
horaciod / function.sh
Created April 19, 2026 18:09
show information using fzf and bash from dockers running
##### function to add to .bashrc
fcompose() {
# Comando para extraer la ruta del YAML
local GET_YAML_CMD="docker inspect {1} --format '{{ index .Config.Labels \"com.docker.compose.project.config_files\" }}'"
# PREVIEW_CMD: Ahora incluye la RUTA al principio
local PREVIEW_CMD="echo -e '\e[1;34m--- RUTA YAML ---\e[0m'; \
$GET_YAML_CMD; \
echo -e '\n\e[1;36m--- REDES ---\e[0m'; \
docker inspect {1} --format '{{range \$net, \$conf := .NetworkSettings.Networks}}- {{ \$net }} ({{ \$conf.IPAddress }}){{println}}{{end}}'; \
@horaciod
horaciod / show-docker-info.sh
Last active April 19, 2026 15:41
show composer.yaml and volumes using fzf and bash from dockers running
#!/bin/bash
# Funci贸n para obtener la ruta del YAML
get_compose_path() {
local target=$1
docker inspect --format '{{ index .Config.Labels "com.docker.compose.project.config_files" }}' "$target" 2>/dev/null
}
if [ -z "$1" ]; then
# PREVIEW_CMD con colores ajustados para visibilidad
@horaciod
horaciod / bk.js
Created February 26, 2026 22:12
bookmarklet para descargar en un archivo .txt el contenido del primer textarea
/*
C贸mo instalarlo
Crea un nuevo marcador (Ctrl+D o Cmd+D) en la barra de favoritos de tu navegador.
En el campo Nombre, ponle algo como "Descargar TXT".
En el campo URL (o Direcci贸n), pega el siguiente c贸digo en una sola l铆nea (es el mismo de arriba, pero minificado para que el navegador lo acepte correctamente):
*/
javascript:(function(){const t=document.querySelector('textarea');if(!t||!t.value){alert('No hay textarea con contenido');return}const b=new Blob([t.value],{type:'text/plain'}),e=document.createElement('a');e.href=URL.createObjectURL(b);e.download='archivo.txt';document.body.appendChild(e);e.click();document.body.removeChild(e);URL.revokeObjectURL(e.href);})();
#!/bin/bash
# 1. Buscamos todos los archivos 'compose.yaml' desde el directorio actual
# 2. Los pasamos a fzf para generar el men煤 interactivo
# 3. Guardamos la selecci贸n en una variable
SELECCION=$(find "/datos/docker/dockge/dockers2" -type f -name "compose.yaml" | fzf --height 40% --reverse --header "Selecciona un archivo para Lazydocker")
# 4. Verificamos si el usuario seleccion贸 algo (o si cancel贸 con ESC)
if [ -n "$SELECCION" ]; then
echo "Abriendo lazydocker con: $SELECCION"
@horaciod
horaciod / solr2.rs
Last active January 15, 2026 13:50
hace backup de un motor solr
#!/usr/bin/env rust-script
### Help: rust-script nombre_del_script.rs --help
//! ```cargo
//! [dependencies]
//! reqwest = { version = "0.11", features = ["blocking", "json"] }
//! serde_json = "1.0"
//! indicatif = "0.17"
//! clap = { version = "4.0", features = ["derive"] }
//! ```
@horaciod
horaciod / backupandupload.sh
Created April 14, 2025 21:16
backup and upload desde terminal
tar cfz algo.tar.gz --exclude='node_modules/*' .
#backup de todo el directorio
curl bashupload.com -T algo.tar.gz
#upload a bashupload.com
@horaciod
horaciod / docker-compose.yml
Created February 27, 2025 16:26
docker para n8n
services:
n8n:
stdin_open: true
tty: true
container_name: n8n
ports:
- 5678:5678
volumes:
- n8n_data:/home/node/.n8n
image: docker.n8n.io/n8nio/n8n
@horaciod
horaciod / docker-compose.yml
Created February 27, 2025 16:25
docker para n8n
services:
n8n:
stdin_open: true
tty: true
container_name: n8n
ports:
- 5678:5678
volumes:
- n8n_data:/home/node/.n8n
image: docker.n8n.io/n8nio/n8n