Thursday, December 25, 2008

Watch Youtube Video on Centos 5

Download:

flash-plugin-10.0.15.3-release.i386.rpm

from adobe website.

Install:

rpm -Uvh flash-plugin-10.0.15.3-release.i386.rpm

Close all firefox windows.

Restart firefox, you should be able to watch the video on youtube website.

Wednesday, December 24, 2008

Static IP configuration on Ubuntu 8.10ic

1. Edit interfaces file

sudo gedit /etc/network/interfaces

add lines:

auto eth0
iface eth0 inet static
address 192.168.0.108
netmask 255.255.255.0
gateway 192.168.0.1

If there is a line like:

iface eth0 inet dhcp

need to add # before the line to comment it.

2. Edit file /etc/resolv.conf

sudo gedit /etc/resolv.conf

Add lines:

search 64.59.144.93
nameserver 64.59.144.92

These are DNS, that might be different for different ISP

If you do only step 1, not step 2, you can only visite web site by using number IP not domain name.

3. Restart network

sudo /etc/init.d/networking restart

You should see the static IP you setup.

Note: the graphic thing (for net work configure) on the top bar is not working even I set up everything there.

Install Eclipse 3.4 (jee) in Ubuntu 8.10

Download packages

Java - Application--Add/Remove -- Programming to get the latest version, as the time this is written, the version is 1.6
There are many articles about the java installation.

Eclipse - Eclipse website -eclipse-jee-ganymede-SR1-linux-gtk.tar.gz
I download this one is because no plugin is required to run with Apache-tomcat

Tomcat -- apache website - the version i got is apache-tomcat-6.0.18.tar.gz

Install packages

Sun's Java JDK: Many ways to do this. there are many different way on the website. I will put one here later.

Tomcat:

tar xzf apache-tomcat-6.0.18.tar.gz
sudo mv apache-tomcat-6.0.18 /usr/local
cd /usr/local
sudo chown -R root:root apache-tomcat-6.0.18
sudo chmod -R +r apache-tomcat-6.0.18
sudo chmod +x `sudo find apache-tomcat-6.0.18 -type d`
sudo ln -s apache-tomcat-6.0.18 tomcat

Edit tomcat users:
sudo gedit /usr/local/tomcat/conf/tomcat-users.xml

And add an admin and your username and password:


user name="admin" password="admin" roles="manager,admin"
user name="yourname" password="blah" roles="manager,admin"
Eclipse:
Extract the eclipse download and move to opt.

tar zxvf eclipse-jee-ganymede-SR1-linux-gtk.tar.gz
sudo mv eclipse /opt/eclipse
cd /opt
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
sudo chmod +x `sudo find eclipse -type d`

Then create an eclipse executable in your path

sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudo gedit /usr/bin/eclipse

With this contents

#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*

Then create a gnome menu item

sudoedit /usr/share/applications/eclipse.desktop

With this contents

[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true

Configure

You now have a working eclipse.
But run this command first to initialise the set up.

/opt/eclipse/eclipse -clean

Then from here on you can run from the menu item
applications/programming/eclipse

Eclipse 3.4 (Ganymede) on Ubuntu

Eclipse Ganymede (the successor to Europa) has nice features that we are missing out on (Mylyn, inline renames, etc.).

JDK
Make sure that it is at least Java 5.

sudo apt-get install openjdk-6-jdk

Then update your ~./bashrc file, appending the JAVA_HOME (adjust this if you use a different JDK).

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/

Get Ganymede

wget http://ftp.osuosl.org/pub/eclipse/technology/epp/downloads/release/ganymede/R/eclipse-java-ganymede-linux-gtk.tar.gz
tar xzvf eclipse-java-ganymede-linux-gtk.tar.gz
mv eclipse eclipse3.4

We should be ready to go:

eclipse3.4/eclipse

And your nice new Eclipse is up and running.

Suggested Plugins
Eclipse is great because it has so many plugins. I even use it as my default Python editor. If you go to Help > Software Updates, you will see a vastly improved update dialog (the previous one was painful).


Update: As Scott points out in the comments, there is an open request on launchpad to include a more recent version of Eclipse in the Ubuntu repositories: https://bugs.edge.launchpad.net/ubuntu/+source/eclipse/+bug/123064

Tuesday, December 23, 2008

Install MySQL 5.0.67 on Ubuntu 8.10

Ubuntu 8.10下安装MySQL数据库是非常简单的。

下面是在Ubuntu 8.10下完成安装的MySQL,MySQL 服务器应该自动启动。您可以在终端提示符后运行以下命令来检查 MySQL 服务器是否正在运行:(见图1)

sudo netstat -tap | grep mysql

当您运行该命令时,您可以看到类似下面的行:

linuxidc@linuxidc-laptop:~$ sudo netstat -tap | grep mysql

[sudo] password for linuxidc:
tcp 0 0 localhost:mysql *:* LISTEN 7283/mysqld
linuxidc@linuxidc-laptop:~$

要在Ubuntu 8.10下安装 MySQL,我们可以在终端命令行下输入下列命令:(如图2)


sudo apt-get install mysql-server mysql-client



附过程:

linuxidc@linuxidc-laptop:~$ sudo apt-get install mysql-server mysql-client
[sudo] password for linuxidc:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会安装下列额外的软件包:
libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl
mysql-client-5.0 mysql-server-5.0
建议安装的软件包:
dbishell mysql-doc-5.0 tinyca
下列【新】软件包将被安装:
libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client
mysql-client-5.0 mysql-server mysql-server-5.0
共升级了 0 个软件包,新安装了 8 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
需要下载 35.8MB 的软件包。
解压缩后会消耗掉 109MB 的额外空间。
您希望继续执行吗?[Y/n]

当然选择Y了,在安装过程中会有软件包设置,输入root密码及再次确认。然后确定(见图3)。


如果服务器不能正常运行,您可以通过下列命令启动它:

sudo /etc/init.d/mysql restart

* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.

配置 MySQL 的管理员密码

sudo mysqladmin -u root password newpassword

配置MySQL

注意,MySQL缺省是只允许本地访问的,如果你要其他机器也能够访问的话,那么需要改变/etc/mysql/my.cnf配置文件了!

默认的MySQL安装之后根用户是没有密码的,所以首先用根用户进入:

$mysql -u root

在这里之所以用-u root是因为我现在是一般用户(firehare),如果不加-u root的话,mysql会以为是firehare在登录。注意,我在这里没有进入根用户模式,因为没必要。一般来说,对mysql中的数据库进行操作, 根本没必要进入根用户模式,只有在设置时才有这种可能。

如果你是用的root用户进入时则可以不要切换用户,直接进入第三步

进入mysql之后,最要紧的就是要设置Mysql中的root用户密码了,否则,Mysql服务无安全可言了。

mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "123456";

注意,我这儿用的是123456做为root用户的密码

用root用户建立你所需要的数据库。我这里就以xoops为例:

mysql>CREATE DATABASE xoops;mysql>GRANT ALL PRIVILEGES ON xoops.* TO xoops_root@localhost IDENTIFIED BY "654321";

这样就建立了一个xoops_roots的用户,它对数据库xoops有着全部权限。以后就用xoops_root来对xoops数据库进行管理,而无需要再用root用户了,而该用户的权限也只被限定在xoops数据库中。

如果你想进行远程访问或控制,那么你要做两件事:

其一:

mysql>GRANT ALL PRIVILEGES ON xoops.* TO xoops_root@"%" IDENTIFIED BY "654321";

允许xoops_root用户可以从任意机器上登入MySQL。

测试通过了,可是不知道为什么在访问的速度上很慢,可能是UBUTN的内存只有100M的原因,哈哈!!!!



$sudo gedit /etc/mysql/my.cnf

老的版本中

>skip-networking => # skip-networking

新的版本中

>bind-address=127.0.0.1 => bind-address= 你机器的IP

这样就可以允许其他机器访问MySQL了。

DESTOP版下安装MYSQLCC

apt-get install mysqlcc

gedit /usr/share/applications/MySQLCC.desktop

Insert the following lines into the new file

将下列语句插入新文件

[Desktop Entry]

Name=MySQLCC

Comment=MySQLCC

Exec=mysqlcc

Icon=/usr/share/pixmaps/mysqlcc.xpm

Terminal=false

Type=Application

Categories=Application;System;

这样就可以使用MYSQLCC来操作数据库了。



Install MySQL 5.0.51b on Ubuntu 8.10

Problem

While install MySQL 5.0.51b for Linux on Ubuntu 8.10
when I execte configure:

sudo ./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --sysconfdir=/etc

got error message:

checking for tgetent in -ltermcap... no
checking for termcap functions library... configure: error: No curses/termcap library found

Solution

need to install ncurses-5.2.tar.gz,after install, set the path in the configure parameter

or maybe the ncurses is already installed, so just add path.


add

--with-named-curses-libs=/usr/lib/libncursesw.so.5

the it looks like this:

sudo ./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --sysconfdir=/etc --with-named-curses-libs=/usr/lib/libncursesw.so.5

Install Apach Tomcat 6 on Ubuntu 8.10

Before we install Tomcat we need to find out if we already have installed Java. Let’s assume that we are trying to install Tomcat we’ve already installed java, but if we aren’t sure we can check with the dpkg command like this:

dpkg –get-selections | grep sun-java

This should give us this output if we already installed java:

sun-java6-bin                                   install
sun-java6-jdk install
sun-java6-jre install

If that command has no results, we’ll want to install the latest version with this command:

sudo apt-get install sun-java6-jdk

Installation

Now we’ll download and extract Tomcat from the apache site. We should check to make sure there’s not another version and adjust accordingly.

wget http://apache.hoxt.com/tomcat/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.tar.gz

tar xvzf apache-tomcat-6.0.14.tar.gz

The best thing to do is move the tomcat folder to a permanent location. I chose /usr/local/tomcat.

sudo mv apache-tomcat-6.0.14 /usr/local/tomcat

Tomcat requires setting the JAVA_HOME variable. The best way to do this is to set it in the .bashrc file.

The better method is editing the .bashrc file and adding the bolded line there. We’ll have to logout of the shell for the change to take effect.

vi ~/.bashrc

Add the following line:

export JAVA_HOME=/usr/lib/jvm/java-6-sun

At this point we can start tomcat by just executing the startup.sh script in the tomcat/bin folder.

Automatic Starting

To make tomcat automatically start when we boot up the computer, we can add a script to make it auto-start and shutdown.

sudo vi /etc/init.d/tomcat

Now paste in the following:

# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in
start)
sh /usr/local/tomcat/bin/startup.sh
;;
stop)
sh /usr/local/tomcat/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat/bin/shutdown.sh
sh /usr/local/tomcat/bin/startup.sh
;;
esac
exit 0

