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. Criar banco de dados <usuario>_access_log | |
2. Criar tabela dentro do banco de dados: log | |
3. Crie uma pasta no xampp | |
4. Crie um arquivo chamado access_log.php | |
5. Conectar ao banco de dados | |
6. Inserir registro do Log atual | |
7. Pesquisar todos os logs | |
8. Exibir todos os logs como uma tabela |
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
<?php | |
$senha = 'Of!cinaDePr0gramaçã0'; | |
$hash = password_hash($senha, PASSWORD_DEFAULT); | |
$salt = substr($hash, 7, 22); | |
$verificacao = password_verify($senha, $hash) ? "Verdadeiro" : "Falso"; | |
$teste_falso = password_verify("N@oEhaSenha", $hash) ? "Verdadeiro" : "Falso"; |
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
<?php | |
/* Turma de Oficina de Programação - 18h15 | |
29/05/2015 | |
Encurtador de URLs | |
*/ | |
$url = $_POST["url"]; | |
function imprime_url(){ |
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
<?php | |
$url = $_POST["url"]; | |
function main(){ | |
global $url; | |
$hash = get_hash($url); | |
echo $url; | |
echo "</br>"; | |
echo $hash; |
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
# -*- coding: utf-8 -*- | |
""" | |
Spyder Editor | |
This is a temporary script file. | |
""" | |
class Node: |
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
# -*- coding: utf-8 -*- | |
""" | |
Spyder Editor | |
This is a temporary script file. | |
""" | |
class Node: | |
"""Node é um container""" | |
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
<?php | |
/* | |
* Define constantes para acesso ao banco de dados | |
* | |
* DB_HOST = endereço do host | |
* | |
* DB_USER = nome do usuário | |
* | |
* DB_PASSWORD = senha do usuário |
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
colors = ['Red', 'Blue', 'Green', 'Yellow', 'Black'] | |
states = ['Andhra', 'Karnataka', 'TamilNadu', 'Kerala'] | |
neighbors = {} | |
neighbors['Andhra'] = ['Karnataka', 'TamilNadu'] | |
neighbors['Karnataka'] = ['Andhra', 'TamilNadu', 'Kerala'] | |
neighbors['TamilNadu'] = ['Andhra', 'Karnataka', 'Kerala'] | |
neighbors['Kerala'] = ['Karnataka', 'TamilNadu'] |
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
#Para usar como proxy é muito fácil: só logar no servidor com | |
$ ssh -C -N -f -o ServerAliveInterval=100 -o ServerAliveCountMax=3 -D 5000 user@server | |
#e configurar o navegador com SOCKS: localhost Porta: 5000 | |
#Pronto. Só verificar o IP em whatismyip.com.br e a localização é Canadá. | |
#Eu uso uma extensão no Chromium para mudar o proxy que é o SwitchySharp, inclusiva dá para configurá-lo | |
#para usar uma regra só para o Netflix. |
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
docker pull wordpress:latest | |
docker pull mysql:latest | |
docker run --name mysqlwp -e MYSQL_ROOT_PASSWORD=wordpressdocker \ | |
-e MYSQL_DATABASE=wordpress \ | |
-e MYSQL_USER=wordpress \ | |
-e MYSQL_PASSWORD=wordpresspwd \ | |
-d mysql | |
docker run --name wordpress --link mysqlwp:mysql -p 80:80 \ | |
-e WORDPRESS_DB_NAME=wordpress \ | |
-e WORDPRESS_DB_USER=wordpress \ |