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
| <?php | |
| function criptografarEmail($email) { | |
| $parts = explode("@", $email); | |
| // PRIMEIRA PARTE | |
| // Quantidade de letrar para revelar | |
| $first_last_reveal_count = 2; | |
| if(strlen($parts[0]) < 8) { | |
| $first_last_reveal_count = 1; |
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
| #source ~/.profile | |
| export GOOGLE_APPLICATION_CREDENTIALS=/Users/andregumieri/dev/canopy/ceauth/functions/staging-service-account.json | |
| # NVM | |
| export NVM_DIR=~/.nvm | |
| source $(brew --prefix nvm)/nvm.sh | |
| # Ajuste para usar o wp-cli com o MAMP | |
| PHP_VERSION=$(ls /Applications/MAMP/bin/php/ | sort -n | tail -1) | |
| export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:/Applications/MAMP/Library/bin:$PATH |
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
| (cat /etc/ssl/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:*.eu-sand.com.br')) > config.txt | |
| openssl req -x509 -nodes -sha256 -days 3650 -newkey rsa:2048 -keyout host.key -out host.cert -subj "/CN=*.eu-sand.com.br" -reqexts SAN -extensions SAN -config <(cat config.txt) |
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
| ProxyPreserveHost Off | |
| ProxyRequests Off | |
| <Location /blog> | |
| RewriteEngine On | |
| # Forces HTTPS behind elastic load balance | |
| RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
| RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] |
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
| aws s3 ls s3://domain.to.the.bucket.com/ | grep -E '\/$' |
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
| sudo apt-get install cifs-utils | |
| sudo mount.cifs //192.168.1.202/Externo\ 3TB /mnt/airport-3tb -o password="MinhaSenha!",sec=ntlm,uid=USUARIO_LOCAL |
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
| sudo dd if=/path/to/file.iso of=/dev/rdisk3 bs=4m | |
| # if - Arquivo de entrada | |
| # of - device onde vai ser escrito. Ver discos com `diskutil list`. Se o disco for /dev/disk3, por exemplo, o of fica como /dev/rdisk3. É necessário adicionar o r antes do disk. | |
| # bs - Precisa ser 4m |
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
| <?php | |
| define('TEMPO_DE_SAMPLING', 3 * 60); // em segundos | |
| define('TEMPO_DE_ESPERA', 3); // em segundos | |
| define('SLOW_QUERY_TIME', 0); // em segundos (tempo considerado uma query lenta - acima de) | |
| define('LOG_FILE', __DIR__.'/sample-slow-queries-log__' . date('Y-m-d_His') . '.log'); | |
| $START = time(); | |
| $link = mysqli_connect("localhost", "root" , "root", "database") or die (print("Erro na conexao")); | |
| $processadas = array(); |
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
| { | |
| "name": "Content script using execCommand", | |
| "version": "1", | |
| "manifest_version": 2, | |
| "description": "execCommand succeeds on background page, fails in content script. Open the console to check. http://crbug.com/395376", | |
| "background": { | |
| "scripts": ["readclipboard.js"] | |
| }, | |
| "permissions": [ | |
| "clipboardRead", |
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
| <?php | |
| function postToSlack($url, $payload) { | |
| $payload = json_encode($payload); | |
| //set POST variables | |
| // $url = 'https://hooks.slack.com/services/T00000000/B00000000/aKE6fvHgjTU7MvknZBlgvADF'; | |
| $fields = array( | |
| 'payload' => urlencode($payload) | |
| ); |
NewerOlder