We’ll need to make the script executable by running the chmod command:

sudo chmod 755 /etc/init.d/tomcat

The last step is actually linking this script to the startup folders with a symbolic link. Execute these two commands and we should be on our way.

sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat

Tomcat should now be fully installed and operational. Cheers!

Install Java 6 on Ubuntu 8.10

There are several ways of installing Java on the Ubuntu operating system. One of the easiest ways is to make use of apt-get command in Ubuntu.

Setup Repository

The apt-get command makes use of a source configuration file, which contains a list of the repositories the package manager should query to retrieve the correct package. The source configuration file is known as sources.list and is situated in the /etc/apt/sources.list location. The following command can be used to edit the source file to ensure the multiverse repository is included.

Code:


sudo gedit /etc/apt/sources.list

Ensure that the following two sources are added to the configuration file:


deb http://za.archive.ubuntu.com/ubuntu/ intrepid main restricted

deb http://za.archive.ubuntu.com/ubuntu/ intrepid multiverse


After the configuration file is updated, the package repository needs to updated with the following command:

Code:


sudo apt-get update


Install Java Package

After the package repository was successfully updated, the Sun Java packages can be installed on the Ubuntu system. The Sun Java packages consist of Java 5 and Java 6 packages. Depending on the version that is required, the list of packages specified below can be installed.

Java 5
The Java 5 packages available is listed as follows:

  • sun-java5-bin
  • sun-java5-fonts
  • sun-java5-plugin
  • sun-java5-demo
  • sun-java5-jdk
  • sun-java5-source
  • sun-java5-doc
  • sun-java5-jre
  • sun-java5-src

