Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / .zshrc
Last active April 29, 2021 07:18
antigen-zsh-config
# this file go in ~/.zshrc
# if you use the debian/ubuntu package zsh-antigen :
source /usr/share/zsh-antigen/antigen.zsh
# otherwise
# source path/to/antigen.zsh
antigen use oh-my-zsh
antigen bundle git
@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 / 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 / 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 / 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 / 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 / build-httpd-2.4-el6.sh
Last active July 3, 2018 20:32
centos-httpd-2.4.x RPM gen
#!/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