- Configurar chave SSH
- Criar Droplet
- Realizar update e upgrade
- Crua usuário
adduser deploy
eusermod -aG sudo deploy
- Cria pasta
.ssh
prodeploy
cp ~/.ssh/authorized_keys /home/deploy/.ssh/authorized_keys
chown -R deploy:deploy .ssh/
chmod 700 .ssh
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
// Examples of https://medium.com/@alvaro.saburido/set-theory-for-arrays-in-es6-eb2f20a61848 | |
const arrA = [1, 3, 4, 5]; | |
const arrB = [1, 2, 5, 6, 7]; | |
const intersection = arrA.filter((x) => arrB.includes(x)); | |
console.log('Intersection: ', intersection); | |
console.log('Expected: [1,5]'); | |
const difference = arrA.filter((x) => !arrB.includes(x)); | |
console.log('\nDifference: ', difference); |
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
#!/usr/bin/env bash | |
set -e | |
function help() { | |
local _FILE_NAME | |
_FILE_NAME=`basename ${BASH_SOURCE[0]}` | |
cat << HELP_USAGE |
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
cd /opt/f5/vpn/lib | |
sudo mv libssl.so.1.0.0 libssl.so.1.0.0_old | |
sudo mv libcrypto.so.1.0.0 libcrypto.so.1.0.0_old | |
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 libssl.so.1.0.0 | |
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 libcrypto.so.1.0.0 |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |