So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])
This file contains 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
// To start vlc with telnet remote control: | |
// ./VLC --extraintf rc --rc-host 0.0.0.0:3000 | |
// | |
// To connect to multiple vlc's | |
// node vlcrc.js host1:3000 host2:3000 | |
var net = require('net'); | |
var readline = require('readline'); | |
//addresses of servers |
This file contains 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
[api]: New apis / changes to apis | |
[test]: Update test/* files | |
[dist]: Changes to submodules, version bumps, updates to package.json | |
[minor]: Small changes | |
[doc]: Updates to documentation | |
[ux]: Updates to UX | |
[fix]: Bug fixes | |
[bin]: Update binary scripts associated with the project | |
[merge]: Resolved git merge from upstream or otherwise | |
[refactor]: Refactor of existing code with no external API changes |
This file contains 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
var events = require('events'), | |
util = require('util'); | |
var MockReadWriteStream = helpers.MockReadWriteStream = function () { | |
// | |
// No need to do anything here, it's just a mock. | |
// | |
}; | |
util.inherits(MockReadWriteStream, events.EventEmitter); |
This file contains 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
module['exports'] = function (hook) { | |
var rest = require('restler'), | |
moment = require('moment'); | |
var myGender = 'male', | |
myCountry = 'United States', | |
myDOB = '1986-05-01'; | |
var currentDate = moment(); |
This file contains 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
node_modules | |
secrets.js |
This file contains 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
var io = require('socket.io-client'); | |
var sock = io.connect('http://localhost:8080'); | |
var dnode = require('dnode'); | |
var Stream = require('stream'); | |
var stream = new Stream; | |
stream.writable = true; | |
stream.readable = true; | |
stream.write = function (buf) { | |
sock.emit('message', String(buf)); |
This file contains 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
app.router.get('/:slug', function (slug) { | |
var that = this; | |
Shortlink.find( {slug: slug} , function (err, shortlink) { | |
if (err) { throw new(Error)(err) } | |
console.log( that.req ); // This returns "undefined" and I think I understand why. | |
// How do I access request and response objects from within | |
// an anon callback like this one? | |
}); | |
}); |
This file contains 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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains 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/bash | |
LINES=$(tput lines) | |
COLUMNS=$(tput cols) | |
clear | |
declare -A snowflakes | |
declare -A lastflakes |
NewerOlder