Skip to content

Instantly share code, notes, and snippets.

View pollin14's full-sized avatar

Victor Aguilar pollin14

  • Medtrainer
  • Mexico D.F.
View GitHub Profile
@pollin14
pollin14 / RIBPS.sql
Created July 25, 2017 19:57
Query to return the size of the tables in mysql
/**
Recommended InnoDB Buffer Pool Size (RIBPS) with additional 60% (1.6 rate). The result's units is giga bytes.
Source: https://dba.stackexchange.com/questions/27328/how-large-should-be-mysql-innodb-buffer-pool-size
*/
SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM
(SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
FROM information_schema.tables WHERE engine='InnoDB') A;
@pollin14
pollin14 / cli-xdebug.sh
Last active July 27, 2017 17:43
Command to debug a php script with PHPStorm
## Execute a command with the current environment extended
##
## The PHP_IDE_CONFIG set the serverName with the value defined in PHPStorm's server seccion. With this value PHPStorm
## will not create a new server each time that lisen a new connection. The value does not affect the debug or listening
## of PHPStorm so, you can omite it securely.
##
## The second variable XDEBUG_CONFIG must be have the same value that its equivalent value in *-xdebug.ini.
##
## Set the remote ip in *-xdebug.ini is also required.
env PHP_IDE_CONFIG="serverName=vagrant" XDEBUG_CONFIG="idekey=vagrant" php shell/indexer.php
@pollin14
pollin14 / nginx-vhost.conf
Created April 25, 2018 16:53 — forked from tjstein/nginx-vhost.conf
nginx vhost config for WordPress + PHP-FPM
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}