Archive for January, 2006

X forwarding and XDMCP configuration

Sunday, January 29th, 2006

To setup X forwarding to run single applications remotely, not much work is necessary. On the X server (the display), ensure that connections are allowed from localhost. Then configure the SSH client to allow X11 forwarding through localhost:0. On the remote host (the machine you are logging in to), you should immediately be able to run any X application like xterm, xeyes, etc. If you have problems, check the DISPLAY environment variable; it should be set and the value should be the X server's network address and some screen offset.

XDMCP is how you obtain an entire login session from xdm to be spawned on a different X server. First, on the remote host (the one running xdm), edit Xaccess and ensure that your workstation's network address is permitted; restart xdm if necessary. Then, on the workstation, start the X server and create a new XDMCP session. (For X.Org, the command is X -query ) You should see a login window appear. Log in as you would at the console.

Strange terminal characters in Red Hat RHEL3 from gcc, g++, man, etc

Thursday, January 26th, 2006

The default locale for RHEL3 is en_US.UTF-8. If you do not have a UTF-8 terminal (most people do not), this will cause strange characters to be printed in place of certain characters, such as the pipe character. Setting LANG/LANGVAR in /etc/profile won't work, because these variables are overwritten by the locales support in glibc.

The proper fix is to edit /etc/sysconfig/i18n and replace en_US.UTF-8 with en_US wherever it appears in that file.

cpp macro dump

Thursday, January 26th, 2006

Ever wanted to know what macros GCC/G++ are predefining for you? Here is how.

For gcc: cpp -dM -gcc -x c /dev/null
For g++: cpp -dM -gcc -x c++ /dev/null

Strangely, _GNU_SOURCE seems to always be defined for C++.

Compiling Debian kernel package with distcc

Monday, January 16th, 2006

DISTCC_HOSTS=”localhost host1 host2″ CONCURRENCY_LEVEL=4 MAKEFLAGS=”CC=distcc” fakeroot make-kpkg –revision=custom1 –bzimage –initrd kernel_image kernel_headers