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 configFilename = [__dirname, "/config_.json"].join(''); |
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 | |
# 设置 uid gid | |
kakaGID = grp.getgrnam('kaka')[2] | |
os.setgid(kakaGID) | |
kakaUID = pwd.getpwnam('kaka')[2] | |
os.setuid(kakaUID) | |
# geit root dir py |
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
--[[ | |
rootDir = "/opt/project" | |
this script is at /opt/project/sample.lua | |
if you want to lua sample.lua and require your custom lua module. | |
eg: | |
/opt/project/dep/lua/xxx.lua | |
/opt/project/dep/lib/lua/xxx.so # some lua module c lib | |
--]] |
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
--http://lua-users.org/lists/lua-l/2010-11/msg00241.html | |
--Mike | |
-- Allocate, traverse and collect lots of small objects. | |
-- Shows cache thrashing by the GC. Public domain. | |
local N = 14000000 | |
local T | |
local function alloc(text) |
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/python | |
#coding=utf-8 | |
import cookielib | |
import urllib | |
import urllib2 | |
import json | |
import base64 | |
from urlparse import urlparse |
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
# 又拍云 python sdk 添加更新缓存的接口 | |
def update_cache(self, urls): | |
""" | |
>>> url1 = "http://kaka.b0.upaiyun.com/kaka_001.flv" | |
>>> url2 = "http://kaka.b0.upaiyun.com/kaka_002.flv" | |
>>> urls = [url1, url2] | |
>>> res = up.update_cache(urls) | |
>>> return tuple (status, content) | |
""" |
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 python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
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 | |
# 一次向阿里云提交工单反映问题时,对方提供的测试脚本, 嘻嘻, 借用了,比我写的py脚本还方便 | |
if [ -z "$1" ]; then | |
echo | |
echo usage: $0 network-interface | |
echo | |
echo e.g. $0 eth1 | |
echo |
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
/* | |
copy from rtmpd 781 | |
*/ | |
#ifndef _LINKEDLIST_H | |
#define _LINKEDLIST_H | |
template<typename T> | |
struct LinkedListNode { | |
LinkedListNode<T> *pPrev; |
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
/* | |
* @file quick.cpp | |
* @author kaka_ace <[email protected]> | |
* @date Sun May 18 23:19:00 2014 | |
* @brief quick sort cpp with template | |
* when sort list length is less than 10, i used insert sort | |
*/ | |
#include <iostream> | |
using namespace std; |
OlderNewer