Skip to content

Instantly share code, notes, and snippets.

View jmeyo's full-sized avatar
👸
Focusing

Jean-Christophe Meillaud jmeyo

👸
Focusing
View GitHub Profile
@jmeyo
jmeyo / beaudev_docker_nginx_proxy_host.sh
Last active May 16, 2016 10:41
Beaudev simple script to add a nginx vhost reverse proxying to a docker instance
#!/bin/bash
# add vhost reverse proxy for new docker instance for nginx and restart nginx
# use like this : do_nginx_proxy_vhost subdir.example.com http://192.168.0.20:8080
function do_nginx_proxy_vhost() {
[ -z $1 -o -z $2 ] && echo "Give host and address" && return
host=$1
address=$2
[ -f /etc/nginx/sites-available/proxy_reverse_$host ] && (echo "Updating proxy for host: $host" && sudo rm /etc/nginx/sites-enabled/proxy_reverse_$host) || echo "Creating proxy for host: $host"
@jmeyo
jmeyo / install workstation
Last active July 7, 2016 18:04
Ubuntu 16.04 install
# install useful tool
sudo apt-get install links chromium-browser chromium-browser-l10n geany geany-plugins curl screen
# Setup LEMP
→ https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04
## setup mysql
sudo /usr/bin/mysql_secure_installation
sudo apt-get install php5-fpm
@jmeyo
jmeyo / gist:d2cce27d80f223ee2ebc
Last active August 29, 2015 14:02
Install server
# useful tools
sudo apt-get install links screen
# install bash-profile
curl -sSL http://raw.github.com/beaudev/bash-profile/master/install-bash-profile.sh|sudo bash
@jmeyo
jmeyo / exampleCommand.php
Created June 16, 2014 13:41
Generate invoices command
<?php
namespace Example\BackBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@jmeyo
jmeyo / gist:45320821eb58f8bda6e4
Last active August 29, 2015 14:03
Symfony Database Design

Some of the links and tool we always need when doing Database Design with Symfony

Doctrine cookbook

Generating Getter and Setter

$ php app/console doctrine:generate:entities Acme/StoreBundle/Entity/Product
@jmeyo
jmeyo / symfony-frontend-design.md
Last active August 29, 2015 14:03
Symfony Frontend Design
@jmeyo
jmeyo / gist:2dfe389af1ee1405d876
Created October 6, 2014 10:44
Git ignore global
git config --global core.excludesfile ~/work/.gitignore_global
Content of the .gitignore :
.idea
#!/bin/bash
# add vhost for a new nginx project
# use like this : do_nginx_proxy_vhost subdir.example.com http://192.168.0.20:8080
function do_nginx_new_vhost() {
[ -z $1 -o -z $2 -o "$3" ] && echo "Give name, path and hosts" && return
name=$1
path=$2
@jmeyo
jmeyo / gist:dcff1194a0a54c0c72af
Created March 23, 2015 23:52
Install imapsync debian
apt-get update && apt-get upgrade
sudo apt-get install libdate-manip-perl libterm-readkey-perl libterm-readkey-perl libdigest-hmac-perl libdigest-hmac-perl libdate-manip-perl libmail-imapclient-perl makepasswd rcs perl-doc git
cd /tmp
git clone git://github.com/imapsync/imapsync.git
cd imapsync
sh examples/install_modules_linux.sh
apt-get install build-essential
sh examples/install_modules_linux.sh
@jmeyo
jmeyo / gist:16f1b352b3b1c8b6251d
Last active August 29, 2015 14:18
PHP oldversion compilation on ubuntu server
TMPDIR=$( mktemp -d 2>/dev/null )
cd $TMPDIR
VERSION=5.3.29 #latest php released stable version in 5.3.X
wget http://in1.php.net/distributions/php-$VERSION.tar.bz2
tar xvf php-$VERSION.tar.bz2
cd php-$VERSION