Friday, May 15, 2009

ISOSHU没有未来

爱搜书 ISOSHU,没有未来的网站。为什么?看看ALEXA上的访问分析吧。对,仔细分析一下。访问受众没有可扩展性。不能谈及未来。如果再这样下去,提前关门大吉最好。看看起点吧,受众很明确,起点比ISOSHU高很多,有经济收入的访问者是起点的最大用户。但是ISOSHU呢?看来一个网站对日志和受众的分析是最重要的。

Tuesday, May 12, 2009

乱丢东西好吗?

老婆有乱丢东西的习惯,应该吗?

Wednesday, April 29, 2009

成都-重庆

将要回重庆了,比较平静,只是在想着自己的创业之路该如何走

Wednesday, April 15, 2009

Emacs skeleton-pair Funcionality

> I have enabled skeleton-pair funcionality with what I have found in here:
> http://littlechina.org/~cmarcelo/paren-experiment.el
> It works in most modes, but in C++ mode it only works for [ and not for (,{
> or ".

Try:


(define-key c-mode-base-map (kbd "(") #'skeleton-pair-insert-maybe)
;; same for the other keys here...

or

(add-hook 'c-mode-common-hook
  #'(lambda ()
  (local-set-key (kbd "(") #'skeleton-pair-insert-maybe)
  ;; same for the other keys here...
  ))

If you don't like the way skeleton decides whether to insert a pair or
not but to insert a pair always use `insert-pair' instead of
`skeleton-pair-insert-maybe'.

Some thing others.

Monday, April 13, 2009

Aptana and XULRunner

If you want use aptana on Debian lenny, another words if you want run aptana on XULRunner 1.9 version, you will get error, so you must run aptana with XULRunner 1.8 version (year 2006 version).

Sunday, April 12, 2009

When Some Module make Error

When you disable some module, If it make some error you need enable  it again, but you found that the module build page error also, you can edit 'system' table in your MySQL database at this time. good luck.

Tuesday, April 7, 2009

Drupal , Hello Again

Drupal , best CMS framework in the world, hello again. Working with drupal again, dreaming again.

Monday, April 6, 2009

Three Days Holiday

Not good, not bad. Time is going on.

Wednesday, April 1, 2009

听范逸臣

1ting上下载了范逸臣的专辑,说实话,以前听过,不过现在听起来还是不错。

Tuesday, March 31, 2009

谷歌音乐,百度MP3

谷歌推出了免费音乐搜索,是与top100.cn合作的,在这样的形式下,百度的股价大跌5%,看来在伟大的中国,只有依靠国人的力量来击垮对手,在历史上这样的案例比比皆是,看来要进入中国市场的老外们要阅读的不是经济学人,而是中国历史,再简单不过了。

Friday, March 27, 2009

Perl never die

Hard working...

Tuesday, March 17, 2009

Linux VLM how to

创建和管理LVM

  要创建一个LVM系统,一般需要经过以下步骤:

  1、 创建分区

  使用分区工具(如:fdisk等)创建LVM分区,方法和创建其他一般分区的方式是一样的,区别仅仅是LVM的分区类型为8e。

  2、 创建物理卷

  创建物理卷的命令为pvcreate,利用该命令将希望添加到卷组的所有分区或者磁盘创建为物理卷。将整个磁盘创建为物理卷的命令为:

  # pvcreate /dev/hdb

  将单个分区创建为物理卷的命令为:

  # pvcreate /dev/hda5

  3、 创建卷组

  创建卷组的命令为vgcreate,将使用pvcreate建立的物理卷创建为一个完整的卷组:

  # vgcreate web_document /dev/hda5 /dev/hdb

  vgcreate命令第一个参数是指定该卷组的逻辑名:web_document。后面参数是指定希望添加到该卷组的所有分区和磁盘。vgcreate在创建卷组 web_document 以外,还设置使用大小为4 MB的PE(默认为4MB),这表示卷组上创建的所有逻辑卷都以 4 MB 为增量单位来进行扩充或缩减。由于内核原因,PE大小决定了逻辑卷的最大大小,4 MB 的PE决定了单个逻辑卷最大容量为 256 GB,若希望使用大于256G的逻辑卷则创建卷组时指定更大的PE。PE大小范围为8 KB 到 512 MB,并且必须总是 2 的倍数(使用-s指定,具体请参考man vgcreate)。

  4、 激活卷组

  为了立即使用卷组而不是重新启动系统,可以使用vgchange来激活卷组:

  # vgchange -a y web_document

  5、 添加新的物理卷到卷组中

  当系统安装了新的磁盘并创建了新的物理卷,而要将其添加到已有卷组时,就需要使用vgextend命令:

  # vgextend web_document /dev/hdc1

  这里/dev/hdc1是新的物理卷。

  6、 从卷组中删除一个物理卷

  要从一个卷组中删除一个物理卷,首先要确认要删除的物理卷没有被任何逻辑卷正在使用,就要使用pvdisplay命令察看一个该物理卷信息

  如果某个物理卷正在被逻辑卷所使用,就需要将该物理卷的数据备份到其他地方,然后再删除。删除物理卷的命令为

vgreduce:

  # vgreduce web_document /dev/hda1


  7、 创建逻辑卷

  创建逻辑卷的命令为lvcreate:

  # lvcreate -L1500 –nwww1 web_document

  该命令就在卷组web_document上创建名字为www1,大小为1500M的逻辑卷,并且设备入口为/dev/web_document/www1 (web_document为卷组名,www1为逻辑卷名)。如果希望创建一个使用全部卷组的逻辑卷,则需要首先察看该卷组的PE数,然后在创建逻辑卷时指定:

  # vgdisplay web_document| grep "Total PE"

  Total PE 45230

  # lvcreate -l 45230 web_document -n www1


  8、 创建文件系统

  笔者推荐使用reiserfs文件系统,来替代ext2和ext3

  创建了文件系统以后,就可以加载并使用它:

  # mkdir /data/wwwroot

  # mount /dev/web_document/www1 /data/wwwroot


  如果希望系统启动时自动加载文件系统,则还需要在/etc/fstab中添加内容:

  /dev/web_document/www1 /data/wwwroot reiserfs defaults 1 2

  9、 删除一个逻辑卷

  删除逻辑卷以前首先需要将其卸载,然后删除:

  # umount /dev/web_document/www1
  # lvremove /dev/web_document/www1
  lvremove -- do you really want to remove "/dev/web_document/www1"? [y/n]: y
  lvremove -- doing automatic backup of volume group "web_document"
  lvremove -- logical volume "/dev/web_document/www1" successfully removed


  10、 扩展逻辑卷大小

  LVM提供了方便调整逻辑卷大小的能力,扩展逻辑卷大小的命令是lvcreate:

  # lvextend -L12G /dev/web_document/www1
  lvextend -- extending logical volume "/dev/web_document/www1" to 12 GB
  lvextend -- doing automatic backup of volume group "web_document "
  lvextend -- logical volume "/dev/web_document/www1" successfully extended


  上面的命令就实现将逻辑卷www1的大小扩招为12G。

  # lvextend -L+1G /dev/web_document/www1
  lvextend -- extending logical volume "/dev/web_document/www1" to 13 GB
  lvextend -- doing automatic backup of volume group "web_document "
  lvextend -- logical volume "/dev/web_document/www1" successfully extended


  上面的命令就实现将逻辑卷www1的大小增加1G。

  增加了逻辑卷的容量以后,就需要修改文件系统大小以实现利用扩充的空间。笔者推荐使用reiserfs文件系统来替代ext2或者ext3。因此这里仅仅讨论reiserfs的情况。Reiserfs文件工具提供了文件系统大小调整工具:resize_reiserfs。对于希望调整被加载的文件系统大小:

  # resize_reiserfs -f /dev/web_document/www1

  一般建议最好将文件系统卸载,调整大小,然后再加载:

  # umount /dev/web_document/www1
  # resize_reiserfs /dev/web_document/www1
  # mount -treiserfs /dev/web_document/www1 /data/wwwroot


  对于使用ext2或ext3文件系统的用户可以考虑使用工具

  ext2resize(resize2fs)。http://sourceforge.net/projects/ext2resize

  11、 减少逻辑卷大小

  使用lvreduce即可实现对逻辑卷的容量,同样需要首先将文件系统卸载:

  # umount /data/wwwroot
  # resize_reiserfs -s-2G /dev/web_document/www1
  # lvreduce -L-2G /dev/web_document/www1
  # mount -treiserfs /dev/web_document/www1 /data/wwwroot

Monday, March 16, 2009

RPM Print Package Version

rpm -qa --qf "%{n}-%{arch}\n"
output:

filesystem-x86_64
libXau-i386
wireless-tools-x86_64
libvorbis-x86_64


rpm -qi {package-name}
rpm -qa --qf "%{n}-%{v}-%{r}.%{arch}\n" | less
rpm --querytags | less

Just a good django-appengine tut

http://www.42topics.com/dumps/django/docs.html

Friday, March 13, 2009

MySQL的性能调优工具:比mysqlreport更方便的tuning-primer.sh

LINK: http://www.chedong.com/blog/archives/001451.html
http://www.day32.com/MySQL/

Mirror With Wget

wget --mirror --limit-rate=100k --wait=1 -erobots=off --no-parent --page-requisites --convert-links --no-host-directories --cut-dirs=2 http://www.yahoo.com/mirror

Wednesday, March 11, 2009

Remove KDE and Gnome Desktop

Yeah, just remove both of them. Only Fluxbox here! Slackware (12.2). Best Linux.

VIM中的正则使用

http://blog.csdn.net/menghun_99520/archive/2008/06/06/2517970.aspx

Sunday, March 8, 2009

Python and Eventlet

http://wiki.secondlife.com/wiki/Eventlet/Documentation

Eventlet is an easy to use networking library written in Python. Eventlet is capable of supporting a large number of sockets per process by using nonblocking I/O, cooperatively multiplexing them through a single main loop. This approach allows for the implementation of massively concurrent servers which would require prohibitive amounts of memory under a traditional preemptive multi-threading or multi-process model. However, nonblocking I/O libraries such as asyncore or twisted can be difficult for programmers to use because they require the use of continuation passing style. This means code must be broken up into functions which initiate operations, and functions which will be called when the operation is complete, known as "callbacks."


Just use eventlet with a threads scanner to insert data to MySQL database.

Wednesday, March 4, 2009

PortAudio MME DirectSound

PortAudio是一个跨平台的声音驱动
MME与DirectSound是Windows平台上的,像PJSIP这样的项目默认的是使用PortAudio驱动,如果在Windows上编译,就要使用MME或者DirectSound,因为使用PortAudio可能会出现问题。

Tuesday, March 3, 2009

Work SVN on Samba


[global]
create mask = 0644
force create mode = 0600
security mask = 0555
force security mode = 0600

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

使用四年的域名停止了

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