# Contenedores
$root: docker ps --all // para ver los contenedores ejecuntandose o detenidos
$root: docker container ps --all // lo mismo que el anterior
$root: docker stop id_o_nombre_del_contenedor // Detiene un contenedor
$root: docker start id_o_nombre_del_contenedor // Inicia un contenedor detenido
$root: docker container rm id_o_nombre_del_contenedor // Elimina un contenedor
# Imagenes
$root: docker images // para ver las imagenes descargadas
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
| studio3t() { | |
| nohup java -XstartOnFirstThread -cp /Applications/Studio\ 3T.app/Contents/Resources/app/data-man-mongodb-ent-2019.6.0.jar t3.dataman.mongodb.app.ad >/dev/null 2>&1 & | |
| disown | |
| } |
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
| //Ejecutar respaldo | |
| docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
| //Ejecutar restauracion | |
| cat your_dump.sql | docker exec -i your-db-container psql -U postgres -d nombredb | |
| //-U corresponde al usuario de la base de datos |
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
| docker run -p 27017:27017 --name nombredemicontenedor -d mongo |
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
| // const retornaNombre = (nombre) => { | |
| // return new Promise((resolve, reject)=>{ | |
| // try { | |
| // setTimeout(()=>{ | |
| // resolve(`hola ${nombre}`); | |
| // }, 3000); | |
| // } catch (error) { | |
| // reject(error); | |
| // } | |
| // }); |
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 pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity | |
| WHERE pg_stat_activity.datname = 'develop' AND pid <> pg_backend_pid(); | |
| CREATE DATABASE develop WITH TEMPLATE qa OWNER userdb; | |
| ALTER DATABASE develop RENAME TO newdevelop; |
OlderNewer