---|-4-|---|---|-1-|---|--- |
---|---|-3-|---|-1-|---|--- |
---|---|-3-|---|-1-|---|--- |
---|---|-3-|---|-1-|---|--- |
---|-4-|---|---|-1-|---|--- |
---|-4-|---|---|-1-|---|--- V
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 | |
// Link com maiores detalhes e exemplos: https://sounoob.com.br/curl-usando-e-abusando/ | |
// Como é um chamaga GET, não precisa passar qual o método | |
$ch = curl_init('https://viacep.com.br/ws/29730000/json/'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); | |
// Retorna como objeto. Se quiser como array é só passar `true` como segundo parâmetro |
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
-- ---------------------------- | |
-- Table structure for `countries` | |
-- ---------------------------- | |
DROP TABLE IF EXISTS `countries`; | |
CREATE TABLE `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) NOT NULL, | |
`initials` varchar(10) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; |
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
# Current datetime | |
now="$(date +'%Y%m%d-%H%M')" | |
# DB credentials | |
db_name=my_db_name | |
db_host=my_db_hostname | |
db_user=my_db_user | |
db_password=my_db_password | |
### EXAMPLE ### |
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 | |
echo 'Migrar banco de dados de Latin1 para UTF-8' | |
echo | |
echo '====================' | |
echo | |
echo 'Realizando backup do banco na pasta atual' | |
now="$(date +'%Y%m%d-%H%M')" | |
# Old DB |
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
@echo OFF | |
echo Eh preciso baixar e instalar o SED antes de continuar: https://sourceforge.net/projects/gnuwin32/files//sed/4.2.1/sed-4.2.1-setup.exe/download | |
pause | |
echo ==================== | |
echo Realizando backup do banco em 'C:\Users\(seu-usuario)' | |
set hour=%time:~0,2% | |
if "%hour:~0,1%" == " " set hour=0%hour:~1,1% |
Para iniciar o servidor local é necessário executar: $ nginx && php-fpm
O arquivo de configuração do nginx está em: /usr/local/etc/nginx/nginx.conf Os arquivos de configuração dos servidores virtuais do nginx estão em: /usr/local/etc/nginx/servers/meu-site O arquivo de configuração do php-fpm está em: /usr/local/etc/php/7.1/pool.d/www.conf
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
# No Windows o arquivo hosts pode ser encontrado em C:\Windows\System32\drivers\etc\ e deve ser editado no bloco de notas com | |
# privilégios de administrador. | |
# Adicionar o texto abaixo no arquivo hosts para bloquear os anúncios e deixar o skype mais leve. | |
# ANUNCIOS SKYPE | |
127.0.0.1 rad.msn.com | |
127.0.0.1 apps.skype.com |
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
mysqldump database_name > path-to-destination\my-bd-backup-%date:~6,4%%date:~3,2%%date:~0,2%.sql -v -h host-db -u db-username -pPassword |