Skip to content

Instantly share code, notes, and snippets.

Avatar

Tristan Bessoussa tristanbes

View GitHub Profile
View gist:8580f379c1ec4ef42894
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 Apr 13, 2015
Pull Request Builder: PHP Script which triggers Ansible Tower
View github_hook.php
$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));
View build_pr.sh
#!/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
The form's client data is expected to be of type scalar, but is an instance of class Doctrine\ORM\PersistentCollection
View Condition.php
<?php
namespace GamerCertified\TeamBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* GamerCertified\TeamBundle\Entity\Conditions
*
* @ORM\Table(name="conditions")
View Car.php
<?php
[...]
class Car
{
/**
* @ORM\OneToMany(targetEntity="Condition", mappedBy="Car", cascade={"all"}, orphanRemoval=true)
*/
private $conditions;
View gist:3150616
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
View gist:3150677
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4
View ProfileTranslation.php
<?php
namespace AwesomeNamespace\AwesomeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;
/**
* @ORM\Entity
* @ORM\Table(name="profile_translations",
View Category.php
<?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
View ProfileAdmin.php
<?php
namespace AwesomeNamespace\AwesomeBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
/**
* Profile Admin
You can’t perform that action at this time.