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 python | |
# coding=utf-8 | |
# | |
# @file gevent_zmq_redis_demo.py | |
# @author kaka_ace <[email protected]> | |
# @date Tue Oct 14 2014 | |
""" | |
fetures: there are two concurrent tasks | |
1. From Redis server, Getting the notify msg with BLPOP operation, |
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
global | |
log /dev/log local0 | |
log /dev/log local1 notice | |
chroot /var/lib/haproxy | |
stats socket /run/haproxy/admin.sock mode 660 level admin | |
stats timeout 30s | |
user haproxy | |
group haproxy | |
daemon | |
maxconn 2048 |
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 | |
echo "This is a idle script (infinite loop) to keep container running." | |
echo "Please replace this script." | |
cleanup () | |
{ | |
kill -s SIGTERM $! | |
exit 0 | |
} |
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
openssl genrsa -des3 -out smime.key 4096 | |
openssl req -new -key smime.key -out smime.csr | |
openssl x509 -req -days 3650 -in smime.csr -CA ca.crt -CAkey ca.key -set_serial 1 -out smime.crt -addtrust emailProtection -addreject clientAuth -addreject serverAuth -trustout -extfile smime.cnf -extensions smime | |
openssl pkcs12 -export -in smime.crt -inkey smime.key -out smime.p12 -chain -CAfile ca.crt |
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 | |
COOKIE_JAR="ab-cookie-jar" | |
COOKIE_NAME="_myapp_session" | |
USERNAME="[email protected]" | |
PASSWORD="password" | |
LOGIN_PAGE_URI="http://localhost:3000/users/sign_in" | |
TEST_PAGE_URI="http://localhost:3000/dashboard" | |
echo "Logging in and storing session id." |
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
function State() { | |
this.actions = {}; | |
this.subscriptions = []; | |
this.history = []; | |
} | |
State.prototype.subscribe = function(element, action, callback) { | |
this.subscriptions[action] = this.subscriptions[action] || []; | |
this.subscriptions[action].push(function(data) { | |
callback.apply(element, data); |