Java 6
The Java 6 packages available is listed as follows:

  • sun-java6-bin
  • sun-java6-javadb
  • sun-java6-plugin
  • sun-java6-demo
  • sun-java6-jdk
  • sun-java6-source
  • sun-java6-doc
  • sun-java6-jre
  • sun-java6-src
  • sun-java6-fonts
  • sun-java6-jre-headless

To install Java version 6, the following command needs to be executed:

Code:


sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin


Verify Java Installation

To verify that the correct version of java is installed the following command can be used:

Code:


java -version

This command will print the current version of java that is active. Should there be more than one version of Java be installed on the operating system, the following command can be used to list the available java versions:

Code:


update-java-alternatives -l

This command list all the available Java runtime environments on the Ubuntu system. To change from one version to another, the following command can be used:

Code:

sudo update-java-alternatices -s



Testing Java Runtime Environment

You’ll want to confirm that your system is configured properly for Sun’s JRE. This is a two-step process.

First, check that the JRE is properly installed by running the following command from a terminal.

java -version

You should get similar output

java version “1.6.0″
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
Testing Java Plugin for Firefox

open Firefox and typing about:plugins in the address bar and check for java plugin

Saturday, December 20, 2008

Install Flas Player For Ubuntu Linux

Type the following command to install flash player:

$ sudo apt-get install flashplugin-nonfree

Now flash player should be working. Visit youtube or any other site to view flash content.

Troubleshooting tip

Update: This issue only relevant to older Ubuntu Linux version such as 6.04.

Some people may find voice is not working with newly installed flash player. Type following commands to solve this problem (thanks to macewan.org):
$ sudo apt-get install alsa-oss
$ gksudo gedit /etc/firefox/firefoxrc

Find line that read as FIREFOX_DSP and set to:
FIREFOX_DSP="aoss"

Save and close the file.

Close Firefox and restart it again.

Install VMware Server 2.0 on Ubuntu 8.10

1. Download VMware Server 2.0

Registe on VMware web site to get an account. When you download you would see a serial nomber.

What I download was TARimage (not for 64 bit version). you should get what you need according your machine.

VMware-server-2.0.0-122956.i386.tar.gz

2. Install nessesary dependence:

sudo apt-get install linux-headers-`uname -r` build-essential xinetd
sudo apt-get install xinetd

3. Unzip tar ball

tar zxvf VMware-server-2.0.0-122956.i386.tar.gz

you will get a folder:

vmware-server-distrib

4.

cd vmware-server-distrib

sudo ./vmware-install.pl


之后

cd vmware-server-distrib
sudo ./vmware-install.pl

下面一路回车就可以了。只是要注意一点:

The current administrative user for VMware Server is ”. Would you like to
specify a different administrator? [no]

如果你选择默认的no,在登录vmware终端的时候要用root。这不是个大问题,但是如果你想用你自己的用户登录(登录Ubuntu的用户),你必须输入yes然后回车,然后就会让你i输入你自己的用户。

4.如果你上步选择了默认的no,就会以root登录,你要为root设个密码:

sudo passwd root

5. 打开Firefox(我试过Opera也可以),在地址栏输入 http://localhost:8222会弹出登录框。

6.输入你的用户名和密码,如果第三步选择no,在这里就要用root登录。

OK,现在可以建立你自己的虚拟机了。

Friday, December 19, 2008

AAA

Windows A8425-FPWAR-V9684-4KJAH

Linux A0081-FMW2D-UE1F0-4UQHH

Xcopy- Powerful and versatile way to copy or back up files

Copy- Powerful and versatile way to copy or back up files

For copying large numbers of files or backing up a large folder, the command line is often the fastest and easiest way to go. The command “xcopy” is a very useful and powerful command for this purpose. (The old DOS also had an “xcopy” command but it sometimes had trouble with long file names. The XP version has no such problems.) “xcopy” comes with an alphabet soup of assorted switches that give it great versatility for use as a file backup utility. Enter “xcopy /?” in a command prompt to see them all. For example with the switch “/d:[mm-dd-yyy]” only files changed after a given date are copied. A command that will copy all files from the folder myfolder that have changed since June 1, 2003 to the folder mybackup is given byxcopy myfolder mybackup /d:06-01-2003 If no date is specified the switch “/d” will copy all files that have changed at any time.As is true in general, if there are spaces in a name, the path and file name have to be enclosed in quotes. Adding the switch "/s" provides that subfolders and their contents will also be copied. Other switches provide for read-only and hidden files. Altogether, there are something like 27 command line options for xcopy. More information is on this page.

