Xupeng's blog

Mar 29, 2009 - 1 minute read - Comments

Build deb packcage for nginx with wsgi support under debian lenny(5.0)

I am not familiar with debian's deb package build system, so I go through the process of building deb package from source at first. Install packages needed for building nginx sudo apt-get build-dep nginx sudo apt-get install fakeroot Get source code package: mkdir $HOME/build/nginx -p cd $HOME/build/nginx apt-get source nginx Build it to generate deb package cd nginx-0.6.32 dpkg-buildpackage -rfakeroot Everything goes well, a deb package is generated under $HOME/build/nginx. Then I continue to build nginx with wsgi support Checkout latest code of ( mod_wsgi for nginx) cd $HOME/build/nginx hg clone http://hg.

Mar 29, 2009 - 1 minute read - Comments

PTY allocation request failed on channel 0

After I reboot my xen-powered [Linux VPS](http://www.linode.com/?r=cd5198f9daf6a668424aea5534f74baf343f4759), I can't ssh into it any more, it keeps saying: PTY allocation request failed on channel 0 This problem can be fixed by adding one line to /etc/fstab: none /dev/pts devpts defaults 0 0 and run "mount -a" after it is added. What confuses me is why it breaks just after I reboot it, but it works fine before, actually I didn't change anything since last time I rebooted it, maybe it's [Linode](http://www.

Jan 1, 2009 - 2 minute read - Comments

使用 PostgreSQL 时遇到的编码错误

PostgreSQL 数据库的编码为 UTF8(在 PostgreSQL 里 UNICODE 是 UTF8 的别名,二者要表达的意义是一样的),当往数据表的 varchar 字段里插入字符串的时候,遇到编码错误: test=# insert into bb values (E'\x80\x02]q\x01(U\x01aU\x06\xe5\x93\x88\xe5\x93\x88q\x02e.'); ERROR: