Skip to content

Instantly share code, notes, and snippets.

@huglester
huglester / phpbrew_debian7
Last active August 29, 2015 13:57
phpbrew Debian 7.0 setup
# I installed phpbrew 1.3.0 since has problems with instlaing extentions using 1.3.1
# see https://github.com/c9s/phpbrew/issues/214
curl -O https://raw.github.com/c9s/phpbrew/master/phpbrew
chmod +x phpbrew
sudo cp phpbrew /usr/bin/phpbrew
phpbrew init
source ~/.phpbrew/bashrc
@huglester
huglester / gist:9610793
Created March 17, 2014 23:47
nginx.conf php_value
server {
listen 0.0.0.0;
root /var/www;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
@huglester
huglester / rc.d
Created March 18, 2014 22:09 — forked from jippi/rc.d
update-rc.d logstash-shipper defaults
update-rc.d logstash-reader defaults
<?php namespace Initr\Services;
use Illuminate\Validation\Factory as LaravelValidator;
abstract class Validator
{
protected $validator;
protected $data = array();
daemon off;
error_log stderr;
events {
worker_connections 1024;
}
http {
# As suggested in http://nginx.org/en/docs/http/websocket.html
map $http_upgrade $connection_upgrade {
@huglester
huglester / optimizations.conf
Last active August 29, 2015 14:00
MySQL optimizations
[server]
# on SSD do we need it?
tmpdir=/ram/mysql
tmp_table_size=2K
# runtime edit:
#set global net_buffer_length=1000000;
#set global max_allowed_packet=1000000000;
max_allowed_packet=100M
@huglester
huglester / vhost_add.sh
Created September 8, 2014 15:09
vhost_add.sh
#!/usr/bin/env bash
if [[ -z "$1" ]]; then
echo "example usage: /usr/local/bin/vhost_add.sh acme";
exit;
fi
block="server {
server_name $1.avek.eu;
root /var/www/vhosts/$1/web;
upstream mailcatcher {
sticky;
server appserver.domain.ch:3000 max_fails=1 fail_timeout=2s;
}
server {
listen 80;
server_name mailcatcher.domain.ch;
client_max_body_size 4G;
keepalive_timeout 5;
@huglester
huglester / Homestead.yml
Last active August 29, 2015 14:07
Homestead config
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
authorize: D:/ssh_keys/id_rsa.pub
keys:
- D:/ssh_keys/id_rsa
Package: libapache2-mod-php5 libapache2-mod-php5filter
Pin: version 5.2*
Pin-Priority: 1001
Package: php5-suhosin
Pin: version 0.9.2*
Pin-Priority: 1001
Package: php5 php5-cgi php5-cli php5-common php5-curl php5-dbg php5-dev php5-enchant php5-gd php5-gmp php5-ming php5-xcache
Pin: version 5.2*