Skip to content

Instantly share code, notes, and snippets.

View kaka19ace's full-sized avatar

kaixiang zhong kaka19ace

View GitHub Profile
var configFilename = [__dirname, "/config_.json"].join('');
#!/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
--[[
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
--]]
--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)
#!/usr/bin/python
#coding=utf-8
import cookielib
import urllib
import urllib2
import json
import base64
from urlparse import urlparse
@kaka19ace
kaka19ace / upyun_sdk_update_cache.py
Last active August 29, 2015 13:58
又拍云 python sdk 添加更新缓存的接口
# 又拍云 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)
"""
#!/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
#!/bin/bash
# 一次向阿里云提交工单反映问题时,对方提供的测试脚本, 嘻嘻, 借用了,比我写的py脚本还方便
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth1
echo
/*
copy from rtmpd 781
*/
#ifndef _LINKEDLIST_H
#define _LINKEDLIST_H
template<typename T>
struct LinkedListNode {
LinkedListNode<T> *pPrev;
/*
* @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;