存档

2008年9月 的存档

liba52在AMD64位机器下的编译问题

2008年9月18日 评论已被关闭

http://liba52.sourceforge.net/
http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz

liba52 is a free library for decoding ATSC A/52 streams. It is released under the terms of the GPL license.
The A/52 standard is used in a variety of applications, including digital television and DVD. It is also known as AC-3.

./configure
make
/usr/bin/ld: .libs/imdct.o: relocation R_X86_64_32S against `a local symbol’ can not be used when making a shared object; recompile with -fPIC
.libs/imdct.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [liba52.la] Error 1
make[1]: Leaving directory `/home/buynintw/src/a52dec-0.7.4/liba52′
make: *** [install-recursive] Error 1

This trouble me for a week!!!
Finally I resolve it!

Just do below:
./configure –prefix=/usr  –enable-shared ‘CFLAGS=-fPIC’
make && make install

分类: OpenSource 标签:

nagios的check_ping使用

2008年9月17日 评论已被关闭

nagios的一些辅助工具很有用处,如check_ping,check_tcp等等,这里介绍一下check_ping的用法:

nagios的check_ping命令:
源码可见 nagios插件: nagios-plugins-1.4.12/plugins/check_ping.c
 
用法:
./check_ping 
Usage: check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
                     [-p packets] [-t timeout] [-L] [-4|-6]
具体如下:
-H    主机地址
-w    WARNING 状态:  响应时间(毫秒),丢包率 (%)   阀值
-c    CRITICAL状态:    响应时间(毫秒),丢包率 (%)   阀值
-p    发送的包数           默认5个包
-t     超时时间             默认10秒
-4|-6                        使用ipv4|ipv6 地址      默认ipv4
 
如:
1、正常:
./check_ping -H www.google.com -w 100.0,20% -c 200.0,50% -p 3 -t 2
PING OK – Packet loss = 0%, RTA = 1.49 ms
命令执行结果返回: echo $?   为 0
2、WARNING :
./check_ping -H www.google.com -w 0.1,20% -c 200.0,50% -p 3 -t 2
PING WARNING – Packet loss = 0%, RTA = 1.71 ms
命令执行结果返回: echo $?   为 1
3、CRITICAL
./check_ping -H www.google.com -w 0.1,20% -c 0.9,50% -p 3 -t 2
PING CRITICAL – Packet loss = 0%, RTA = 1.60 ms
命令执行结果返回: echo $?   为 2
 
返回结果为:状态  丢包率 ping响应时间
因为check_ping的返回值非常清晰,
可以在其他程序中调用check_ping命令,作为辅助的网络检测工具。
分类: OpenSource 标签:

Seattle Conference on Scalability: YouTube Scalability

2008年9月2日 评论已被关闭

YouTube 的架构扩展:
http://kylecordes.com/2007/07/12/youtube-scalability/

分类: OpenSource, python 标签:

python socket exception

2008年9月1日 评论已被关闭

python socket.errorTab’s error List

{
10048: ‘The network address is in use.’,
10054: ‘The connection has been reset.’,
10022: ‘An invalid operation was attempted.’,
10058: ‘The network has been shut down.’,
10060: ‘The operation timed out.’,
10061: ‘Connection refused.’,
10063: ‘The name is too long.’,
10064: ‘The host is down.’,
10065: ‘The host is unreachable.’,
10035: ‘The socket operation would block’,
10004: ‘The operation was interrupted.’,
10036: ‘A blocking operation is already in progress.’,
10009: ‘A bad file handle was passed.’,
10013: ‘Permission denied.’,
10014: ‘A fault occurred on the network??’
}

分类: others 标签: