Skip to content

Instantly share code, notes, and snippets.

View nerones's full-sized avatar

Nelson Efrain A. Cruz nerones

View GitHub Profile
@nerones
nerones / nginx-elasticsearch-proxy.conf
Created May 24, 2017 14:12 — forked from abrudtkuhl/nginx-elasticsearch-proxy.conf
NGINX Reverse Proxy Authentication For Elasticsearch
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost/_search?q=*
#
# is rewritten to:
#
@nerones
nerones / gist:6536bb5b8391c322f9d0d5ede69587d3
Created June 7, 2016 13:07
Example of schemacrawler to generate a ERD of a postgres database
SC_GRAPHVIZ_OPTS=-Gdpi=300 ./schemacrawler.sh -server=postgresql -c=graph -host=localhost -user=postgres -password= -database=gd -infolevel=standar -o=gd.png -outputformat=png
@nerones
nerones / gist:6778719
Created October 1, 2013 13:49
An easy way to log session data and queries with Monolog and Hooks in codeigniter. Some of the code is taken from Profiler class in the core of CI. The hook must be post_controller or post_system
class LoggerHook
{
private $CI;
function __construct()
{
$this->CI =& get_instance();
}
public function log()
{