Skip to content

Instantly share code, notes, and snippets.

View akerouanton's full-sized avatar

Albin Kerouanton akerouanton

View GitHub Profile
{# Variables: php_version, src_dir, packages, php_extensions, pecl_packages, php_ini_configs, php_fpm_configs -#}
FROM php:{{ php_version }}-fpm
# Install packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
{% for package in packages -%}
{{ package }} \
{% endfor -%}
&& \
@akerouanton
akerouanton / .bash_aliases
Last active February 1, 2016 09:21
Bash macro preventing composer execution with xdebug enabled
COMPOSER_PATH=`which composer`
composer() {
if ! php5query -s cli -m xdebug >/dev/null; then
$COMPOSER_PATH $@
return
fi
# Re-enable xdebug even after a ctrl-c (SIGINT)
# and clear the signal handler
trap 'sudo php5enmod xdebug; trap - INT' INT
<?php
namespace Context;
use Behat\Behat\Context\Context as ContextInterface;
use Behat\Behat\Hook\Scope\AfterScenarioScope;
use Behat\Behat\Hook\Scope\BeforeFeatureScope;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TaggedNodeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@akerouanton
akerouanton / winusb.sh
Last active August 29, 2015 14:09
Winusb shell script
#!/bin/bash
# Originated from winusb package sources (available in colingille/freshlight ppa's repository)
# Program licensed under GNU GPLv3
# Config
# Le script quitte en cas d'erreur d'une commande
set -o errexit
# Le script quitte en cas de variables non déclarée
#!/usr/bin/env python
from os import listdir,path,remove
from collections import namedtuple
from time import strptime
import datetime
import string
import shutil
BackupRange = namedtuple('BackupRange', ['daily', 'weekly', 'monthly'])
@akerouanton
akerouanton / mumble.sh
Last active December 26, 2015 17:39
Install, configure and test php-zeroc-ice.
#!/bin/bash
if [ `apachectl configtest` != "Syntax OK" ]; then
echo "Veuillez vérifier la configuration de votre serveur apache (apachectl configtest) avant de continuer."
exit 1
fi
apt-get install -y php-zeroc-ice
INSTALLED=`dpkg -s php-zeroc-ice | grep "install ok installed" | wc -l`