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
#!/bin/bash | |
sudo apt-get update -y | |
sudo apt-get install apache2 php7.4 libapache2-mod-php7.4 php7.4-common php7.4-curl php7.4-intl php7.4-mbstring php7.4-json php7.4-xmlrpc php7.4-soap php7.4-mysql php7.4-gd php7.4-xml php7.4-cli php7.4-zip wget mysql-client unzip git binutils ruby -y | |
sudo systemctl start apache2 | |
sudo systemctl enable apache2 | |
sudo systemctl restart apache2 | |
sudo wget https://s3.sa-east-1.amazonaws.com/pages.cloudtreinamentos.com/aws/MCU2.zip | |
sudo unzip -o MCU2.zip -d /var/www/html/ | |
sudo rm /var/www/html/index.html | |
sudo chmod -R 777 /var/www/html |
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 email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.mime.base import MIMEBase | |
from email.mime.multipart import MIMEMultipart | |
from email import encoders | |
import smtplib | |
def extrair_email(text: str) -> list: | |
"""### Retorna os e-mails recuperados | |
Validação / Busca de e-mails com o padrão RFC2822 |
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 re | |
import random | |
REGRESSIVOS = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]# constante = variável que nunca vai mudar | |
def valida(cnpj): | |
cnpj = apenas_numeros(cnpj) |
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 re | |
REGRESSIVOS = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]# constante = variável que nunca vai mudar | |
def valida(cnpj): | |
cnpj = apenas_numeros(cnpj) | |
try: | |
if eh_sequencia(cnpj): |
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
""" | |
Faça uma lista de tarefas com as seguintes opções: | |
adicionar tarefa | |
listar tarefas | |
opção de desfazer (a cada vez que chamarmos, desfaz a última ação) | |
opção de refazer (a cada vez que chamarmos, refaz a última ação) | |
['Tarefa 1', 'Tarefa 2'] | |
['Tarefa 1'] <- Desfazer | |
['Tarefa 1', 'Tarefa 2'] <- Refazer | |
input <- Nova tarefa |
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 time import sleep | |
from selenium.webdriver import Chrome | |
chrome = Chrome() | |
chrome.get('https://selenium.dunossauro.live/aula_05.html') | |
sleep(1) | |
# names= nome, email, senha, telefone, btn |
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 pegar todos os links das aulas | |
{'nome da aula': 'link da aula' } | |
2 navegar até o exercicio 3 | |
achar a url do ex 3 e ira até la | |
''' | |
from email.quoprimime import body_check | |
from importlib.resources import path | |
from time import sleep |
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 selenium.webdriver import Firefox | |
from time import sleep | |
url = 'https://curso-python-selenium.netlify.app/exercicio_02.html' | |
driver = Firefox() | |
driver.get(url) | |
sleep(4) | |
list_ps = driver.find_elements_by_tag_name('p') | |
# achando o p que tem o número esperado: |
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 selenium.webdriver import Chrome | |
from time import sleep | |
url = 'https://curso-python-selenium.netlify.app/exercicio_01.html' | |
browser = Chrome() | |
browser.get(url) | |
sleep(4) | |
titulo = browser.find_element_by_tag_name('h1') # pega o titulo (no text) | |
dicio = {titulo.text: 'Vazio'} # cria um dict com o titulo |
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
''' | |
a função velocidade recebe outra função como parâmetro | |
a função velocidade tem uma função chamada interna que | |
recebe argumentos não nomeados e argumentos nomeados (não sabendo a qtd de argumentos) | |
e a funcao interna vai retornar e executar a funcao que vem do parametro da funcao velocidade | |
e a funcao velocidade vai retornar a interna sem executar | |
def velocidade(funcao): | |
def interna(*args, **kwargs): | |
funcao(*args, **kwargs) |
NewerOlder