This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#First you need to active profiling on your mysql | |
set profiling = 1; | |
#run some queries and see the status | |
show profiles; | |
#after that you cant set the variable and see the query full details | |
SET @query_id = 1; | |
SELECT STATE, SUM(DURATION) AS Total_R, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select count(meta_key) as cnt_key, left(meta_key, 21) as prefix from wp_cRRbrl_postmeta group by prefix limit 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'query', 'hot_cold_database_logic' ); | |
function hot_cold_database_logic( $query ){ | |
global $wpdb, $pagenow; | |
if ( strpos( $query, sprintf( '%sposts' , $wpdb->prefix ) ) === false ) return $query; | |
if ( strpos( $query, 'SQL_CALC_FOUND_ROWS' ) !== false ) return $query; | |
if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) return $query; | |
$query_posts = $query; | |
$limiters_orders = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git for-each-ref --format='%(committerdate:iso8601) %(committerdate:relative) %(refname)' --sort -committerdate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Know your need for Recommended InnoDB Buffer Pool Size | |
# innodb_buffer_pool_size | |
# https://tools.percona.com/dashboard | |
SELECT CONCAT(CEILING(RIBPS/POWER(1024,pw)),SUBSTR(' KMGT',pw+1,1)) | |
Recommended_InnoDB_Buffer_Pool_Size FROM | |
( | |
SELECT RIBPS,FLOOR(LOG(RIBPS)/LOG(1024)) pw | |
FROM | |
( | |
SELECT SUM(data_length+index_length)*1.1*growth RIBPS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set_error_handler("myErrorHandler"); | |
function myErrorHandler($errno, $errstr, $errfile, $errline){ | |
switch ($errno) { | |
case E_USER_ERROR: | |
file_put_contents('/tmp/debug.log', "[Fatal error]{$errstr} \n", FILE_APPEND); | |
break; | |
case E_USER_WARNING: | |
file_put_contents('/tmp/debug.log', "[WARNING]{$errstr} \n", FILE_APPEND); | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_abbreev_num(){ | |
case ${#1} in | |
1|2|3|4) _ABBREV_NUM=${1}B | |
;; | |
5|6) _ABBREV_NUM=$(( ($1 + 500)/ 1000 ))K | |
;; | |
7|8|9) _ABBREV_NUM=$(( ($1 + 500000) / 1000000 ))M | |
;; | |
10|11|12) _ABBREV_NUM=$(( ($1 + 500000000) / 1000000000 ))G | |
;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#see amount of memory a soft will use: | |
ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }' | |
ps --no-headers -o "rss,cmd" -C php-fpm | grep elitte_ps | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: php-5.6.0-fpm | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts php-5.6.0-fpm | |
# Description: starts the PHP FastCGI Process Manager daemon | |
### END INIT INFO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"domain":"http:\/\/www.correiodeuberlandia.apikihost.com", | |
"product":1, | |
"message":{ | |
"post":{ | |
"post_date":"2016-04-27 20:32:53", | |
"post_excerpt":"", | |
"post_type":"errors_log", | |
"post_status":"publish", | |
"post_title":"[E_ALL] - All errors and warnings (includes E_STRICT as of PHP 5.4.0)", |
OlderNewer