Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊
it's a cat's life

Daniel Lerner lernerd

🍊
it's a cat's life
  • Buenos Aires, Argentina
View GitHub Profile
View redis_mysql_dump.js
// modules
var redis = require('redis');
var Step = require('step');
// config file
var config = require('config');
// mysql client connect
var mysql = require('mysql');
var connection = mysql.createConnection({
@lernerd
lernerd / graph.js
Created Sep 12, 2012
Node resource graph
View graph.js
// modules
var http = require('http');
var url = require('url');
var fs = require('fs');
var redis = require('redis');
var _ = require('underscore');
// config file
var config = require('./config');
@lernerd
lernerd / monitor.js
Created Sep 12, 2012
Node resource monitor
View monitor.js
// modules
var fs = require('fs');
var redis = require('redis');
// config file
var config = require('./config');
// redis client connect
var client;
function redisConnect() {
@lernerd
lernerd / nginx.conf
Created Sep 10, 2012
nginx proxy server example
View nginx.conf
upstream my_upstream { #this line starts the list of real resources that exist behind the nginx server
server 127.0.0.1:1337;
server 127.0.0.1:1338; #these servers are used in the order they are defined, in round robin fashion. there's more ways of load balancing in the docs
server 127.0.0.1:1339 backup; #amazingness no.1, the keyword "backup" means that this server should only be used when the rest are non-responsive
keepalive 64;
}
server {
listen 80;
location /resource.html { #in my example the server only responds to requests for the file /request.html
You can’t perform that action at this time.