Skip to content

Instantly share code, notes, and snippets.

@gboddin
gboddin / drupal_dev_lighttpd.sh
Last active May 17, 2016 14:59
drupal_dev_lighttpd
#!/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
@gboddin
gboddin / gist:5719739
Created June 6, 2013 06:45
refactor a string in a whole project :
find lib www -type f|grep php$|while read file; do sed -i 's/\$_Request/\$_R/g' $file ; done
@gboddin
gboddin / 00percona.pref
Created November 6, 2015 18:03
Percona pin to avoid conflict
Package: *
Pin: release o=Percona Development Team
Pin-Priority: 1001
@gboddin
gboddin / apache2.4-travis-default.conf
Last active November 6, 2015 11:17
apache2.4-travis-default
<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 September 16, 2015 11:08
Spawn a quick install of d8
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 August 29, 2015 14:23
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 / systemd-nspawn.sh
Created May 27, 2015 10:25
systemd-containers-cheat-sheet
# bootstrap a rpm based distro :
yum -y --releasever=19 --nogpg --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora install systemd passwd yum fedora-release vim-minimal
systemd-nspawn -bD /srv/mycontainer
# bootstrap a deb based distro :
debootstrap --arch=amd64 unstable ~/debian-tree/
systemd-nspawn -D ~/debian-tree/
# bootstrap an arch based distro :
pacstrap -c -d ~/arch-tree/ base
@gboddin
gboddin / global-composer.sh
Last active August 29, 2015 14:19
Install composer & co globally
mkdir ~/.composer/vendor/bin -p
wget https://getcomposer.org/composer.phar -O ~/.composer/vendor/bin/composer
chmod +x ~/.composer/vendor/bin/composer
echo "export PATH=\${PATH}:~/.composer/vendor/bin" >> ~/.bashrc
. ~/.bashrc
## example :
# composer global require "phing/phing"
# boddigr@boddigr-laptop-01:~/Projects/CoreCms$ composer global require "phing/phing"
@gboddin
gboddin / -etc-tor-torrc
Created March 10, 2015 19:39
Avoid silent block from stupid ISPs with tor
VirtualAddrNetworkIPv4 10.192.0.0/10
AutomapHostsOnResolve 1
TransPort 9040
DNSPort 53535
@gboddin
gboddin / README.md
Last active August 29, 2015 14:16
Install an Ubuntu Vivid container :