Skip to content

Instantly share code, notes, and snippets.

@klclee
klclee / output.txt
Created December 21, 2017 15:23
kong curl output
[root@cec3628f4838 /]# curl localhost:8001
{"timers":{"running":0,"pending":5},"configuration":{"pg_password":"******","cassandra_lb_policy":"RoundRobin","cassandra_port":9042,"serf_path":"serf","nginx_kong_conf":"\/usr\/local\/kong\/nginx-kong.conf","admin_ssl_cert_csr_default":"\/usr\/local\/kong\/ssl\/admin-kong-default.csr","admin_ssl_port":8444,"proxy_port":8000,"admin_listen":"0.0.0.0:8001","latency_tokens":true,"ssl_cert_default":"\/usr\/local\/kong\/ssl\/kong-default.crt","cassandra_repl_factor":1,"cluster_profile":"wan","upstream_keepalive":60,"lua_package_cpath":"","cassandra_consistency":"ONE","cassandra_schema_consensus_timeout":10000,"admin_ssl_cert_default":"\/usr\/local\/kong\/ssl\/admin-kong-default.crt","pg_host":"kong.crizfo7qyx6w.eu-west-1.rds.amazonaws.com","pg_port":5432,"cluster_ttl_on_failure":3600,"nginx_err_logs":"\/usr\/local\/kong\/logs\/error.log","plugins":{"syslog":true,"ldap-auth":true,"rate-limiting":true,"correlation-id":true,"jwt":true,"request-termination":true,"runscope":tr
@klclee
klclee / nginx.conf
Last active August 29, 2015 14:07 — forked from thoop/nginx.conf
Using prerender.io and auto location in emberjs
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@klclee
klclee / nginx.conf
Last active August 29, 2015 14:07 — forked from Stanback/nginx.conf
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;
error_page 404 /404.html
index index.html;
@klclee
klclee / nginx.conf
Last active August 29, 2015 14:07 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@klclee
klclee / database.js
Last active August 29, 2015 14:06
mongoose connection util (with model look up and drop collections)
'use strict';
var mongoose = require('mongoose');
var config = require('../config/database.json');
var database = null;
var RSVP = require('rsvp');
module.exports = {
init: function(envSt) {
if (database == null) {
var env = config[envSt];
@klclee
klclee / raw.coffee
Created May 24, 2013 22:48
a straight forward plain HTML template engine with connect assets support
fs = require 'fs'
path = require 'path'
Instance = ->
# cache for templates, express 3.x doesn't do this for us
@cache = {};
@__express = middleware.bind(@)
return
@klclee
klclee / connect-assets-hbs-helpers.coffee
Created May 24, 2013 10:02
This is originally from @williamcoates on github but fix some stuff so it works.
hbs = require 'hbs'
#for css
hbs.registerHelper 'css', (file, media) ->
media = "all" unless media.substring?
st = ''
require('xml2js').parseString css(file), (err, xml) ->
st = """<link href="#{xml.link.$.href}" media="#{media}" rel="stylesheet" type="text/css"/>"""
st
@klclee
klclee / database.js
Created November 9, 2012 15:55
mongodb polling in for express.js
var mongodb = require('mongodb');
var database;
module.exports = {
init: function(host, ip, db_name){
if (database == undefined){
var serverOptions = {
'auto_reconnect': true,
'poolSize': 5
};