Thursday, May 03, 2007

Supplement for FedoraXenQuickstartFC5/6

When we want to use "xm console vm-name/id" on fully-virtualized VMs, we can find solution on http://fedoraproject.org/wiki/FedoraXenQuickstartFC6. However, it doesn't work if you don't do some changes in the guest.
Fullyvirt guest serial console access

Fully-virtualized guest OS will automatically have a serial console configured, but the guest kernel will not be configured to use this out of the box. To enable the guest console in a Linux fully-virt guest, edit the /etc/grub.conf in the guest and add 'console=ttyS0 console=tty0'. This ensures that all kernel messages get sent to the serial console, and the regular graphical console. The serial console can then be access in same way as paravirt guests:

# xm console

Alternatively, the graphical virt-manager program can display the serial console. Simply display the 'console' or 'details' window for the guest & select 'View -> Serial console' from the menu bar.

Beside above information from Fedora, we have to do below changes:
# vi /etc/inittab
add
0:2345:respawn:/sbin/mingetty tty0
S0:2345:respawn:/sbin/mingetty ttyS0
in that file.
# init q
# vi /etc/securetty
add tty0 and ttyS0 in that file.

Tuesday, February 06, 2007

Get Linux Information

sysctl - configure kernel parameters at runtime
-a Display all values currently available.
-A Display all values currently available in table form.

getconf - get configuration values

help: help [-s] [pattern ...]
Display helpful information about builtin commands. If PATTERN is
specified, gives detailed help on all commands matching PATTERN,
otherwise a list of the builtins is printed. The -s option
restricts the output for each builtin command matching PATTERN to
a short usage synopsis.

# ulimit
unlimited

# umask
0022

Monday, February 05, 2007

Koha on Fedora Core 6

Koha-2.2.7 works on LAMP, but we have to do some manual modification on a recent Linux distribution.

Firstly, you have to install enough Perl modules in terms of installation manual. On Fedora Core 6, you have to install some modules, such as ZOOM, Data::Random, etc., from the CPAN source code.

Secondly, you have to create some tables by yourself which are defined in koha.mysql, because they would not be created during the installation process, such as Koha.items, Koha.systempreference, etc. Especially you have to modify the create script of Koha.issues, because it uses a MySQL 5.0 reserved word "return" (it is not a reserved word in MySQL 4.1 and previous versions). According to , "reserved words are permitted as identifiers if you quote them". "MySQL allows some keywords to be used as unquoted identifiers because many people previously used them. Examples are those in the following list: ACTION BIT DATE ENUM NO TEXT TIME TIMESTAMP", so you only need to quote the `return`, and leave the "timestamp" unquoted.

Friday, February 02, 2007

A Typo In SSHD Man Page

OPENSSH 4.3p2 in Fedora Core 6 said:
AUTHORIZED_KEYS FILE FORMAT
~/.ssh/authorized_keys is the default file that lists the public keys that are permitted for RSA authentication in pro-tocol version 1 and for public key authentication (PubkeyAuthentication) in protocol version 2. AuthorizedKeysFile may be used to specify an alternative file.

However I found it does work with ~/.ssh/authorized_keys2 when you don't setup "AuthorizedKeysFile" in /etc/ssh/sshd_config.

Monday, January 22, 2007

How to Set a Linux Host Name in Office

We have a Microsoft dynamic DNS server in the office, so you can dynamically register your host name when you get the dhcp IP address. Your Windows system can get it automatically, while your Linux system should do some configuration.

For Debian you need add some items in /etc/interfaces. For more info in Debian, see "man interfaces" and scroll down to "The dhcp Method".

For Fedora Core you will do something below:

/etc/sysconfig/network
HOSTNAME=YourLinuxHostName

/etc/sysconfig/networking/devices/ifcfg-eth0
DHCP_HOSTNAME=YourLinuxHostName


Then restart your network, it should be ok.

Thursday, January 18, 2007

Argument list too long

When I execute the command:
# ls /media/dvd/Fedora/RPMS/*.rpm
bash: /bin/ls: Argument list too long

Q: What's the problem?
A: "The UNIX operating system traditionally has a fixed limit for the amount of memory that can be used for a program environment and argument list combined."
# getconf ARG_MAX
131072
# cd /media/dvd/Fedora/
# ls RPMS/*.rpm|wc
2931 2931 116609

