-
Allocate swap
sudo fallocate -l 1G /swapfile
-
Alternate allocation
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
-
Perms
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 | |
function validar_cpf($cpf) | |
{ | |
// Limpa caracteres e mantem apenas dígitos | |
$cpf = preg_replace('/[^0-9]/', '', (string) $cpf); | |
// Valida tamanho | |
if (strlen($cpf) != 11) | |
return false; |
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
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
OlderNewer