http://www.fredshack.com/docs/wxwidgets.html
http://www.linuxsir.org/bbs/thread305921.html
Friday, February 27, 2009
Thursday, February 26, 2009
Wednesday, February 25, 2009
Tuesday, February 24, 2009
Monday, February 23, 2009
Generating and printing a range of ip addresses
Here's a generator function that works with two strings containing valid IP
addresses.
(Note: no error checking, such as verifying that endAddr > startAddr,
endAddr < 255.255.255.255, etc.)
addresses.
(Note: no error checking, such as verifying that endAddr > startAddr,
endAddr < 255.255.255.255, etc.)
def ipAddrRange(startAddr, endAddr):
def incrAddr(addrList):
addrList[3] += 1
for i in (3,2,1):
if addrList[i] == 256:
addrList[i] = 0
addrList[i-1] += 1
def asString(addrList):
return ".".join(map(str,addrList))
startAddrList = map(int,startAddr.split("."))
endAddrList = map(int,endAddr.split("."))
curAddrList = startAddrList[:]
yield asString(curAddrList)
for i in range(4):
while curAddrList[i] < endAddrList[i]:
incrAddr(curAddrList)
yield asString(curAddrList)
for addr in ipAddrRange("10.255.255.250","11.0.0.20"):
print addr
How to configure SUSE 10 networking
Method 1: (easiest):
Method 2: (edit files directly:)
run Yast2 from console - network devices - network card
Method 2: (edit files directly:)
/etc/sysconfig/network/ifcfg-eth-id-XX... (mac address)
Sunday, February 22, 2009
XMMS2 patch?
在使用了debian和ubuntu的源码包编译xmms2之后,还是有问题,wma依然不能被解码。使用 xmms2d -vvvvv 得到信息 “buffer smaller than AVCODEC_MAX_AUDIO_FRAME_SIZE“ 以及debug消息。发现原来是因为 outbufsize 没有得到值,造成 avcodec_decode_audio2 函数不能工作。设置 outbufsize=sizeof(outbuf) 重新编译 avcodec plugin 就可以解码wma了。
Labels:
linux,
programming,
xmms2
Saturday, February 21, 2009
Disable keycap on unicode rxvt how to
Only disbale on complie, add "--disable-iso14755" to configure.
Friday, February 20, 2009
How to disable IPV6 on Debian
add fllow text
to /etc/modprobe.d/00local (creating the file if it exists).
alias net-pf-10 off
alias ipv6 off
to /etc/modprobe.d/00local (creating the file if it exists).
Saturday, February 14, 2009
Thursday, February 12, 2009
Monday, February 9, 2009
Asterisk Substrings
Substrings
returns a substring of the string foo, beginning at offset offset and returning the next length characters. The first character is at offset 0.
If offset is negative, it is taken leftwards from the right hand end of the string.
If length is omitted or is negative, then all the rest of the string beginning at offset is returned.
Examples:
${foo:offset:length}
returns a substring of the string foo, beginning at offset offset and returning the next length characters. The first character is at offset 0.
If offset is negative, it is taken leftwards from the right hand end of the string.
If length is omitted or is negative, then all the rest of the string beginning at offset is returned.
Examples:
${123456789:1} - returns the string 23456789
${123456789:-4} - returns the string 6789
${123456789:0:3} - returns the string 123
${123456789:2:3} - returns the string 345
${123456789:-4:3} - returns the string 678
Examples of use:
exten => _NXX.,1,SetVar(areacode=${EXTEN:0:3}) - get the first 3 digits of ${EXTEN}
exten => _516XXXXXXX,1,Dial(${EXTEN:3}) - get all but the first 3 digits of ${EXTEN}
exten => 100,1,SetVar(whichVowel=4)
exten => 100,2,SetVar(foo=AEIOU:${whichVowel}:1) - sets ${foo} to the single letter 'U'
Sunday, February 8, 2009
Friday, February 6, 2009
How to enable Last.fm Scrobbler With XMMS2
lenny@fred:~$ cat ~/.config/xmms2/clients/xmms2-scrobbler/config
user: your-username
password: your-password
Labels:
xmms2
Thursday, February 5, 2009
Wednesday, February 4, 2009
1ting.com音乐下载Python脚本
1ting.com 上的wma音乐是我觉得效果非常好的。所以写了个脚本。
wget http://scriptz.googlecode.com/svn/trunk/maesinfo-python/rsync-1ting.py
安装 pycurl 和 beautifulsoup ,设置 DOWNLOAD_DIR 就可以了~
如果发现不能下载,随时更新下脚本吧。或者提交个BUG。
Labels:
python
Subscribe to:
Posts (Atom)