Monday, June 30, 2008

Linux Network Configure Special

The following contains some steps when configuring your network manually.
all from the Manual Network Configuration.

Using ifconfig and route

Setting up your network consists of three steps. First we assign ourselves an IP address using ifconfig. Then we set up routing to the gateway using route. Then we finish up by placing the nameserver IPs in /etc/resolv.conf.

To assign an IP address, you will need your IP address, broadcast address and netmask. Then execute the following command, substituting ${IP_ADDR} with your IP address, ${BROADCAST} with your broadcast address and ${NETMASK} with your netmask:

# ifconfig eth0 ${IP_ADDR} broadcast ${BROADCAST} netmask ${NETMASK} up


Code Listing 3.11: Using ifconfig

# ifconfig eth0 ${IP_ADDR} broadcast ${BROADCAST} netmask ${NETMASK} up

Now set up routing using route. Substitute ${GATEWAY} with your gateway IP address:

Code Listing 3.12: Using route

# route add default gw ${GATEWAY}

Now open /etc/resolv.conf with your favorite editor (in our example, we use nano):

Code Listing 3.13: Creating /etc/resolv.conf

# nano -w /etc/resolv.conf

Now fill in your nameserver(s) using the following as a template. Make sure you substitute ${NAMESERVER1} and ${NAMESERVER2} with the appropriate nameserver addresses:

Code Listing 3.14: /etc/resolv.conf template

nameserver ${NAMESERVER1}
nameserver ${NAMESERVER2}

That's it. Now test your network by pinging some Internet server (like Google). If this works, congratulations then.

Monday, June 09, 2008

我看汉武大帝

这部电视剧早就看过了
周末的时候突然又找出来看了前部分
不对历史人物做评论,这是自己的一点感受:
1,姐姐的出嫁让其非常难过,同时也感受到了来自外界的压力
所以必须强大起来,结束依靠女人来换取暂时的和平的时代。
2,七国之乱和当时国内的处境-内忧外患,让他意识到必须要
削弱藩国的兵权,变成中央集权。
3,父亲的睿智,举荐儒家学者为其师,让其感受到再也不能
无为而制,需要罢黜百家学说。尊儒为大者,同时广招新人,
启用新人,大胆革新。
4,没有权利的他因为一系列的举措而变得很惨,差点丢了皇位,
这个时期很重要,他开始了狩猎生活,同时研习用兵之法。拥有
一个强大的军官学院。
5,大局观,长远的战略眼光,临事果断,善于用人让汉朝解除了
来自其他部落的困扰和侵袭。

Install Ubuntu On Dell Optiplex 745

2008-05-10 14:13:15

现有一台Dell Optiplex 745,暂时作为开发服务器。

* Install ubuntu-server

1. 下载ubuntu-server-8.04
2. 刻录至安装盘
3. 安装

* 出现的问题

1. 安装开始阶段出现因acpi无法继续情况,通过F6设置acpi=off可以解决.
2. 安装之后导致无法启动系统.因为Grub问题引起,通过重新安装Grub2来解决
3. 在进行第2步骤的sudo aptitude install grub2时会出现因为安装过程中设置安装源 范围过于严格的问题而找不到Grub2,所以应该采用系统默认的安装源范围比较好.
4. 系统运行良好,但是通过更新或者安装软件包的时候会出现
perl: warning: Setting locale failed
这时可以通过
1) $sudo apt-get remove localeconf
2) $locale-gen (e.g. locale-gen zh_CN.UTF-8)
3) $sudo dpkg-reconfigure locales
4) $sudo vi /etc/environment
并依次加入
LC_ALL="zh_CN.UTF-8"
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN.UTF-8:zh:en_US:en"
5) reboot

* 如何查看软件包被安装位置

1. dpkg -L softname