2009年10月14日 星期三

CentOS PXE server setup.

Here we use FTP server.
1. Install DHCP server
yum install dhcp
vi /etc/dhcpd.conf
We can use /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample as an example or check my last post.
2. Install TFTP server
yum install tftp-server
vi /etc/xinetd.d/tftp
change the line to be: disable = no
3.Create Network installation source
yum install vsftpd
mkdir –p /var/ftp/install/centos/x86_64/5.3/
mount –t iso9660 -o loop CentOS-5.3-x86_64-bin-DVD.iso /media/cdrom/
cp –avr /media/cdrom/* /var/ftp/install/centos/x86_64/5.3/
4.start the DHCP,TFTP, VSFTP servers
/etc/init.d/dhcpd restart
/etc/init.d/xinetd restart
/etc/init.d/vsftpd restart

5. Setup tftp boot files
cp /usr/lib/syslinux/pxelinux.0 /tftpboot
mkdir –p /tftpboot/images/centos/x86_64/5.3/
cp /var/ftp/install/centos/
x86_64/5.3/images/pxeboot/vmlinuz images/centos/x86_64/5.3/
cp /var/ftp/install/centos/x86_64/5.3/images/pxeboot/initrd images/centos/x86_64/5.3/
6.Create PXE menu
cp /usr/lib/syslinux/menu.c32 /tftpboot
mkdir /tftpboot/pxelinux.cfg
touch /tftpboot/pxelinux.cfg/default
vi /tftpboot/pxelinux.cfg/default
This is a concise version. More details can be found through here.

Ubuntu PXE boot server setup.

Here I use HTTP server for the PXE boot.
1. Install Ubuntu 9.04 server.
2. Install DHCP server and modify the configure file.
apt-get install dhcp3-server
vi /etc/dhcp3/dhcpd.conf

The new dhcpd.conf should look like:
option domain-name-servers 145.253.2.75, 193.174.32.18;

default-lease-time 86400;
max-lease-time 604800;

authoritative;

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.10 192.168.0.49;
next-server 192.168.0.1;
filename "pxelinux.0";
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
}

2. Install TFTP server
apt-get install tftpd-hpa
vi /etc/default/tftpd-hpa

change the line to be: RUN_DAEMON=”yes”

mount -t iso9660 -o loop Ubuntu-install.iso /media/cdrom/

cp -r /media/cdrom/netboot/* /var/lib/tftpboot/

vi /var/lib/tftpboot/pxelinux.cfg/default

3.Install APACHE2 server:

apt-get install apache2

mkdir -p /var/www/install/ubuntu/9.04/

cp -r /media/cdrom/* /var/www/install/ubuntu/9.04/

4. Start all the servers

/etc/init.d/dhcpd restart

/etc/init.d/tftpd-hpa restart

/etc/init.d/apache2 restart

Now, we can install the ubuntu 9.04 through 192.168.0.1.

Notice: when the installation comes to select a mirror, go to the first line and input the server information for 192.168.0.1.

2009年9月12日 星期六

Ubuntu 8.04下ppstream的安装

早就听说ppstream出了linux版本,一直没有尝试。今天终于有空试一下,这里的Linux版本是Ubuntu 8.04(Hardy Heron),现在虽然9.04已经出来了,不过觉得这个版本还是用得比较舒服,也就懒得升级。
闲话少说,最开始是在ppstream官网上下载了安装包,的确能用,但是没有给playlist,就那么几个片子,很是无聊。于是google了一下,ubuntu论坛上讨论了安装Totem插件的形式,可以参考这个连接http://forum.ubuntu.org.cn/viewtopic.php?f=74&t=223582&start=0。实际上可以到:http://people.freedesktop.org/~jinghua/distfiles/gst-plugins-pps-0.0.15.12.tar.gz下载打包好的几个Deb安装文件。可惜的是,在湛卢的机器上安装后,又由Totem自动搜索安装了ffmpeg等软件包,还是不能播放rmvb格式的url。
后来想到6park上有人贴过比较详细的安装笔记,赶紧上去看看,找到了链接:http://pop.6park.com/know1/messages/32181.html。按照此文的方法,本想安装Totem插件,于是先安装了git,再
#git clone git://anongit.freedesktop.org/~jinghua/gst-plugins-pps,
可惜运行到
#./autogen.sh
的时候出错了,原来缺少好几个包,automake, libtool, gstreamer开发程序包,于是逐一apt-get install。最后都安装好了,于是
#./configure --prefix=/usr
#make
#sudo make install
可惜的是运行的时候还是说没有RealMedia的codecs。于是又google了一下,似乎大家都说要安装w32codecs,可惜现在这个包已经是找不到了。
还好,http://pop.6park.com/know1/messages/32181.html上面还介绍了mplayer下面的安装,这里不再详细叙述,就是下载http://ppshell.googlecode.com/files/pps-mplayer_install.tar.gz,然后解压、安装。
为了更方便可以下载http://ppshell.googlecode.com/files/ppshell.py,然后chmod +x ppshell.py 然后在命令行运行 ./ppshell.py,

使用方法:


进入菜单后,

1. 输入数字进入对应选项的子菜单,或者选择某个视频并显示其tvod地址(并添加到playlist.txt中)
2. b 返回上一级菜单
3. r 刷新当前级菜单的临时缓存
4. p 调用pps播放playlist.txt列表中的视频
5. a 将当前菜单中的所有视频添加到播放列表(在分类菜单中无效)
6. s 搜索视频,格式为 "s 搜索字符串",支持正则表达式

这样就可以在命令行下面使用ppstream。

2009年8月26日 星期三

MSN under Windows XP 64bit.

1) Download the full installer from Microsoft:
http://download.live.com/?sku=messenger

It should be named "wlsetup-all.exe" (not the web version "wlsetup-web.exe), try several times then you will get it.

2) Use this patcher at your own risk :-) I tried it and works..

http://oss.netfarm.it/wlm.php

3) Launch the patched installer

4) Enjoy...
Source(s):
http://www.techspot.com/blog/129/how-to-run-windows-live-messenger-on-windows-xp-x64/

http://oss.netfarm.it/wlm.php

2009年8月3日 星期一

PC MAN X简单设置。

访问简体中文bbs网站:
1.编辑-个人偏好设置-站点设置
将站点编码改为GBK

2.查看-字型 里面重新选个字体
Wenquanyi Zen Hei Mono似乎比较漂亮。

3.可以登录如瀚海星云、未明空间、水木清华等网站了。

2009年7月28日 星期二

linux批处理(二)

对一批目录中的某个文件进行相同操作。
for workdir in `cat final.txt`
do
awk '$0~/\./' $workdir/Z0.dat > raw.dat
#读入坐标及其计算结果,因为这些值都是实型,所以只需读入包含小数点的行即可。
./a.out
cp outer.dat $workdir/
done

列出某个目录下所有子目录名称

最简单的方式:
find /somepath -type d
如果要存到某个文件中:
find /somepath -type d > directory.txt
然后去掉不需要保留的部分:
awk '$0~/D/' directory.txt > temp
awk '$0~/ro/' temp > workdir.txt
rm temp

另外一个选择:
du /somepath > directory.txt
awk '$0~/D/' directory.txt > temp1
awk '$0~/ro/' temp1 > temp2
cut -b 6- temp2 > workdir.txt # 这里要检查前面的字段长度,因为du会把文件夹大小写在目录前。
rm temp1
rm temp2