Skip to content

Instantly share code, notes, and snippets.

@dspe
dspe / RedisSAAdapter.php
Created February 13, 2018 21:41
Symfony 3 Cache Pool - SiteAccess awareness
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

Keybase proof

I hereby claim:

  • I am dspe on github.
  • I am dspe (https://keybase.io/dspe) on keybase.
  • I have a public key whose fingerprint is 731B CDC7 4E8A 985B DB53 1BD8 A1BC C8C9 186F 5E1E

To claim this, I am signing this object:

#! /usr/bin/python
"""
eZPublish token reset and password prediction PoC.
This PoC is a bit dirty, to adapt it to your needs you may have to rewrite the
following functions :
- getTokenFromMails(): used to retrieve emails and extract the reset token.
Is currently using GMail.
- crackHashes(): used to crack the retrieved tokens in order to extract
mt_rand throws. Is currently using a remote cracking machine
@dspe
dspe / varnish
Created November 5, 2014 13:58
Varnish 3.x on Mac OSX 10.9+
vim ~/.bashrc
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/:/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH"
# https://wiki.documentfoundation.org/Development/BuildingOnMac (alternatif)
sudo port install pkg-config automake py-docutils
export MACOSX_DEPLOYMENT_TARGET="10.9"
cd ../curl-7.39.0
<?php
namespace Game\Config;
use Symfony\Component\Config\Loader\FileLoader;
use Symfony\Component\Yaml\Yaml;
class ConfigLoader extends FileLoader
{
#!/bin/bash
# Fail hard and fast
set -eo pipefail
export ETCD_PORT=${ETCD_PORT:-4001}
export HOST_IP=${HOST_IP:-172.17.42.1}
export ETCD=$HOST_IP:4001
echo "[nginx] booting container. ETCD: $ETCD"
@dspe
dspe / ExportController.php
Created May 14, 2014 19:49
Controller example
<?php
namespace Ez\ExampleBundle\Controller;
use eZ\Bundle\EzPublishCoreBundle\Controller;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Serializer;
class ExportController extends Controller
{
@dspe
dspe / ezpublish.yml
Last active August 29, 2015 13:59
Languages configuration
ezpublish:
siteaccess:
default_siteaccess: fre
list:
- ezdemo_site_user
- fre
- ezdemo_site_admin
groups:
ezdemo_site_group:
- ezdemo_site_user
@dspe
dspe / site.ini
Created April 10, 2014 14:15
Legacy debug
[ContentSettings]
ViewCaching=disabled
[DebugSettings]
DebugOutput=enabled
DebugToolbar=disabled
AlwaysLog[]=warning
AlwaysLog[]=debug
AlwaysLog[]=notice
AlwaysLog[]=strict
<?php
namespace Pvr\PheelitBundle\Twig;
use Symfony\Component\DependencyInjection\ContainerInterface;
use eZ\Publish\Core\Repository\UserServiceInterface;
class PvrPheelitExtension extends \Twig_Extension
{
private $container;
private $service_user;