August 2006 Archives
Fri, 2006-08-04 09:47:01 +0800
fcitx stops working with another user login X
I always used my ConfigFiles anywhere, however, I added a new user without using the config files and after login X with this new user fcitx stops working. I thought for a while and got the solution, that's because the evnrionment of LC_CTYPE, if you want to type in Chinese, you must set up the environment to:
export LC_CTYPE="zh_CN"
After adding this line to my $HOME/.bashrc and reboot the system, it works now.
Thu, 2006-08-03 20:20:27 +0800
Embed - "Symbol lookup error"
You do not need to install qt-x11 to your system in my installation of qtopia-core, however, qtopia-core must be installed. I uninstalled qtopia-core for a try, then I run the demos in the package of qtopia-core, I got some error like Symbol lookup error. I Googled it and know that means the library you run the program is different from the library you compiled it. To test this you can check the output of command #ldd program (program is the binary file) before and after uninstalling qtopia-core.
Thu, 2006-08-03 20:12:42 +0800
Embed - qtopia-core do not need qt/x11 installation
In fact, you donot need to install qt-x11-preview to your system if you refer to my installation, that is, you do not need to execute #gmake install after gamke qt-x11-preview-opensource-src-4.2.0-tp1 because we just need the qvfb tool in it to run qtopia-core demos. Therefore, what we need to compile qt-x11-preview is to compile the qvfb tool in it.
p.s: besides, you can change the environment variable of QTDIR to:
export QTDIR=$HOME/sources/qt-x11-build
However, qtopia-core must be installed.
Wed, 2006-08-02 18:26:33 +0800
Exceed to X Window System of my Slackware Linux remotely
I am high to see my KDE desktop in Slackware Linux remotely on another Windows XP system by XDMCP in exceed. It's easy to configure, first you need to login your Linux (slackware Linux for me) with root user and modify some files as follows:
- /etc/X11/xdm/xdm-config
- comment the following line:
DisplayManager.requestPort:0
- /etc/X11/xdm/Xaccess
- uncomment the following line:
#* # any host can get a login window
or you can add the following line according to your local network:192.168.0.*
- /etc/inittab
- modify the default runlevel to X11 mode:
# These are the default runlevels in Slackware: # 0 = halt # 1 = single user mode # 2 = unused (but configured the same as runlevel 3) # 3 = multiuser mode (default Slackware runlevel) # 4 = X11 with KDM/GDM/XDM (session managers) # 5 = unused (but configured the same as runlevel 3) # 6 = reboot # Default runlevel. (Do not set to 0 or 6) id:4:initdefault:
- /opt/kde/share/config/kdm/kdmrc
- modify the section of Xdmcp to enable:
[Xdmcp] # Whether KDM should listen to incoming XDMCP requests. # Default is true Enable=true
- /etc/X11/gdm/gdm.conf
- if you use
gdmto login modify the section of Xdmcp to enbale.
At last, reboot the system.
Then you need to configure the Exceed using Xconfig which is a Exceed tool refer to this article (in Chinese). The most important thing is to set Network and Communication to XDMCP Broadcast mode (or XDMCP Query mode if the IP address of your Linux system is different from the Windows system holding Exceed).
Then run exceed, it will find another Linux system you can login remotely automatically. What are you waiting for? Just login now! ;)
Wed, 2006-08-02 16:01:16 +0800
X Window System Security
X Window System is client/server structure, and if you have no idea about it just enter here (in Chinese) to check it out. Today I did something to test something about X window system security.
xhost
The xhost based X authorization that most people use is functional for single-user workstations. xhost is the only X security many people use just because it's easy to run X programs on remote systems and displaying them locally. Type:
$xhost +powdered.toast.com
and log into powdered.toast.com, then you can run any X program on powdered.toast.com and display it locally. This, however, also allows anyone else on powdered.toast.com to use (or abuse) your local workstation display.
xauth
Using xauth can prevent the disadvantages of xhost, you can enter into X Window System Security to know details about xauth and why. Then I will show you my example about the usage of xauth to allow another user in the same system to run X programs on the same system, that is, the local and the remote are one same system.
Suppose you have two users in your system which are userloginx and userelse respectively. First use the user userloginx to login X Window (GNOME or KDE as you like), and then open shell to type:
userloginx $echo $DISPLAY:0.0 userloginx $su userelsePassword: userelse $xclockXlib: connection to ":0.0" refused by server Xlib: No protocol specified Error: Can't open display: :0.0 userelse $echo $DISPLAY:0.0 userelse $exitexit userloginx $su - userelsePassword: userelse $xclockError: Can't open display: userelse $echo $DISPLAYuserelse $export DISPLAY=:0.0userelse $xclockXlib: connection to ":0.0" refused by server Xlib: Invalid MIT-MAGIC-COOKIE-1 key Error: Can't open display: :0.0
Then we will use xauth to propagate the magic cookie to another user (or remote host).
userelse $exitexit userloginx $xauth extract Xauthority-file $DISPLAYuserloginx $chmod 644 Xauthority-fileuserloginx $su - userelsePassword: userelse $export DISPLAY=:0.0userelse $xauth merge /home/userloginx/Xauthority-fileuserelse $xclock
Now you can see the xclock running normally.
Tue, 2006-08-01 12:04:20 +0800
Embed - WOW, it worked!
After compiling for about two days, I got a big fruit now. It worked and I used qvfb to simulate the qtopia-core desktop demos. I summary the steps for this now.
version
The version of qt and qtopia-core I used is qt-x11-preview-opensource-src-4.2.0-tp1 and qtopia-core-opensource-src-4.1.4 respectively.
set up environment
I created a new user with a new group for my job first and set up the environment for it as follows. (executed by root user)
#groupadd job# create a new group named job#mkdir -p /home/qtopia# make /home/qtopia as the home directory of the new user named qtopia#chmod 644 /home/qtopia# change access permissions of /home/qtopia#useradd -g job -s /bin/bash qtopia# add a new user named qtopia belongs to job group with /bin/bash as its default shell#passwd qtopia# password the new user qtopia#chown -R qtopia:job /home/qtopia# change owner of /home/qtopia directory
Now you can login in with the new user qtopia and set up the new environment. (executed by qtopia user)
#cat > ~/.bash_profile << "EOF"#!/bin/bash # $HOME/.bash_profile if [ -f $HOME/.bashrc ]; then . $HOME/.bashrc fi EOFmkdir -p ~/.opt/Trolltech/Qt-4.2.0-tp1mkdir -p ~/.opt/Trolltech/QtopiaCore-4.1.4mkdir -p ~/sources#cat > ~/.bashrc << "EOF"export QTDIR=$HOME/.opt/Trolltech/Qt-4.2.0-tp1 export QTEDIR=$HOME/.opt/Trolltech/QtopiaCore-4.1.4 export PATH=$QTDIR/bin:$QTEDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$QTEDIR/lib:$LD_LIBRARY_PATH EOF
Besides, you can add some new configuration as you like in $HOME/.bashrc. At last run #source ~/.bashrc to make the setup become effective.
qtopia-core
I used qtopia-core-opensource-src-4.1.4 for a try and download it from TrollTech that is the home of qt and qtopia. I configured, compiled and installed qtopia-core step-by-step as follows. (executed by qtopia user)
#cd ~/sources/#wget ftp://ftp.trolltech.com/qt/source/qtopia-core-opensource-src-4.1.4.tar.gz... ...#tar xvfz qtopia-core-opensource-src-4.1.4.tar.gz... ...#mkdir qtopia-core-build#cd qtopia-core-build/#../qtopia-core-opensource-src-4.1.4/configure -prefix $QTEDIR -debug-and-release -qvfb -qconfig full -depths 4,8,16,24,32... ...#gmake# this cost a long long time about 8 hours on my PC ... ...#gmake install... ...
At last, run #ldconfig as root user.
qt and qvfb
First I want to use qt-x11-opensource-src-4.1.4 to compile qvfb, however, I got many errors whem compiling qvfb in tools/qvfb/. Therefore, I used qt-x11-preview-opensource-src-4.2.0-tp1 to compile qvfb for qtopia-core. (executed by qtopia user)
#cd ~/sources/#wget ftp://ftp.trolltech.com/qt/source/qt-x11-preview-opensource-src-4.2.0-tp1.tar.gz... ...#mkdir qt-x11-build#cd qt-x11-build/#../qt-x11-preview-opensource-src-4.2.0-tp1/configure -prefix $QTDIR... ...#gmake# this still cost a long long time about 8 hours on my PC#gmake install... ...#cd tools/qvfb/#gmake... ...#cp ../../bin/qvfb $QTDIR/bin/
Also run #ldconfig as root user.
Test qtopia-core in qvfb
Now make sure you quit X that is started by other users. Then execute the following commands in tty by qtopia user.
#X&#xterm -geometry +400 -display :0
Now it will start X with xterm, then execute the following commands in the xterm.
#qvfb&#$QTEDIR/demos/books/books -qws
What you got now? It's stirring, isn't it?
What's next?
Next I should learn some QT knowledge and make my own demos run.