Skip to content

Instantly share code, notes, and snippets.

View jderusse's full-sized avatar

Jérémy Derussé jderusse

View GitHub Profile
@jderusse
jderusse / .multitailrc
Created September 16, 2014 12:54
Multitail template for Symfony2 logs
#---------
scheme:php:/var/log/apache/
colorscheme:php
cs_re:white,red:PHP (Stack trace:|Fatal error:).*
mcsre_s:,,bold:PHP Fatal error: (.*)
cs_re:white,red:PHP [ 0-9]+\.
cs_re:white,yellow:PHP Warning: .*
mcsre_s:,,bold:PHP Warning: (.*)
cs_re:yellow:PHP Notice: .*
mcsre_s:,,bold:PHP Notice: (.*)
#!/bin/bash
# edit /etc/default/docker to add "DOCKER_OPTS="--bip=172.17.42.1/16 --dns=172.17.42.1"
# with 172.17.42.1 => ip of your docker0 interface you can retreive with the following command
DOCKER_IP=`sudo ifconfig docker0 | awk '/inet addr/ {split ($2,A,":"); print A[2]}'`
echo "Dockers $DOCKER_IP"
docker rm -f skydns skydock
NAMESERVER=`nslookup -query=ns google.com | awk '/Server:/{split($0,A,":"); print A[2]}' | tr -d ' ' | tr -d '\t'`
echo "NameServer $NAMESERVER"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
import re
import getopt
class bcolors:
HEADER = '\033[95m'
@jderusse
jderusse / melody-silex.php
Last active August 29, 2015 14:11
melody-silex
<?php
<<<CONFIG
packages:
- silex/silex
php-options:
- "-S"
- "localhost:8000"
CONFIG;
$app = new Silex\Application();
<?php
<<<CONFIG
packages:
- "sensiolabs/security-checker: *"
CONFIG;
use Symfony\Component\Console\Application;
use SensioLabs\Security\Command\SecurityCheckerCommand;
use SensioLabs\Security\SecurityChecker;
<?php
<<<CONFIG
packages:
- "symfony/symfony-installer: *"
CONFIG;
if (PHP_VERSION_ID < 50400) {
file_put_contents('php://stderr', sprintf(
"Symfony Installer requires PHP 5.4 version or higher and your system has\n".
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
use Symfony\Component\ClassLoader\ApcClassLoader;
$env = getenv('SYMFONY_ENV') ?: 'prod';
$debug = getenv('SYMFONY_DEBUG') === '1';
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
@jderusse
jderusse / melody-extensions.php
Last active August 29, 2015 14:15
melody-extensions
<?php
<<<CONFIG
packages:
- "nikic/php-parser"
CONFIG;
/**
* Browse the current working directory to search called function.
* Then render the list of functions grouped by extension name.
*
@jderusse
jderusse / .DockerDNS.md
Last active August 29, 2015 14:16
Docker DNS

Build

docker build --rm -t dns PATH_TO_DOCKERFILE
chmod +x dns.sh
mkdir -p /opt/docker && sudo mv dns.sh /opt/docker/dns

Run

@jderusse
jderusse / .gitconfig
Created July 7, 2015 08:42
My git config
[user]
name = Jérémy Derussé
email = jeremy@derusse.com
[push]
default = simple
[alias]
st = status
ci = commit