Skip to content

Instantly share code, notes, and snippets.

@gboddin
gboddin / -etc-tor-torrc
Created Mar 10, 2015
Avoid silent block from stupid ISPs with tor
View -etc-tor-torrc
VirtualAddrNetworkIPv4 10.192.0.0/10
AutomapHostsOnResolve 1
TransPort 9040
DNSPort 53535
@gboddin
gboddin / global-composer.sh
Last active Aug 29, 2015
Install composer & co globally
View global-composer.sh
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
systemd-containers-cheat-sheet
View systemd-nspawn.sh
# 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 Apr 29, 2021
antigen-zsh-config
View .zshrc
# 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
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
@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 / 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 / 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 / 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 / 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