Thursday, February 26, 2009

VC编译Debug或者Release版本

在“属性”中打开,左上角,顶部一行有按钮可以点进去,然后进行选择即可。

Wednesday, February 25, 2009

Python will change my life

Year 2009, the world, the life, will be change. Trust me.

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.)

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):

run Yast2 from console - network devices - network card

Method 2: (edit files directly:)

/etc/sysconfig/network/ifcfg-eth-id-XX... (mac address)

Look for SUSE version?

Look in /etc/SuSE-release

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了。

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

alias net-pf-10 off
alias ipv6 off

to /etc/modprobe.d/00local (creating the file if it exists).

Saturday, February 14, 2009

Baidu Bookmark Can't Work With Opera

That's truth. Bad news.

Thursday, February 12, 2009

Monday, February 9, 2009

Asterisk Substrings

Substrings 
  ${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

Hey Girl

How to enable Last.fm Scrobbler With XMMS2

lenny@fred:~$ cat ~/.config/xmms2/clients/xmms2-scrobbler/config
user: your-username
password: your-password

Thursday, February 5, 2009

保持低调

……

最近在听


播放环境 Debian Lenny, XMMS2

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。

重新编译了Ekiga

http://wiki.ekiga.org/index.php/Main_Page

升级到了 Ekiga 3.0.2

使用四年的域名停止了

没有足够的资金来支持这个域名,它停止了。在这个金融危机的大时代,我们也只能忍受,希望这可以改变我们的命运。坚定不移的向前。