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
{"lastUpload":"2020-12-04T08:32:22.967Z","extensionVersion":"v3.4.3"} |
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
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa |
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 | |
declare(strict_types = 1); | |
namespace Cellmidia\Monitoring; | |
/** | |
* Class Monitoring | |
* @package Cellmidia/Monitoring | |
* | |
* @author Domingos Teruel <mingomax@dteruel.net.br> |
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 | |
// | |
// Theory (for MySQL): http://jan.kneschke.de/projects/mysql/order-by-rand/ | |
// | |
class QuestionRepository extends EntityRepository | |
{ | |
public function findOneRandom() | |
{ | |
$em = $this->getEntityManager(); |
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
Options -MultiViews | |
RewriteBase /web | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule !\.(js|ico|gif|jpg|png|css|htm|html|txt|mp3)$ index.php [QSA,L] | |
RewriteRule .? - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
FallbackResource /index.php |
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 date_grab($str) | |
{ | |
// regex pattern will match any date formatted dd-mm-yyy or d-m-y with | |
// separators: periods, slahes, dashes | |
$p = '{.*?(\d\d?)[\\/\.\-]([\d]{2})[\\/\.\-]([\d]{4}).*}'; | |
$date = preg_replace($p, '$3-$2-$1', $str); | |
return new \DateTime($date, new DateTimeZone('America/Sao_Paulo')); | |
} |
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 | |
Class Route | |
{ | |
//TRAP REQUESTS ARRAY: | |
public static $request; | |
private static $param; | |
public static function matchURI($uri = null) { |
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
Here is a method for updating SSH private keys to work with OS X 10.9 Mavericks, using Terminal commands. | |
cd /Users/nameofuser/.ssh | |
cp id_rsa{,.bak} | |
chmod +w id_rsa id_rsa.pub | |
openssl rsa -in id_rsa -out id_rsa # decrypt in place | |
openssl rsa -in id_rsa -aes256 -out id_rsa # encrypt in place | |
ssh-keygen -y -f id_rsa > id_rsa.pub # regen public key | |
chmod 400 id_rsa id_rsa.pub | |
#source |
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 | |
/** | |
* Funcao auxiliar que processa o conteudo e retira os usuarios mencionados no post | |
* @author Domingos Teruel | |
**/ | |
function split_content_mentioneds($content) { | |
$pattern = "/((@\[(\d)+\:)([\w\d\s\_\.(\:){2}]+)\])/"; | |
//Cria os links para os perfis mencionandos | |
$html = preg_replace_callback( | |
$pattern, |
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 | |
#Variaveis de apoio | |
#IP ou URL do Servidor MySQL | |
SERVER_MYSQL = 172.1.22.49 | |
#Usuario com os privilegios de SUPER, USAGE, EXECUTE e FILE | |
USER ="usrbkp" | |
PWD = "senha" | |
#Arquivo temporario | |
FILE_TEMP = "databases" | |
#Diretório onde os backups residem |
NewerOlder