- Daemonizing a container
$ docker run -d
- Leaving the container
CTRL
+P
-> q
<?php | |
include __DIR__ . '/vendor/autoload.php'; | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1', 6379); | |
$pool = new \Cache\Adapter\Redis\RedisCachePool($redis); |
awk -F\" '{arr[$6]++}END{for(a in arr) print arr[a], a}' access.log | sort -n |
description "mailhog" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
exec start-stop-daemon --start --make-pidfile --pidfile /var/run/mailhog.pid --exec /usr/local/bin/mailhog >> /var/log/mailhog.log 2>&1 |
<?php | |
$codes = array(); | |
function generateCode(){ | |
global $codes; | |
$chars = "azertyupqsdfghjklmwxcvbn23456789"; | |
$charsCount = strlen($chars) - 1; |
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
<?php | |
class EmailTestCase extends PHPUnit_Framework_TestCase { | |
/** | |
* @var \Guzzle\Http\Client | |
*/ | |
private $mailcatcher; | |
public function setUp() | |
{ |
encodeTo="UTF-8" | |
# CHANGE THE PATTERN IF NEEDED | |
for filename in ` find . -type f -name "*.php"` | |
do | |
echo $filename | |
enc=`file -bi $filename | awk -F"charset=" '{print $2}'` | |
iconv -f $enc -t $encodeTo $filename -o $filename | |
done |
<?php | |
namespace Controllers; | |
use OAuth\Common\Service\AbstractService; | |
use OAuth\Common\Storage\Session as OAuthSession; | |
class AuthController extends ControllerBase { | |
// everytime we enter the controller, then we check for login, if yes, then we dont have to access here (except logout) |
### Caching mod_headers + mod_expires | |
<IfModule mod_expires.c> | |
# Turn on Expires and set default to now | |
ExpiresActive On | |
ExpiresDefault "now" | |
# Set up caching on media files for 1 month | |
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|swf)$"> |