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
// Python: 从 C 调用 Python | |
// | |
#include <Python.h> | |
// 有长度的字符串 | |
PyObject *r = PyObject_CallFunction(func, "s#", "str", 3); | |
// 以0结尾的字符串 | |
PyObject *r = PyObject_CallFunction(func, "s", "str with NUL terminate"); | |
// 无符号整形 unsigned long | |
PyObject *r = PyObject_CallFunction(func, "k", 1988UL); | |
// 有符号整形 int |
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
# 备份表 | |
mysqldump -h 192.168.1.1 -u username -ppassword dbname table |
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
# Implementing Encrypted Home Directories | |
# http://www.linuxjournal.com/article/6481?page=0,1 | |
# sudo apt-get install loop-aes-utils | |
# modprobe aes cryptoloop | |
dd if=/dev/urandom bs=1 count=32 > key | |
dd if=/dev/zero of=a.img | |
losetup -e aes -p0 /dev/loop0 a.img < key | |
mkfs.ext2 /dev/loop0 |
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
-- Decode param=value from query string of http request uri (http.request.uri) | |
-- Author: Huang Qiangxiong (qiangxiong.huang@gmail.com) | |
-- change log: | |
-- 2010-07-01 | |
-- Just can play. | |
------------------------------------------------------------------------------------------------ | |
do | |
local querystring_decoder_proto = Proto("my_http_querystring_decoder", | |
"Decoded HTTP URI Query String [HQX's plugins]") |