Upgrade Texlive from 2008 to 2010 with CJK

While upgrading the TexLive version from 2008 to 2010 in the box of ‘par’, I’ve encounter some problem of related packages: the CJK modular is the first. This blog post is to notice the solution I’ve tried where there is no guide from gentoo. The important notice is here: [solved] dev-texlive/texlive-latex-2011 fails to build. Although the discussion is about TexLive 2011, it is useful for debugging.

The steps for me to upgrade TexLive is simple: # emerge -uDN world. But I notice the error messages while compiling:

#########################################################
fmtutil: Error! Not all formats have been built successfully.
Visit the log files in directory
/var/tmp/portage/dev-texlive/texlive-langcjk-2010/work/texmf-var/web2c
for details.
#########################################################

This is a summary of all `failed’ messages:
`ptex -ini -jobname=platex -progname=platex platex.ini’ failed
* ERROR: dev-texlive/texlive-langcjk-2010 failed (compile phase):
* failed to build format texmf/fmtutil/format.texlive-langcjk.cnf
*

With the reference, the solution I’ve tried is to unmerge all the TexLive related packages and reinstall them. And it is works. Here listing some commands I’ve use.

1
2
# emerge -C texlive-langcjk texlive-latex
# qlist -I texlive

The qlist command is included by portage-utils and can be used to check which packages are Installed and corresponded to the keywords. If it is useless after un-merge the two packages, trying to use the qlist to find out all packages related and un-merge them all. And then, with the # emerge --depclean and # revdep-rebuild, we can install TexLive in a nearly clean state.

Enjoy it. 🙂

Important note before migrate to xorg-server 1.10 on Gentoo

There are some notes of migration from Gentoo’s documentation: Xorg-server 1.10 Upgrade Guide. The most important feature change in this version is:

Xorg no longer does autodetect devices using xf86-input-keyboard and xf86-input-mouse.

But it did not specify the migration procedure, it just tell us to use evdev.

The problem I’ve encountered is that after install xorg-server 1.10 and related packages re-emerged, I lost my keyboard and mouse and I can’t type anything within GDM. Fortunately, with single mode, I can stop the procedure of GDM starting and at least using console mode for problem fixing.

The recovery steps are easy.

1. Check the useless use flags in make.conf, the INPUT_DEVICES variable should contain at least evdev but keyboard and mouse.

2. Re-emerge the x11-drivers/xf86-input-evdev packages and make a whole world checking via emerge -uDN world. The second is to re-emerge x11-base/xorg-drivers at least and to check another change.

3. (Optional) Re-emerge all drivers related to xorg. We can use qlist -I -C x11-drivers/ to find out them and re-emerge by our-self.

I done the above two steps and my laptop is working. If you have the same problem or if you want to upgrade xorg, checking these tricky points.

Allow Tomcat to follow symlinks

In default, Tomcat did not allow to follow symbol links to fetch data. To overcome this issue, just adding:

allowLinking="true"

in the configuration files in the Context section.

Strange behavior of networking

Scenario:

1. Two or more NICs in the server.

2. All cards are set-up with the same configuration and ARE ALL UP.

3. The cable is plug into ONLY ONE card AND NOT ETH0.

The result is, although the settings are all correct but the default path defined in the system is via eth0. Well, that’s very annoying and time-wasting.

Just take a note for me to comment (or down) unused card settings in the future.

Install Oracle XE 10g and Tomcat 6 on 64-bit Ubuntu Server 11.04

1. For Oracle XE 10g:

1
2
3
$sudo apt-get install libc6-i386, bc  # Install i386 compatible libraries
$wget -c http://oss.oracle.com/debian/dists/unstable/main/binary-i386/libaio_0.3.104-1_i386.deb  # Get the additional library
$sudo dpkg -i --force-architecture libaio_0.3.104-1_i386.deb  # Install this package without architecture testing

But for the oracle deb files, get from the official site, we encounter problems. The install file will check dependencies of libc and bc although our installed version is newer than it needs. To solve this problem, we referenced here and the steps we tried is listing:

1
2
$sudo dpkg -x oracle-xe-universal_10.2.0.1-1.1_i386.deb oraextract  # Extracts filesystem
$sudo dpkg -e oracle-xe-universal_10.2.0.1-1.1_i386.deb oraextract/DEBIAN  # Extracts pkg config files

Then edit the configure file oraextract/DEBIAN/control and let the dependencies like Depends: libaio (>= 0.3.96) | libaio1 (>= 0.3.96). Finally we can repack it, install it, and configure it successfully:

1
2
3
$sudo dpkg-deb --build oraextract
$sudo dpkg -i --force-architecture oraextract.deb
$sudo /etc/init.d/oracle-xe configure

For convenience usage, we set up some variables for user oracle ({ORACLE_USER_HOME}/.bashrc).

1
2
3
4
5
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME
export ORACLE_SID=XE
export PATH

2. For tomcat 6

We want to let tomcat to use port 80 as default instead of using port 8080. After we change the port settings in server.xml, we realise the default port setting in our environment is forbidden. Since Ubuntu 10.04, the default usage of port less than 1024 is locked by default where we should use authbind to solve do this.

The solution is to edit /etc/default/tomcat6 and change the last line AUTHBIND=yes. And then we restart Tomcat and it works.

Fix the continues auto-disconnect wireless issue on Ubuntu

The wireless card in my laptop is RTL8191SEvB. In Linux (no matter I use is Gentoo or Ubuntu), the default kernel module is r8192se_pci. The detail can be retrieved by:

1
2
3
4
5
6
$ lspci -v
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8191SEvB Wireless LAN Controller (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. Device e020
.....
Kernel driver in use: rtl819xSE
Kernel modules: r8192se_pci

Although it works but I also encounter a problem that the network connection will disconnect automatic and continuously. To overcome this issue, from the reference: Can’t get Realtek RTL8191SEvB wireless adapter to work, the solution is easy. What we should do is adding a parameter while probing module. The command is:

1
2
$ sudo rmmod r8192se_pci
$ sudo modprobe r8192se_pci hwwep=0

And we can set up as a global module option in system, that is:

1
$ sudo echo "options r8192se_pci hwwep=0" > /etc/modprobe.d/r8192se_pci.conf

And the options will be added while module start-up.
Note: This solution is in test by myself.

Delimiter issue in bash for loop with cat command

If we had a list file which listing like:

aa
bb
cc dd

which we write a bash script and want to print out each line with cat command. The script listing as:

1
2
3
4
5
6
#!/bin/bash

for line in `cat list_file`
do
    echo $line
done

But the result is:

aa
bb
cc
dd

This issue is due to the Internal Field Separator (IFS) in bash is default defined as <space><tab><newline>. So the solution is simple. Just add the following command in bash script (line 2 of the above example) to overwrite it.

1
IFS=$'\n'

And the output result is correctly.