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
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software. | |
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module | |
# This module "secure-link" helps you to protect links from stealing away. | |
# | |
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg | |
cd /usr/src | |
wget http://nginx.org/download/nginx-1.5.13.tar.gz | |
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz |
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 | |
# Nagios monitoring script for moosefs master server | |
# Based on mfscgiserv from moosefs author | |
# hungnv 13022012 | |
import socket | |
import struct | |
import sys |
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 | |
# hungnv | |
import csv | |
L0 = [ x[0] for x in csv.reader(open('ZS_SOURCE.csv','r')) ] | |
L1 = [ x[1] for x in csv.reader(open('ZS_SOURCE.csv','r')) ] | |
L2 = [ x[2] for x in csv.reader(open('ZS_SOURCE.csv','r')) ] | |
L3 = [ x[3] for x in csv.reader(open('ZS_SOURCE.csv','r')) ] | |
#FL = [] | |
for i in xrange(len(L1)): |
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
def heart_check(target): | |
global last_check | |
if int(time() - last_check) > 5: | |
logger(ctime() + ": Perform heart check") | |
p = re.compile("[a-z0-9-.]*?\.[a-z0-9]+$") | |
domain_tld = p.findall(target)[0] | |
conn = HTTPConnection(domain_tld, timeout = 5) | |
try: | |
accepted_responses = (404, 302, 304, 301, 200) | |
conn.request('HEAD', '/') |
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
""" | |
- sequence read | |
- sequence write | |
""" | |
import os | |
import sys | |
import time | |
import errno |
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
""" | |
- sequence read | |
- sequence write | |
""" | |
import os | |
import sys | |
import time | |
import errno |
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
package vn.ethicconsultant.commons.memcachedpool2.Test; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.logging.Level; | |
import net.spy.memcached.MemcachedClient; | |
import net.spy.memcached.compat.log.Logger; | |
import net.spy.memcached.compat.log.LoggerFactory; | |
import org.apache.commons.pool2.impl.GenericObjectPoolConfig; | |
import vn.ethicconsultant.commons.memcachedpool2.MemcachedPool; |
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
GET http://localhost:8001/ net::ERR_CONNECTION_REFUSED | |
GET http://dailymotion.github.io/streams.js | |
[log] > loadSource:http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8 | |
[log] > attachMedia | |
[log] > media source opened | |
[log] > manifest loaded,5 level(s) found, first bitrate:2149280 | |
[log] > demuxing in webworker | |
[log] > switching to level 3 | |
[log] > (re)loading playlist for level 3 | |
[log] > level 3 loaded [0,63],duration:634.584 |
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
[log] > manifest loaded,3 level(s) found, first bitrate:1560000 | |
logger.js:37 [log] > demuxing in webworker | |
logger.js:37 [log] > switching to level 0 | |
logger.js:37 [log] > (re)loading playlist for level 0 | |
logger.js:37 [log] > media source opened | |
logger.js:37 [log] > demuxing in webworker | |
logger.js:37 [log] > switching to level 0 | |
logger.js:37 [log] > (re)loading playlist for level 0 | |
logger.js:37 [log] > media source closed | |
logger.js:37 [log] > level 0 loaded [0,121],duration:675.0599999999989 |