Skip to content

Instantly share code, notes, and snippets.

View Nek-'s full-sized avatar
:octocat:

Maxime Veber Nek-

:octocat:
View GitHub Profile
@Nek-
Nek- / docker-compose.yml
Created February 11, 2019 12:58
PHP Core dump with docker explanation
version: '2'
services:
your-docker-name:
build: docker/php-fpm
ulimits:
core: 100000000000
@Nek-
Nek- / bug.php
Last active February 11, 2019 12:53
<?php
// Fichier bug.php
$x = new AppendIterator;
$x->append($x);
@Nek-
Nek- / LdapEncoder.php
Created February 7, 2019 14:22
Symfony LDAP Password encoder example (adapt to *your* LDAP)
<?php
namespace App\Security;
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
class LdapEncoder implements PasswordEncoderInterface
{
public function encodePassword($raw, $salt)
{
@Nek-
Nek- / .env
Created February 7, 2019 14:21
Symfony env config for LDAP with docker broadinstitute/slapd
LDAP_URL=ldap://ldap:389
LDAP_BASE_DN=dc=mycorp,dc=com
LDAP_SEARCH_DN=cn=admin,dc=mycorp,dc=com
LDAP_SEARCH_PASSWORD=s3cr3tpassw0rd
@Nek-
Nek- / security.yaml
Created February 7, 2019 14:20
Symfony LDAP Security config example
security:
providers:
user_provider:
ldap:
service: Symfony\Component\Ldap\Ldap
base_dn: "%env(LDAP_BASE_DN)%"
# Identifiants pour la connexion au LDAP
search_dn: "%env(LDAP_SEARCH_DN)%"
search_password: "%env(LDAP_SEARCH_PASSWORD)%"
@Nek-
Nek- / services.yaml
Created February 7, 2019 14:19
Symfony LDAP Adapter configuration example
services:
Symfony\Component\Ldap\Adapter\ExtLdap\Adapter:
arguments:
- connection_string: '%env(LDAP_URL)%'
@Nek-
Nek- / UserFixtures.php
Created February 7, 2019 14:17
LDAP Fixtures with Symfony and DoctrineFixtures
<?php
namespace App\DataFixtures;
use App\Application\Security\LdapEncoder;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Ldap\Entry;
use Symfony\Component\Ldap\Exception\LdapException;
use Symfony\Component\Ldap\Ldap;
@Nek-
Nek- / docker-compose.yml
Last active February 7, 2019 14:13
LDAP Docker Compose config
services:
ldap:
image: broadinstitute/slapd:2.0
domainname: "example.org"
hostname: "example.org"
environment:
LDAP_DEBUGLEVEL: 1
LDAP_DOMAIN: mycorp.com
LDAP_ORGANIZATION: "My Mega Corporation"
LDAP_ROOTPASS: s3cr3tpassw0rd
@Nek-
Nek- / Dockerfile
Last active January 30, 2019 10:41
Docker in docker
FROM docker:dind
RUN apk update && apk add --no-cache py-pip && apk add --no-cache bash
RUN pip install docker-compose
COPY . /project
WORKDIR /project
COPY docker/scaan/entrypoint.sh /entrypoint.sh
declare module "phaser-ce" {
export = Phaser;
}
declare class Phaser {
static VERSION: string;
static DEV_VERSION: string;
static GAMES: Phaser.Game[];
}