1 - O primeiro passo é enviar os projetos pro servidor. scp -r suap/ usuario@ip:~ Os ips podem ser 172.16.0.100 (homologação) e 172.16.0.103 (produção) 2 - Conecte-se ao servidor usando ssh. ssh usuario@ip 3 - Entre na pasta /var/opt/ se houver alguma coisa lá, envie para sua pasta home. sudo mv suap ~/suap_old/. 4 - Agora mova o suap mais atual da sua pasta home para /var/opt/. sudo mv ~/suap /var/opt/. 5 - Depois disso, altere o arquivo settings do projeto e mude as permissões de duas pastas. sudo chown -R www-data.www-data deploy/ e sudo chown -R www-data.www-data static/. 6 - Reinicie o gunicorn. sudo supervisorctl restart suap.
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
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'plural' | |
}) | |
export class PluralPipe implements PipeTransform { | |
transform(value: any, args?: any): any { | |
return value > 1 ? `${value} ${args}s` : `${value} ${args}`; | |
} |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | |
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" | |
version="1.0"> | |
<persistence-unit name="exemploPU" transaction-type="RESOURCE_LOCAL"> | |
<properties> | |
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/cadastro_cliente"/> |
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
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="author" content="Wendell Alves"/> | |
<meta name="description" content="Página que mostra detalhes sobre o Bitcoin"/> | |
<meta http-equiv="refresh" content="300"/> <!-- Atualiza a cada 5 minutos --> | |
<title>Gráfico do Bitcoin</title> | |
</head> | |
<body> |
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
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.PrintStream; | |
import java.net.Socket; | |
import java.util.Scanner; | |
public class ClienteSocketArquivo { | |
public static void main(String[] args) throws IOException { |
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
public class Ponto { | |
public static double distancia(double x1, double y1, double x2, double y2){ | |
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)); | |
} | |
} |
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
public class Primo { | |
public static boolean isPrimo(int numero){ | |
if(numero == 0 || numero == 1){ | |
return false; | |
} | |
for(int i = 2; i < numero/2; i++){ | |
if(numero % i == 0){ |