- 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 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
import axios from "axios"; | |
const options = { | |
method: 'GET', | |
url: 'https://api.mobizon.com.br/service/Message/SendSmsMessage', | |
params: { | |
apiKey: 'BR_API_KEY' | |
}, | |
headers: { | |
cookie: 'PHPSESSID=lcr84bu8621skf2298e55rus35', |
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
curl --request POST \ | |
--url 'https://api.mobizon.com.br/service/price/listpublic?output=json&api=v1&apiKey=YOUR_API_KEY' \ | |
--header 'Content-Type: application/x-www-form-urlencoded' \ | |
--data countryA2=BR \ | |
--data currency=BRL \ | |
--data language=br |
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
[ | |
{ | |
"IBGE": 2700300, | |
"state": "Alagoas", | |
"city": "Arapiraca", | |
"provider": "Ginfes" | |
}, | |
{ | |
"IBGE": 2704302, | |
"state": "Alagoas", |
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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
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
const options = { year: "numeric", month: "long", day: "numeric" }; | |
const date = new Date(2020, 11, 31) // 2020-12-31T03:00:00.000Z | |
console.log(date.toLocaleDateString("pt-br", options)) | |
// 31 de dezembro de 2020 | |
console.log(date.toLocaleDateString("pt-br", { ...options, month: 'numeric'})) | |
// 31/12/2020 | |
const regex = /^([0-9]{4})[-](0[1-9]|1[0-2])[-](0[0-9]|1[0-9]|2[0-9]|3[0-1])/gm | |
const dateRx = new Date(2020, 11, 31) // 2020-12-31T03:00:00.000Z |
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
server { | |
server_name testdeploy.rocketseat.com.br; | |
location / { | |
proxy_pass http://127.0.0.1:3333; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; |
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
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
- Assuming you have multiple Heroku apps and Git remote like so:
development https://git.heroku.com/xxx.git (fetch)
development https://git.heroku.com/xxx.git (push)
origin [email protected]:xxx/xxx.git (fetch)
origin [email protected]:xxx/xxx.git (push)
production https://git.heroku.com/xxx.git (fetch)
production https://git.heroku.com/xxx.git (push)
staging https://git.heroku.com/xxx.git (fetch)
NewerOlder