Skip to content

Instantly share code, notes, and snippets.

View huacnlee's full-sized avatar

Jason Lee huacnlee

View GitHub Profile
@huacnlee
huacnlee / Nginx 编译参数
Created August 28, 2010 18:09
Nginx 源代码编译参数
--with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-file-aio
$ git clone git://github.com/huacnlee/personlab.git
$ cd personlab
$ heroku create --stack bamboo-ree-1.8.7 youappname
$ git push heroku master
$ heroku rake db:create
$ heroku rake db:migrate
$ heroku rake db:seed
procedure TForm1.UDPUDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
var
iType: Integer;
pBuf: Pointer;
str: String;
buf: array[0..8191] of char;
begin
pBuf := AllocMem(AData.Size);
try
procedure TForm2.Button1Click(Sender: TObject);
var
iType: Integer;
buf: array[0..8191] of char;
UDP: TidUDPClient;
begin
UDP := TIdUDPClient.Create(nil);
try
UDP.Host := '127.0.0.1';
UDP.Port := 1108;
安转 Ruby 和 Rubygems
$ sudo apt-get install ruby1.8 ruby1.8-dev rubygems
安装 heroku 的程序
$ sudo gem install heroku
安装 Git
$ sudo apt-get install git-core
下载 PersonLab 源代码
//声明
GetLocalTime(
var lpSystemTime: TSystemTime {TSystemTime 结构}
); {无返回值}
//设置本地时间
SetLocalTime(
const lpSystemTime: TSystemTime {TSystemTime 结构}
): BOOL;
$ time /usr/libexec/path_helper
PATH="/Users/matt/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"; export PATH MANPATH="/opt/local/man:/usr/share/man:/usr/local/share/man:/usr/X11/man"; export MANPATH
@huacnlee
huacnlee / mencoder covert video for iOS and Android
Created October 20, 2010 03:36
使用 Mencoder 将视频转换为支持iOS和Android的H.264视频格式
$ sudo apt-get install mencoder
$ mencoder origin.mp4 -o new.mp4 -vf dsize=480:360:2,scale=-8:-8,harddup \
-oac faac -faacopts mpeg=4:object=2:raw:br=128 \
-of lavf -lavfopts format=mp4 -ovc x264 -sws 9 \
-x264encopts nocabac:level_idc=30:bframes=0:bitrate=512:threads=auto:turbo=1:global_header:threads=auto:subq=5:frameref=6:partitions=all:trellis=1:chroma_me:me=umh
@huacnlee
huacnlee / thread_pool.rb
Created November 15, 2010 08:36
Ruby 线程池类,用于控制同时最大允许多少个线程执行,并加入列队
require 'thread'
class ThreadPool
class Worker
def initialize
@mutex = Mutex.new
@thread = Thread.new do
while true
sleep 0.001
block = get_block
@huacnlee
huacnlee / rsync.conf
Created January 11, 2011 01:59
Rsync 简单的配置文件
pid file = /var/run/rsyncd.pid
port = 873
address = 172.28.150.23
uid = jason
gid = jason
use chroot = yes
read only = yes
hosts allow = 172.28.150.26
hosts deny = *
max connections = 20