Skip to content

Instantly share code, notes, and snippets.

@vanjor
vanjor / hue-pseudo-distributed.ini
Last active April 18, 2016 07:14
Hue configuration notes
#####################################
# DEVELOPMENT EDITION
#####################################
# Hue configuration file
# ===================================
#
# For complete documentation about the contents of this file, run
# $ <hue_root>/build/env/bin/hue config_help
#
@vanjor
vanjor / nginx.conf
Last active August 29, 2015 14:16
Nginx config snippets
# snippet 1
# define a new log_format which support logging requestion_time and transter time
log_format combinedio '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_length $request_time $upstream_response_time';
# snippet 2
http {
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
@vanjor
vanjor / My_log.php
Last active August 29, 2015 14:16
Log extension for Codeigniter 3 with 3 updates
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
// reference to http://tutorialcodeigniter.com/blog/log-level-fix.html
class MY_Log extends CI_Log {
public function __construct() {
parent::__construct();
//Update 1. updated log levels according to the correct order
$this -> _levels = array('ERROR' => '1', 'INFO' => '2', 'DEBUG' => '3', 'ALL' => '4');
@vanjor
vanjor / php_error_log_collect_hook.php
Last active August 29, 2015 14:16
Php synchronized log system error after request for Codeigniter 2
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* php synchronized log system error after request
* WARNING : only suitable for runing FastCGI model by PHP
* @reference: http://huoding.com/2011/04/12/63
*/
class Php_error_log_collect_hook extends MY_Log {
public static $level = array(
E_ERROR => 'Error',