Skip to content

Instantly share code, notes, and snippets.

@gboddin
gboddin / .drone.yaml
Created Aug 14, 2017
a sample .drone.yaml
View .drone.yaml
pipeline:
hello:
image: fpfis/php56-dev
commands:
- composer --version
- echo "Hello world from a gist"
@gboddin
gboddin / post-checkout
Last active Jun 19, 2017
docker-compose branch git post-checkout plugin
View post-checkout
#!/bin/sh
# Place me in .git/hooks/post-checkout
# Gets name from previous branch
PREVIOUS_BRANCH=$(git name-rev --name-only $1)
# Gets name from current branch
CURRENT_BRANCH=$(git name-rev --name-only $2)
if [ "${PREVIOUS_BRANCH}" != "${CURRENT_BRANCH}" ]; then
echo "Coming from ${PREVIOUS_BRANCH} to ${CURRENT_BRANCH}"
@gboddin
gboddin / makerpm.patch
Created Aug 19, 2016
php el6 patch makerpm
View makerpm.patch
--- makerpm 2016-08-18 11:07:46.000000000 +0000
+++ makerpm-patched 2016-08-19 10:10:19.415245429 +0000
@@ -42,8 +42,8 @@
Version: PVERSION
Release: PRELEASE
Group: Networking/Daemons
-Source0: http://www.php.net/distributions/php-%{PACKAGE_VERSION}.tar.gz
-Copyright: PHP License
+Source0: http://www.php.net/distributions/php-PVERSION.tar.gz
+License: PHP License
View gist:64a37357500159b8fd7231c79bc9949a
#!/bin/bash
root=$(pwd)
linker=/lib/x86_64-linux-gnu/ld-2.19.so
my_ld_library_path="${root}/lib64:${root}/usr/lib64"
while read lib_path; do
my_ld_library_path="${root}${lib_path}:${my_ld_library_path}"
done < <(cat "${root}/etc/ld.so.conf.d"/* 2> /dev/null | grep -v '^#')
my_path=${root}/bin:${root}/sbin:${root}/usr/bin:${root}/usr/sbin
LD_LIBRARY_PATH="${my_ld_library_path}" PATH=${my_path} "${root}${linker}" $@
@gboddin
gboddin / build-httpd-2.4-el6.sh
Last active Jul 3, 2018
centos-httpd-2.4.x RPM gen
View build-httpd-2.4-el6.sh
#!/bin/bash
APACHE_VERSION=2.4.23
DISTCACHE_VERSION=1.4.5-23
APR_VERSION=1.5.2
APR_UTIL_VERSION=1.5.4
echo Downloading deps :
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install tar expat-devel freetds-devel db4-devel rpm-build postgresql-devel mysql-devel sqlite-devel wget unixODBC-devel nss-devel doxygen automake libtool autoconf zlib-devel libselinux-devel libuuid-devel pcre-devel openldap-devel lua-devel libxml2-devel openssl-devel -y
wget -c https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/18/Fedora/source/SRPMS/d/distcache-${DISTCACHE_VERSION}.src.rpm
@gboddin
gboddin / 00percona.pref
Created Nov 6, 2015
Percona pin to avoid conflict
View 00percona.pref
Package: *
Pin: release o=Percona Development Team
Pin-Priority: 1001
@gboddin
gboddin / apache2.4-travis-default.conf
Last active Nov 6, 2015
apache2.4-travis-default
View apache2.4-travis-default.conf
<VirtualHost *:80>
DocumentRoot ROOT_DIRECTORY
<Directory ROOT_DIRECTORY>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
</VirtualHost>
@gboddin
gboddin / install.sh
Created Sep 16, 2015
Spawn a quick install of d8
View install.sh
composer global require drush/drush:dev-master
drush dl drupal-8.0.x
cd drupal-8.0.x-dev
drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://boddigr:xxxxxx@localhost/boddigr_d8
drupal_dev_lighttpd #see : https://gist.github.com/gboddin/20a900c2d3c65a3a6615
@gboddin
gboddin / euromillion_gen.php
Last active Aug 29, 2015
euromillion_gen.php
View euromillion_gen.php
<?php
// or how to explain to compulsive gamer that ... random is ... not that random ...
$number_of_generation = isset($_GET['nb']) ? (int) $_GET['nb'] : 2;
header('Content-Type: text/plain');
for ($iteration = 0; $iteration < $number_of_generation ; $iteration++) {
echo implode(' - ', getUniqueNumberSequence(5, 1, 50));
echo ' * ';
echo implode(' - ', getUniqueNumberSequence(2, 1, 11));
@gboddin
gboddin / drupal_dev_lighttpd.sh
Last active May 17, 2016
drupal_dev_lighttpd
View drupal_dev_lighttpd.sh
#!/bin/bash
# will start a multithreaded instance of the local installation
# for ubuntu/debian users
# apt-get install lighttpd php5-cgi
echo "Locating php-cgi :"
if which php-cgi; then
php_cgi_path=$(readlink -f `which php-cgi`)
else
exit 1
fi