如何在Ubuntu上安装RealPlayer(How to install RealPlayer on Ubuntu)

ZT

本来在Ubuntu上安装RealPlayer应该是很容易的,就是直接在终端中键入
sudo apt-get install realplayer
就可以了的,但是我如此操作只能得到

正在读取软件包列表... 完成
正在分析软件包的依赖关系树
Reading state information... 完成
现在没有可用的软件包 realplayer,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到
E: 软件包 realplayer 还没有可供安装的候选者
我已经用了官方的源和LupaWorld的源都是如此。于是准备自己手动安装RealPlayer。
先到RealPlayer官方网站上下载:
http://www.real.com/linux/?src=020923home_cn_cn
将文件RealPlayer10GOLD.bin保存到主文件夹中,即/home/[yourusername]文件夹下。
然后打开终端,进行如下操作:
$chmod +x RealPlayer10GOLD.bin
$sudo ./RealPlayer10GOLD.bin
当终端显示
Welcome to the RealPlayer (10.0.8.805) Setup for UNIX
Setup will help you get RealPlayer running on your computer.
Press [Enter] to continue...
时按下回车键,进入下一步:
Enter the complete path to the directory where you want
RealPlayer to be installed. You must specify the full
pathname of the directory and have write privileges to
the chosen directory.
Directory: [/home/shixinyu/RealPlayer]:
这里默认安装到用户的主文件夹下的RealPlayer目录下,如果你想要安装到别处,就在此处输入路径,否则直接回车即可。
You have selected the following RealPlayer configuration:

Destination: /home/shixinyu/RealPlayer

Enter [F]inish to begin copying files, or [P]revious to go
back to the previous prompts: [F]: F
安装程序会提示最后确定信息,如果都确定了,按下F键后回车。
当提示
Copying RealPlayer files...configure system-wide symbolic links? [Y/n]:
时按下Y键回车即可,后面基本上就没有需要用户操作的地方了,通常到这里基本上就安装好了,你可以到“应用程序,影音”下找到RealPlayer10来运行了,首次运行会有一段安装协议需要同意。

注:如果在跟着上述步骤完成安装操作之后到应用程序菜单下的“影音”中单击RealPlayer无反应,并且你的Ubuntu安装的是SCIM输入法,那么很可能是SCIM与RealPlayer的冲突,你还需要进行下面操作:
$sudo gedit /home/[yourid]/RealPlayer/realplay \\[yourid]指你的主文件夹名
在打开的文本编辑器的首行添加下面一行
export GTK_IM_MODULE=xim

之后保存文本编辑器,然后再次执行RealPlayer应该就正常了。


*** ???
添加源
deb http://archive.canonical.com/ubuntu dapper-commercial main
即可直接升级。

Thursday, December 18, 2008

Install Mplayer on Centos 5

1.
yum install yum-fastestmirror

2.
yum install yum-priorities

3.

Download (corresponding to your computer)
i386 http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
x86_64 http://apt.sw.be/redhat/el5/en/x%20...%201.el5.rf.x86_64.rpm

4.
Install DAG's GPG key

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

5.

Check

rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm (you don't have to do this step)

Install:

rpm -ivh rpmforge-release-0.3.6-1.el5.rf.*.rpm

6.
Check for update:

yum check-update

This step might take a longer time, system will create a file named "primary.xml.gz"

7.
yum install mplayer*

8.
[root@centos installed]# yum check-update

9.

application ---> Sound and Video --->mplayer

Complete!!

Install Chinese pinyin input method on Ubuntu

Go to the following URL:
http://code.google.com/p/scim-python/downloads/list

download file:
scim-python-0.1.12.tar.gz

Execute commands:

$ sudo apt-get install scim-dev
$ sudo apt-get install Python-dev
$ sudo apt-get install python-enchant
$ sudo apt-get install python-gtk2-dev
$ sudo apt-get install libgtk2.0-dev
$ tar zxvf scim-python-${version}.tar.bz2
$ cd scim-python-${version}
$ ./configure –prefix=/usr
$ make
$ sudo make install

The Chinese input method will effect after you log out and then log in,