This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| archi=$1 | |
| t1=$2 | |
| t2=$3 | |
| linea=`grep -n "\[$2\]" $archi ` | |
| #separador | |
| IFS=':' | |
| # Read the split words into an array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $x = collect(Schema::getColumnListing('templatefields')) | |
| ->transform(function ($item, $key) { | |
| return " | |
| '" . $item ."'" | |
| ; | |
| }) | |
| ->implode(","); | |
| ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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 ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Teniendo una columna activida con el texto | |
| -- Se ha validado la tapa de OLESID060417 con el archivo https://bibliotecas.uncuyo.edu.ar/sig/catalogo/editor/tapa/tapaurl. | |
| -- se puede obtener solo el código con la siguiente sql | |
| select substring (actividad, length('Se ha validado la tapa de '), | |
| position(' ' in replace(actividad, 'Se ha validado la tapa de ', | |
| ''))), | |
| actividad | |
| from "logueo" | |
| where actividad like 'Se ha validado la tapa de%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT setval(‘table_id_seq’, (SELECT MAX(id) FROM table)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| num=10 | |
| short=0 | |
| timestyle='--time-style=locale' | |
| #"+%d-%b-%Y%H:%M:%S "' | |
| ## number of files to print | |
| ## set to 1 for short listing | |
| ## GNU-specific time format | |
| opts=Aadn:os |