How to make the Insert/Help key emit Insert in iTerm2

Go into iTerm2 preferences and go to the keys tab. Hit the + button at the bottom to add a new key. Press your Insert/Help key to set that as your shortcut key, then select Send Escape Sequence as your action, and set [2~ as your escape sequence.

Running DRM/DRI/Mesa/DDX/Xorg from git on Debian Sid

A lot of the guides out there on how to build the entire X stack from scratch are missing steps or are only for part of the stack. This assumes you’re on Radeon, substitute appropriately for Intel or NVidia (download different driver, use different options with Mesa).

Please note: I haven’t been able to get i386 on amd64 builds to work yet, so if you need to run 32 bit apps on 64 bit, stick with your distro’s build for everything, don’t mix and match.

To get the source:

sudo apt-get build-dep libdrm mesa xserver-xorg-video-ati xorg-server
sudo apt-get install git llvm-3.4-dev libelf-dev linux-headers-`uname -r` build-essential
mkdir xorg && cd xorg
git clone git://anongit.freedesktop.org/git/xorg/util/macros
git clone git://anongit.freedesktop.org/git/xorg/proto/x11proto
git clone git://anongit.freedesktop.org/git/mesa/drm
git clone git://anongit.freedesktop.org/git/xorg/lib/libXau
git clone git://anongit.freedesktop.org/xorg/xserver
git clone git://anongit.freedesktop.org/git/mesa/mesa
git clone git://anongit.freedesktop.org/git/xorg/driver/glamor
git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-ati
git clone git://anongit.freedesktop.org/xorg/driver/xf86-input-evdev

LLVM version
Mesa requires LLVM 3.4 or newer, and Debian Sid is still on 3.3 as default. Until this is fixed, make sure the package llvm-3.3 is not installed, and do ln -s /usr/bin/llvm-config-3.4 /usr/bin/llvm-config

Modify the environment
Add to /etc/environment:

LIBGL_DRIVERS_PATH=/opt/xorg/lib/dri/
R600_DEBUG=sb

Add to /etc/X11/xorg.conf:

Section "Files"
        ModulePath "/opt/xorg/lib/xorg/modules,/usr/lib/xorg/modules"
EndSection

Section "Module"
  Load "dri2"
  Load "glamoregl"
EndSection

… and in the Device section for your video card add Option "AccelMethod" "glamor" and make sure Driver is set to "radeon".

Create /etc/ld.so.conf.d/0-xorg-git.conf:

/opt/xorg/lib

Build the code

export PKG_CONFIG_PATH=/opt/xorg/lib/pkgconfig:\
/opt/xorg/share/pkgconfig:${PKG_CONFIG_PATH}
export LD_LIBRARY_PATH=/opt/xorg/lib:${LD_LIBRARY_PATH}
export LD_RUN_PATH=/opt/xorg/lib:${LD_RUN_PATH}
export LDFLAGS=-L/opt/xorg/lib CPPFLAGS=-I/opt/xorg/include
export ACLOCAL="/usr/bin/aclocal -I /opt/xorg/share/aclocal"

cd macros
./autogen.sh --prefix=/opt/xorg
sudo make install
cd ..

cd x11proto
./autogen.sh --prefix=/opt/xorg
sudo make install
cd ..

cd drm
./autogen.sh --prefix=/opt/xorg
make -j4
sudo make install
cd ..

cd libXau
./autogen.sh --prefix=/opt/xorg
make -j4
sudo make install
cd ..

cd xserver
./autogen.sh --prefix=/opt/xorg --enable-xorg --disable-dmx --disable-xvfb --disable-xnest --disable-xwin
make -j4
sudo make install
cd ..
sudo chown root /opt/xorg/bin/Xorg
sudo chmod u+s /opt/xorg/bin/Xorg
sudo ldconfig
sudo ln -s /usr/bin/xkbcomp /opt/xorg/bin/xkbcomp
sudo ln -s /usr/share/X11/xkb/rules /opt/xorg/share/X11/xkb/rules

cd mesa
export DRI_DRIVERS="radeon,r200"
export GALLIUM_DRIVERS="r300,r600,radeonsi,swrast"
./autogen.sh --prefix=/opt/xorg --with-dri-drivers=$DRI_DRIVERS --with-gallium-drivers=$GALLIUM_DRIVERS --with-egl-platforms=x11,drm --enable-gbm --enable-shared-glapi --enable-glx-tls --enable-driglx-direct --enable-gles1 --enable-gles2 --enable-r600-llvm-compiler --enable-xorg --enable-xa --enable-gallium-egl --enable-gallium-gbm --enable-texture-float
make -j4
sudo make install
cd ..

cd glamor
./autogen.sh --prefix=/opt/xorg
make -j4
sudo make install
cd ..

cd xf86-video-ati
./autogen.sh --prefix=/opt/xorg --enable-glamor
make -j4
sudo make install
cd ..

cd xf86-input-evdev
./autogen.sh --prefix=/opt/xorg
make -j4
sudo make install
cd ..

All you have to do now is tell your XDM to use /opt/xorg/bin/Xorg and then restart it. The Xserver puts its log in /opt/xorg/var/log/Xorg.0.log

Firefox can be fast under FGLRX

Use about:config to set:

gfx.xrender.enabled = false
layers.acceleration.force-enabled = true

Canvas rendering should be much much faster. Remember to set these to defaults if you switch drivers, the same isn’t true on DRI/Gallium Radeon.

Fixing “Wrong principal in request” in Kerberos 5

krb5_newrealm doesn’t seem to add enough lines to /etc/krb5.conf. To fix this, add the following lines to /etc/krb5.conf on all machines participating in the realm. My local realm is LAN, but substitute your own. The new lines will be in bold, the existing lines should already exist, if they don’t, add them.

[realms]
   LAN = {
     kdc = infinity.lan
     admin_server = infinity.lan
     default_domain = lan
   }

[domain_realm]
   .lan = LAN
   lan = LAN

All hosts/servers participating in the realm that offer Kerberized services should have a FQDN that ends in your realm’s domain name (.lan in my case).