Skip to content

Instantly share code, notes, and snippets.

View jppcel's full-sized avatar

João Paulo Polles jppcel

  • Marechal Cândido Rondon/PR
View GitHub Profile
@jppcel
jppcel / example.php
Created December 9, 2022 12:25
AI - Retorno pedindo para gerar classe PHP para Cálculo de Rating ELO
<?php
// eu adicionei
require("ratingcalculator.php")
// Cria uma instância da classe RatingCalculator
$calculator = new RatingCalculator();
// Calcula a movimentação de rating para os jogadores A e B
$results = $calculator->calculate(1500, 1600, 16, 24);
@jppcel
jppcel / gist:9b057ca1ea0e2607b54c86d1da9b265f
Created October 20, 2020 15:04
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
service WowzaStreamingEngineManager restart
service WowzaStreamingEngine restart
@jppcel
jppcel / gist:775137132b7ac38e5d17b10a15ade374
Created October 20, 2020 15:04
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
nano /usr/local/WowzaStreamingEngine/manager/conf/tomcat.properties
# Altere as configurações padrões de
#httpsPort=8090
#httpsKeyStore=conf/certificate.jks
#httpsKeyStorePassword=[password]
#httpsKeyAlias=[key-alias]
# Para:
@jppcel
jppcel / gist:9ae7b277cebf646b0a3bffcdc316d8d0
Created October 20, 2020 15:01
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
<SSLConfig>
<KeyStorePath>${com.wowza.wms.context.VHostConfigHome}/conf/SUB.DOMAIN.EXT.jks</KeyStorePath>
<KeyStorePassword>secret</KeyStorePassword>
<KeyStoreType>JKS</KeyStoreType>
<DomainToKeyStoreMapPath></DomainToKeyStoreMapPath>
<SSLProtocol>TLS</SSLProtocol>
<Algorithm>SunX509</Algorithm>
<CipherSuites></CipherSuites>
<Protocols></Protocols>
<AllowHttp2>false</AllowHttp2>
@jppcel
jppcel / gist:b6dcd20c42413657b0673362fa61004d
Created October 20, 2020 15:00
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
<SSLConfig>
<KeyStorePath>${com.wowza.wms.context.VHostConfigHome}/conf/keystore.jks</KeyStorePath>
<KeyStorePassword>[password]</KeyStorePassword>
<KeyStoreType>JKS</KeyStoreType>
<DomainToKeyStoreMapPath></DomainToKeyStoreMapPath>
<SSLProtocol>TLS</SSLProtocol>
<Algorithm>SunX509</Algorithm>
<CipherSuites></CipherSuites>
<Protocols></Protocols>
<AllowHttp2>false</AllowHttp2>
@jppcel
jppcel / gist:aabacea357a6c58dfc5c32f629dcefb0
Created October 20, 2020 14:58
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
cd /usr/local/WowzaStreamingEngine/conf
nano VHost.xml
@jppcel
jppcel / gist:7096b85e6d9bffeff246f60a55b39774
Created October 20, 2020 14:57
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
cat /usr/local/WowzaStreamingEngine/conf/jksmap.txt
# Este comando deve mostrar algo parecido com isto: SUB.DOMAIN.EXT={"keyStorePath":"/usr/local/WowzaStreamingEngine/conf/SUB.DOMAIN.EXT.jks", "keyStorePassword":"secret", "keyStoreType":"JKS"}
@jppcel
jppcel / gist:09e4f2855391ba7ed6edd45190e44efc
Created October 20, 2020 14:55
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
# Vá para o diretório do Wowza
cd /usr/local/WowzaStreamingEngine/lib
# Baixe o arquivo java no diretório lib
wget https://github.com/robymus/wowza-letsencrypt-converter/releases/download/v0.1/wowza-letsencrypt-converter-0.1.jar
# Crie o arquivo JKS
# Caso você tenha o executável java em suas variáveis de ambiente
java -jar wowza-letsencrypt-converter-0.1.jar -v /usr/local/WowzaStreamingEngine/conf/ /etc/letsencrypt/live/
# Caso não o possua
@jppcel
jppcel / gist:e8dd246c7b4ef4a7085fcd3c3e4501f0
Last active February 10, 2021 12:48
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
# crontab -e
@weekly root cd /opt/letsencrypt && git pull >> /var/log/letsencrypt/letsencrypt-auto-update.log
@monthly root certbot certonly --quiet --standalone --renew-by-default -d <DOMINIO> >> /var/log/letsencrypt/letsencrypt-auto-update.log
@jppcel
jppcel / gist:505f6c45e8bfcd52819424c6d71d7dc7
Last active August 2, 2021 13:26
Ativando o Let's Encrypt (SSL) no Wowza 4.8.0 (Ubuntu 20.04)
# atualize o servidor
apt-get update && apt-get upgrade -y
apt-get install git -y
# clone o repositório do certbot e o configure
git clone https://github.com/certbot/certbot /opt/letsencrypt
cd /opt/letsencrypt
# instale o certbot também por linha de comando
apt install certbot python3-certbot-nginx -y
# crie o certificado SSL. troque SUB.DOMAIN.EXT para o domínio que deve já estar apontado para seu servidor e com a propagação concluída
sudo certbot certonly --standalone -d SUB.DOMAIN.EXT