This file contains hidden or 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
$ tc qdisc add dev eth0 root netem delay 250ms loss 10% rate 1mbps |
This file contains hidden or 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
$ ipfw add 1 pipe 1 ip from me to any | |
$ ipfw add 2 pipe 1 ip from any to me | |
$ ipfw pipe 1 config delay 500ms bw 1Mbit/s plr 0.1 |
This file contains hidden or 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
$ tc qdisc add dev eth0 root netem delay 50ms 20ms |
This file contains hidden or 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
$ tc qdisc add dev eth0 root netem delay 50ms 20ms distribution normal |
This file contains hidden or 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
$ tc qdisc add dev eth0 root netem reorder 0.02 duplicate 0.05 corrupt 0.01 |
This file contains hidden or 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
from collections import defaultdict | |
import random | |
from nanomsg import NanoMsgAPIError | |
from nanomsg import Socket | |
from nanomsg import SURVEYOR | |
from nanomsg import SURVEYOR_DEADLINE | |
class ServiceDiscovery(object): |
This file contains hidden or 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
import os | |
import time | |
from service_discovery import ServiceDiscovery | |
DEFAULT_PORT = 5555 | |
DEFAULT_DEADLINE = 5000 | |
DEFAULT_INTERVAL = 2000 | |
def start_discovery(port, deadline, interval): |
This file contains hidden or 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
import os | |
from threading import Thread | |
from nanomsg import REP | |
from nanomsg import RESPONDENT | |
from nanomsg import Socket | |
DEFAULT_DISCOVERY_HOST = 'localhost' | |
DEFAULT_DISCOVERY_PORT = 5555 | |
DEFAULT_SERVICE_NAME = 'foo' |
This file contains hidden or 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
require(['jsx!MyReactComponent'], function(MyReactComponent) { | |
// ... | |
}); |
This file contains hidden or 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
$ npm install -g react-tools | |
$ jsx srcDir outputDir |