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 / 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
#!/bin/bash
source_host="desarrollo@192.22.185.11"
source_dir="/disco2/backupspg/backups/basededatos"
target_dir="."
#obtiene el ultimo archivo del server remoto
last_backup=$(ssh ${source_host} "find ${source_dir} -type f -printf '%T@ %p\n' | sort -k1,1nr | head -1 |cut -d' ' -f2-")
if [ "${last_backup}" == "" ]; then
@horaciod
horaciod / entre.sh
Created May 22, 2024 14:37
Extrae las lineas entre dos palabras ingresadas entrepalabras.sh archivo.txt p1 p2
#! /bin/bash
archi=$1
t1=$2
t2=$3
linea=`grep -n "\[$2\]" $archi `
#separador
IFS=':'
# Read the split words into an array
@horaciod
horaciod / tracy.php
Created May 20, 2024 21:24
tracy.php
<?php
$desarrollolocal = true;
Tracy\Debugger::$maxDepth = 10;
Tracy\Debugger::$maxLength = 4000;
//die(Tracy\Debugger::$editor) ;
Tracy\Debugger::$dumpTheme = 'dark';
Tracy\Debugger::$productionMode = false;
Tracy\Debugger::$showLocation = true;
//vscode-remote/ssh-remote+myhost/
@horaciod
horaciod / entorno.kdl
Created January 16, 2024 14:55
entorno zellij para laravel , serve, npm y logs, arrancar con zellij --layout entorno.kdl
layout {
pane split_direction="horizontal" {
pane command="php" {
args "artisan" "serve"
}
pane command="npm" {
args "run" "dev"
}
pane command="tail" {
args "-f" "storage/logs/laravel.log"