sudo apt-get install -y php5.6-dev
sudo apt-get install -y php-pear
sudo apt-get install -y pkg-config
sudo pecl channel-update pecl.php.net
sudo pecl install mongodb
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
SELECT | |
pool_name, | |
COUNT(*) AS total, | |
(SELECT | |
COUNT(*) | |
FROM | |
radius.radippool r2 | |
WHERE r1.pool_name = r2.pool_name | |
AND NASIPAddress <> '' | |
GROUP BY pool_name) AS allocated |
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
# this should be included in .bashrc or /etc/profile | |
# this function extracts the hostname of a url | |
function h() | |
{ | |
[[ -z $1 ]] && echo "url deve ser fornecida" && return 1 | |
echo "$1" | sed -E 's#(ftp|https?)://## ; s#:[0-9]*##g ; s#/.*##' | |
} |
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
https://github.com/andrewpuch/code-commit-setup |
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
#!/bin/bash | |
function formata() | |
{ | |
local data="$1" | |
local dia="${data:(-2)}" | |
local mes="${data:5:2}" | |
local ano="${data:0:4}" |
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 getRawSql(string $sql, array $inputs) | |
{ | |
foreach ($inputs as $input) { | |
$index = strpos($sql, '?'); | |
$f = substr($sql, 0, $index); | |
$f .= is_string($input) ? "'" . $input . "'" : $input; | |
$t = substr($sql, $index + 1); | |
$sql = $f . $t; |