Xupeng's blog

Feb 13, 2008 - 1 minute read - Comments

在postgresql中查看数据库/表占用的物理存储空间大小

今天需要估算项目的数据需要什么数量级的存储空间,项目使用postgresql数据库,postgresql没有提供meta信息来查看数据库/表占用的物理存储空间,不过使用间接的方法也能够得到想要的数据,以我使用的postgresql 8.3为例: 查看数据库的存储空间:

Jan 27, 2008 - 2 minute read - Comments

Tricks to use sub-domain name at hostmonster.com

I have a domain name(thinkingtracker.com) which is registered at godaddy.com, I think godaddy is one of the best domain name providers, because it’s price is relatively lower, and most important thing is that godaddy allow you to control your domain name in very detail mode, such as you can set your mx records, add/delete cname, add/delete a record, it’s very convince if you need flexibility as I need. My requirement:

  1. use my domain name(thinkingtracker.com) to setup google apps service.
  2. point one of my sub-domain to my company’s server, to serve my django powered blog.
  3. point one of my sub-domain to hostmonster.com, to test hostmonster’s service, then determine if I use it as my next virtual hosting provider.
My requirement is very simple, right? but unfortunately it is not that easy as I think at first. I first setup my google apps service, and then point one of my sub-domain name to our companny, these two steps work perfectly. but the last one make me very disappointed, there is no way to just point one sub-domain to hostmonster, the only way to use a new domain name is to add my domain name as an add-on domain name, which means that I should use hostmonster’s DNS server as my domain’s default DNS server, in that way, I cannot point any of my sub-domain to my company’s server. But I find there are tricks to satisfy my requirement:
  1. change my default DNS server to hostmonster.com’s ones, then add my domain name as an add-on domain name at hostmonster.com, now I can add as much sub-domain names as I want, but this sub-domain names can only be used at hostmonster.for example: I add cake.thinkingtracker.com and django.thinkingtracker.com
  2. change the default DNS server to godaddy’s ones, and add A records which point to hostmonster’s IP, for example: I add two A records:
    cake -> 1.1.1.1(hostmonster IP)
    django -> 1.1.1.1(hostmonster IP)
  3. add A records point to my company’s server.
ah, all works perfectly now, tastes great!

Jun 29, 2007 - 1 minute read - Comments

在postgresql中查看数据库/表占用的物理存储空间大小

因为需要使用物理硬盘,而普通用户是没有权的,google的搜索结果中有人有说更改sshd的配置,使之允许root登录就可以,这个方法看来不可行,因为我的ssh原本就是允许root登录的。

查看vmware配置文件所在目录,发现有文件/etc/vmware/vmwaregroup,尝试在其中加入新的一行:wheel,然后重新启动vmware服务就可以了。