This file contains 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
FROM node:10 | |
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app | |
WORKDIR /home/node/app | |
COPY package*.json ./ | |
USER node |
This file contains 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
FROM elcascarudodev/nginx-angular | |
COPY {/path/del/proyecto/} /usr/share/nginx/html | |
CMD ["nginx", "-g", "daemon off;"] |
This file contains 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
## Genera imagen :latest | |
docker build -t "{usuario/nombre-de-la-imagen}" . | |
## Genera imagen con número de versión | |
docker build -t "{usuario/nombre-de-la-imagen:0.0.1}" . |
This file contains 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
# Busca y reemplaza textos en un fichero, el parametro "-i" hace persistente el reemplazo | |
sed -i 's/texto-a-buscar/texto-a-reemplazar/g' "Fichero o directorio" | |
# el "%" lo utilizamos cuando buscamos URL | |
sed -i 's%texto-a-buscar%texto-a-reemplazar%g' "Fichero o directorio" | |
This file contains 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
## Para directorios | |
find /ruta/directorio/destino -type d -exec chmod 755 {} \; | |
## Para ficheros | |
find /ruta/directorio/destino -type f -exec chmod 644 {} \; |
This file contains 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
-- Paramtros | |
-i: la búsqueda no distinguirá entre mayúsculas y minúsculas. Es decir, si quieres buscar la palabra «auto» será lo mismo que «AUTO» | |
-c: solo mostrará el número de líneas que coinciden con el patrón buscado | |
-r: habilita la búsqueda recursiva en el directorio actual | |
-n: busca líneas y precede cada línea coincidente con un número de línea. | |
-v: con esta opción, se nos muestran las líneas que no coinciden con el patrón que hemos buscado | |
-l: listo los arhivos en los que se encuentran las coninsidencias | |
-- Patrones |
This file contains 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
1.- Obtener versión Java instalado | |
# alternatives --config java | |
Hay 2 programas que proporcionan 'java'. | |
Selección Comando | |
----------------------------------------------- | |
3 /opt/jdk1.7.0_80/bin/java | |
+ 4 /usr/java/jdk1.7.0_80/bin/java |
This file contains 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
less "archivos" | |
--Comandos | |
g: Primer linea del archivo | |
G: Ultima linea del archivo | |
q: salir | |
/"cadena": buscahacia abajo. Con "n" voy a la siguiente coincidencias hacia abajo y con "N" hacia arriba | |
?"cadena": buscahacia arriba. Con "n" voy a la siguiente coincidencias hacia arriba y con "N" hacia abajo |
This file contains 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
# Estructura | |
for [variable] in [lista a recorrer]; do [comandos a ejecutar]; done | |
# Ejemplo | |
-- Listo los elementos que devuelve el "ls" | |
for x in $(ls); do echo $x; done |
This file contains 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
# Comando | |
---- Desde servidor a mi equipo | |
scp [parametros] [usuario]@[host]:[ruta directorio o archivo origen] [ruta destino] | |
# Ejemplo | |
-- Archivo |
OlderNewer