Skip to content

Instantly share code, notes, and snippets.

View tristanbes's full-sized avatar

Tristan Bessoussa tristanbes

View GitHub Profile
failed: [5.135.xx.xx] => (item=ldap) => {"changed": true, "cmd": ["java", "-jar", "/opt/jenkins/jenkins-cli.jar", "-s", "http://localhost:8081", "install-plugin", "ldap"], "delta": "0:00:00.095061", "end": "2014-08-10 12:18:26.911847", "item": "ldap", "rc": 1, "start": "2014-08-10 12:18:26.816786"}
stderr: Exception in thread "main" java.io.IOException: Failed to connect to http://localhost:8081/
at hudson.cli.CLI.getCliTcpPort(CLI.java:266)
at hudson.cli.CLI.<init>(CLI.java:126)
at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
at hudson.cli.CLI._main(CLI.java:459)
at hudson.cli.CLI.main(CLI.java:382)
Suppressed: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
@tristanbes
tristanbes / github_hook.php
Created April 13, 2015 10:25
Pull Request Builder: PHP Script which triggers Ansible Tower
$payload = $_POST['payload'];
$json = json_decode($payload);
if (isset($json->action)) {
$action = $json->action;
$prNumber = $json->pull_request->number;
switch ($action) {
case 'opened':
exec_script('scripts/build_pr.sh', array($prNumber, true));
#!/bin/bash
YPROX_PR=$1
DB_RESET=$2
echo "Building "$YPROX_PR
# build the new PR
cd /var/www/gh_hook/scripts
@tristanbes
tristanbes / Condition.php
Created May 22, 2012 15:11
The form's client data is expected to be of type scalar, but is an instance of class Doctrine\ORM\PersistentCollection
<?php
namespace GamerCertified\TeamBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* GamerCertified\TeamBundle\Entity\Conditions
*
* @ORM\Table(name="conditions")
<?php
[...]
class Car
{
/**
* @ORM\OneToMany(targetEntity="Condition", mappedBy="Car", cascade={"all"}, orphanRemoval=true)
*/
private $conditions;
Failed loading xdebug.so: dlopen(xdebug.so, 9): image not found
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/zend/lib/php_extensions/xdebug.so' -
dlopen(/usr/local/zend/lib/php_extensions/xdebug.so, 9): no suitable image found.
Did find: /usr/local/zend/lib/php_extensions/xdebug.so: mach-o, but wrong architecture in Unknown on line 0
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4
<?php
namespace AwesomeNamespace\AwesomeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;
/**
* @ORM\Entity
* @ORM\Table(name="profile_translations",
<?php
namespace AwesomeNamespace\AwesomeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* AwesomeNamespace\AwesomeBundle\Entity\Profile
<?php
namespace AwesomeNamespace\AwesomeBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
/**
* Profile Admin