If I include "/media/dvd/Fedora" in the list, it would exceed 131072. Reducing PATH name or using Shell script can run those commands correctly.

Tuesday, January 16, 2007

Problem When Create Local YUM Repository Using FC6 DVD

cat /etc/yum.repos.d/fedora-core.repo

[core]
name=Fedora Core $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=file:///media/dvd/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=core-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY


#yum install elinks
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for ncompress to pack into transaction set.
media://1161131669.029329%235/Fedora/RPMS/elinks-0.11.1-5.i386.rpm: [Errno 4] IOError:
Trying other mirror.
Error: failed to retrieve Fedora/RPMS/elinks-0.11.1-5.i386.rpm from core
error was [Errno 4] IOError:

Solution:
Just copy some repodata files from the RedHat sites to /var/cache/yum/core:
comps.xml repomd.xml filelists.xml.gz other.xml.gz primary.xml.gz
Then yum works well.

Conclusion:
Repo files on FC6-i386 DVD sounds not correct; no such problem on FC6-x86-64bit DVD.

Thursday, December 21, 2006

A Small Trick in Setting Local YUM Repository

I wanted to setup local yum repository for further installation, but I found it has a little problem:

FC6's DVD was mounted on /media/FC_6 i386 DVD, so I put "baseurl=file:///media/FC_6 i386 DVD" in /etc/yum.repos.d/fedora-core.repo. However, I found an error below when I yum something:

"Options Error: Error parsing 'file:///media/FC_6 i386 DVD/': URL must be http, ftp, file or https not ""

Why?

The reason is the spaces. After I changed "FC_6 i386 DVD" to "FC_6%20i386%20DVD", the local YUM repository works well.

Setup Your Own YUM Server's Group Functionality

According to Fedora Core installation manual, we can setup our own YUM server on our internal network to provide installation or updating service to save bandwidth.

There are several ways, such as http, ftp or nfs. In the http case, we copy the file hierarchy to /var/www/http, and createrepo/repoview. Then ensure httpd is up, you can yum install the packages from the server. However, I found "yum grouplist" doesn't work. After I checked createrepo manual, I found I have to create group information. Then copy a "comps.xml" to my repodata directory, and #createrepo -g repodata/comps.xml, and now the group functionality works.

Tuesday, December 05, 2006

MySQL's Log

MySQL's logs works when using the command options (mysqld_safe --log --log-bin). However, I found if I put "log" or "bin-log" at bottom of the file my.cnf, the MySQL's log does not work.

Check manuals - "mysqld_safe" and "mysqld", there are some different groups in my.cnf. "mysqld_safe" reads options from [mysqld], [mysql.server] and [mysql_safe], so put log, bin-log, etc. in [mysqld], and the logs write to log files in "datadir".

If you want to put logs in your /var/log directory, make sure the files are writable by user "mysql", or just create a directory whose owner is mysql.

SugarCRM

SugarCRM 4.5.0f's bugs:

1. No matter the "memory_limit" in php.ini is not enough, the installation always tell us the configuration is correct;
2. Administration -> System -> Backup does a recursive backup, so the zip package always includes the previous backups.

when you find installation stopping before creating database, please check your httpd log, and find a reasonable value for "memory_limit" in /etc/php.ini. When you need upgrade your SugarCRM, you have to change all the files' owner to the "Web User", and increase the "post_max_size" and "upload_max_filesize" value in /etc/php.ini.

Friday, November 03, 2006

Pre-owned IBM IntelliStation

M Pro 6889-80U
Pentium III 500/512M RAM/40G HD/Matrox G400 32M Dual-Head/17" MAG 786F/CDROM/LG CD-Writer

$120 CDN - Great price!
It works well, but "zzz" noise is very annoying!

Opening the case, I found there are four big fans and a small one in it. The noise came from the small one, which is on G400, not from the other four big fans. How can I get rid of the annoying noise? Just try, try, ...

Disassembling the fan, I found there were some dust on the ball-and-roller bearings - that's the problem. So I blew off the dust and put a little oil on it (just a little); then assembled and installed it. Turn on the computer, the noise has gone! It is as quiet as a one-fan-machine.

Go to IBM website, download some updates. Refresh the BIOS, G400 firmware (after updating, the RAM becomes 16M, I think another 16M is for the other display) and CDROM firmware. Now the computer is like a brand new one.

Tuesday, August 22, 2006

Oracle 10gXE Starts Up Manually

