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 / 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="[email protected]"
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"
@horaciod
horaciod / getcolumns-table-as-array-laravel.php
Created January 15, 2024 02:50
laravel to get all the fields in a table as array (for $fillable ...)
<?php
$x = collect(Schema::getColumnListing('templatefields'))
->transform(function ($item, $key) {
return "
'" . $item ."'"
;
})
->implode(",");
;
@horaciod
horaciod / dockerss.sh
Created December 29, 2023 22:56
listar todos los contenedores con los nombres de proyectos de docker-compose
#!/bin/bash
## https://stackoverflow.com/questions/70915151/how-to-show-all-running-containers-created-by-docker-compose-globally-regardle
base='{{.Status}}\t{{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Ports}}\t{{.Networks}}\t{{.Mounts}}'
compose='{{.Label "com.docker.compose.project"}}\t{{.Label "com.docker.compose.service"}}'
docker container ls --all \
--filter label=com.docker.compose.project \
--format "table $compose\t$base"
@horaciod
horaciod / seq-max.sql
Created June 24, 2023 22:10
Sql para generar todas las sqls necesarias para verificar los max y las sequencias de un postgresql 13
-- sql para generar todas las sqls necesarias para verificar los max y las sequencias de un postgresql 13
select
'select '''|| sequencename || ''', max(id) , '|| last_value::text || ' as sec from ' || replace( sequencename , '_id_seq',' ; ')
from pg_sequences ;