After installation of Oracle 10gXe, there is a configuration file "oracle-xe" under /etc/sysconfig (FC5). It controls whether Oracle be loaded at system boot. If you want Oracle start up manually, you can follow the instructions below:
# cat /etc/sysconfig/oracle-xe
ORACLE_DBENABLED=false
LISTENER_PORT=1521
HTTP_PORT=8080
CONFIGURE_RUN=true

# /etc/init.d/oracle-xe enable
# /etc/init.d/oracle-xe start

When shutdown:
# /etc/init.d/oracle-xe stop
# /etc/init.d/oracle-xe disable

If you use GUI "Start Database", the Listener doesn't start up, so you have to load it manually.
# su - oracle
$ . oracle_env.sh
$ lsnrctl start

Now you can see that the port 1521 and 8080 are up, and you can manipulate the database by using browser and SQL*Net.

Friday, July 28, 2006

Oracle 10g XE on Fedora Core 5

setenforce 0 -- this is the key for installation.

System Administrator Appreciation Day

System Administrator Appreciation Day

Making Deb Package for StarDict-2.4.8

There are a bunch of enhancement in StarDict new edition 2.4.8. One of my favourite is a new button "Result".

When I install a DEB package which is converted from a RPM, it doesn't work. Then I try to make a DEB from the source. My linux box is Ubuntu 6.06 LTS with the default installation. When I ran "sudo ./configure", there was an error:
Package requirements "libgnomeui-2.0 >= 2.2.0" were not met:
Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.

However, I do have a "/usr/lib/libgnomeui-2.so.0.1401.0", what's wrong? Then I checked "stardict.spec" for the software requirement, and I found:
BuildRequires: libgnomeui-devel >= 2.2.0
That is the reason. After "libgnomeui-dev" was installed, the error disappeared.

To build a debian, there are some essential packages below:
linux-headers-2.6.15-26-386
build-essential
fakeroot
dh-make
libgnomeui-dev(this is depended on a bunch of *-dev packages which should be installed.)
libpcre-dev

Building process:
$ cd /usr/src
$ tar xvfj $SOMEWHERE/stardict-2.4.8.tar.bz2
$ cd stardict-2.4.8
$ sudo dh_make
$ sudo dpkg-buildpackage -d

When it finish, you will get a DEB package "../stardict_2.4.8-1_i386.deb". Then install, and enjoy the new edition of StarDict!

Thursday, June 22, 2006

Thursday, April 27, 2006

Adding Password Verification on Single Mode in Fedora Core 5

When you enter the single mode in Fedora Core 5, you can get the root prompt "#" without using the root password. We can add a line below into "/etc/inittab" to avoid this issue.

~~:S:wait:/sbin/sulogin

Friday, March 31, 2006

Be Careful with Cleaning Windows Files

I have installed MS Office XP in my laptop. Because of lack of HD capacity, I searched for some files which are larger than 10MB. There is a 56MB file "1e16a6.msp" in C:\Windows\installer, and I got rid of it. However, when I am going to reconfig or uninstall MS office XP, there is a warning sign, and the uninstall process stopped. I was confused with that.

How can I uninstall this product from my computer? After I have checked the uninstall log file, I found there are some hints in the log. The reason is that the uninstall program relies on the file "1e16a6.msp" in C:\Windows\installer or some temporary files in the temp directory. Then I had to find a "1e16a6.msp" in the package files of MS Office. Microsoft knowledge base tells us there is a way using "windows install" v3.1 to extract a file from the package. After extracting the file to the C:\Windows\installer, the uninstall program works again.

Windows does not have a clear package manager, so we don't know where the files will be installed. Cleaning disk is complex job; once you make a mistake, it maybe crash the program and even damage the system.

Linux distributions have good package managers such as rpm and deb, so the users can easily know which file is provided by what package, and what's the function by the package . With these efficient tools, deploying the systems is just a breeze.

Thursday, March 23, 2006

Two Bugs in StarDict within Ubuntu 5.10

Ubuntu 5.10 consists of StarDict-2.4.3, the very useful dictionary. I found there are two bugs in that version:

1. When you first double click (or select) on a word, a floating window pops up; however, nothing appears when you double click the same word again.

2. After you have installed tree dictionary, you can find that the tree dictionary doesn't work. The reason is that there is a mistake in the StarDict package. The package includes a wrong directory "/usr/share/stardict/treedic" instead of "/usr/share/stardict/treedict".