maandag 3 december 2007

Getting Compiz Fusion to work on Dell Latitude D630 with AIGLX (965GM; X3100)

Preparing the system

Preparing Xorg:

The important parts are in bold.
The bold parts that begin with a # are options you can experiment it... but this was the way I got my Compiz Fusion working.
PS: be sure you have a backup.


Section "Files"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "gb,us,be"
Option "XkbOptions" "grp:alt_shift_toggle"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "auto"
Option "ZAxisMapping" "4 5 6 7"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
EndSection

Section "Device"
Identifier "Generic Video Card"
Driver "intel"
# Option "AllowGLXWithComposite" "true"
Option "XAANoOffscreenPixmaps" "true"
# Option "AccelMethod" "exa"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 30-70
VertRefresh 50-160
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Generic Video Card"
Monitor "Generic Monitor"
DefaultDepth 24
# Option "AddARGBGLXVisuals" "true"
# Option "DisableGLXRootClipping" "true"
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "Synaptics Touchpad"
Option "aiglx" "true"
EndSection

Section "Module"
Load "glx"
Load "dbe"
Load "dri"
Load "freetype"
Load "extmod"
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

Section "DRI"
Mode 0660
EndSection

After doing these changes you need to restart your Xorg.
This is accomplished with the key combination CTRL-ALT-BACKSPACE.


Preparing for Compiz Fusion installation:

First we need to add a repository to aptitude.
Change the line according to what release you have, (go to the directory for your release in your webbrowser and copy that location) mine was Lenny.
Add the following line to /etc/apt/sources.list:

deb http://download.tuxfamily.org/shames/debian-lenny/desktopfx/stable/ ./


And add the certificat to prevent an apt warning.
wget http://download.tuxfamily.org/shames/A42A6CF5.gpg -O- | apt-key add -

And eventually update the package database:
apt-get update


Installing and test-run:

Lets now install Compiz Fusion :D :
apt-get install compiz-fusion-kde

And Emerald which has some nice themes:
apt-get install emerald


To run it, in a terminal you type:
emerald --replace

If you loose the window decorations you should put focus on your shell and type
kwin --replace
or just
kwin


Starting Compiz Fusion automatically at logon:

Create the following file with your favorite file editor (mine is VIM):
vi ~/.kde/Autostart/compiz.desktop

In this file you put this:

[Desktop Entry]
Encoding=UTF-8
Exec=compiz –replace & emerald &
GenericName[en_US]=
StartupNotify=false
Terminal=false
TerminalOptions=
Type=Application
X-KDE-autostart-after=kdesktop


THATS IT :D

In the beginning I had some problems with shadows which where shown as white borders around menus.
If I recall correctly, I turned of the Menu shadows in the KDE Control Center.


Powered by ScribeFire.

woensdag 14 november 2007

Using encryption on your home folder (Debian; also usable for other distros)

Introduction

Imagine someone boots your laptop with a bootable CD and just copies all your data.
The attacker can see whatever data on your home folder (most critical data for most users).

So what I wanted was:
- NO extra partitions (most people have all HDD space partitioned; backup of the encrypted image file is easy)
- NO compiling (I want to be able to quickly setup a system for rescue)

Now I read some stuff and cryptsetup seemed the best solution for this.
All is in the debian package manager and setup is really easy ... so let's go!

Setup

First install cryptsetup:
apt-get install cryptsetup

In this example we use AES encryption.
You can see the supported encryption types:
cat /proc/crypto

If you don't see AES then you (in Debian) you have to load the module (In other distributions it could be that you have to recompile your kernel):
modprobe aes

Now lets create the image file that will hold the filesystem.
This will create the image "cryptedhome" with a blocksize of 1024 bytes with 20000000 blocks (20GB)
dd if=/dev/urandom of=/home/username.crypto.img bs=1024 count=20000000

Now we need to create a loopback device file. This makes your image file transparent so Linux does see it as if it was a device (/dev/sda , /dev/hda, ...):
losetup /dev/loop0 /home/username.crypto.img


The following will setup encryption for this loopback device, so everything that is written to it, will be encrypted.
-c defines what encryption algorithm has to be used.
-s defines the size of the key
--verify-passphrase will make the program ask 2 times for your password before accepting it.
luksFormat tells cryptsetup what to do (others are: luksAddKey, luksDelKey, luksOpen, luksClose)
cryptsetup -c aes-cbc-essiv:sha256 -s 256 --verify-passphrase luksFormat /dev/loop0


The next step is making a device file that makes the encrypted device accessible.
After that we create a filesystem on it.
cryptsetup luksOpen /dev/loop0 cryptedhome

mkfs.ext3 /dev/mapper/cryptedhome

cryptsetup luksClose /dev/loop0 cryptedhome



Usage
Everytime you will want to use the encrypted image, you will need to do the following:
cryptsetup luksOpen /dev/loop0 cryptedhome
mount /dev/mapper/cryptedhome /home/username/

After use just unmount it and use luksClose.
cryptsetup luksOpen /dev/loop0 cryptedhome


Adding/Removing Keys
Adding key:
cryptsetup luksAddKey --verify-passphrase /dev/loop0


Removing key:
cryptsetup luksDelKey --verify-passphrase /dev/loop0



Getting it all automatically done
What we gonna do is for every user that has a ..img file mounting this encrypted filesystem to there home directory.

Install pam_mount. This library makes it possible to mount and unmount devices while authenticating.
apt-get install libpam-mount



Powered by ScribeFire.

donderdag 1 november 2007

PokerTH 0.6 on Debian Lenny AMD64(testing; x86_64)

I downloaded the installer and try to run it but I got the following error:
cd ~/PokerTH-0.6-beta
./pokerth.sh
/home/gvm/PokerTH-0.6-beta/./pokerth: error while loading shared libraries: libmikmod.so.2: cannot open shared object file: No such file or directory

Because of my problem with skype I thought that this is maybe the same problem.
So I copied the script and only changed the first line from:
lib=`skype 2>&1 | awk '{print $7}' | cut -d':' -f1`
to
lib=`./pokerth.sh 2>&1 | awk '{print $7}' | cut -d':' -f1`

For the full script: see my post about Skype

Skype on Debian Lenny AMD64 (testing; x86_64)

First I tried to install through the package manager:
apt-cache search skype

This didn't gave any result.

So I went to the skype website and looked for a debian package.
I found one, but it was for i386 architecture so installing it fails.
Still we can force it to install:
apt-get install --force-architecture skype-debian_1.4.0.118-1_i386.deb

Then I tried to run it but got an error saying that libsigc-2.0.so.0 is missing:
skype: error while loading shared libraries: libsigc-2.0.so.0: cannot open shared object file: No such file or directory

So I thought, I have an unmet dependecy, lets install libsigc package:
sudo apt-get install libsigc++-2.0-0c2a

Now I have the library but still the same error message so it seems that there is another problem.
After some googling I had an explanation why installing the libsigc package did not solve it: skype for i386 architecture needs the 32bit library, not the 64bit library.

Eventually I found a small script that solves these issues:


#!/bin/bash
lib=`skype 2>&1 | awk '{print $7}' | cut -d':' -f1`
echo "lib: $lib" pkg=`dpkg -S $lib | awk '{print $1}' | cut -d':' -f1 | sort -u`
url=`wget -qO- http://packages.debian.org/lenny/$pkg/i386/download | awk '/ftp\.br\.debian\.org/' | cut -d'"' -f2`
file=`echo $url | awk '{n=split($0,a,"/"); print a[n]}'`
if [ ! -f deb/$file ]; then
wget -q $url
mv $file deb
fi
ar -x deb
libfile=`tar ztf data.tar.gz | grep ${lib}$`
tar zxf data.tar.gz $libfile
sudo cp -d $libfile /usr/lib32/
if ls -l $libfile | grep -qF ' -> '; then
lnlib=`ls -l $libfile | awk '{print $10}' | cut -d':' -f1`
libfile2=`tar ztf data.tar.gz | grep ${lnlib}$`
tar zxf data.tar.gz $libfile2
sudo cp -d $libfile2 /usr/lib32/
fi

Source: http://www.debian-administration.org/users/figjam/weblog/1
Note that there is an error in the original script



Now after putting this into a file and making it executable:
chmod +x script

Lets run it:
./script
./script
lib: libQtGui.so.4

Now you will see that each time you run it, another library dependancy get solved (libQtGui will change).
You have to RUN IT MULTIPLE TIMES (this is in CAPITALS for copy-paste people who don't read).

If skype starts, then all librarys are available. From now on you can use "skype" on the command line or launch it from your favorite desktop environment.

Have fun!

Powered by ScribeFire.

woensdag 31 oktober 2007

Using proxy with Debian for apt-get(or Ubuntu) and other apps

If you are in a corporate environment you probably need to pass through a proxy to get on the internet.

The same for getting your debian/ubuntu packages.
You can easily configure this.

There are two possibilities:
  1. Define http_proxy variable for HTTP
    export http_proxy="http://user:password@proxy-dns-name-or-ip:portnumber"
    If you want to use this in a script, make sure you run it as follows:
    . ./proxy-script
    For FTP it is slightly different:
    export ftp_proxy="http://user:password@proxy-dns-name-or-ip:portnumber"
    For RSYNC (NOTICE that there is NO http:// at the start of the value):
    export rsync_proxy="user:password@proxy-dns-name-or-ip:portnumber"
  2. Adding this to the apt.conf file (does only makes apt-get to use the proxy)
    Aqcuire::http::Proxy "http://user:password@proxy-dns-name-or-ip:portnumber"
This will work for alot of shell tools (ftp, wget, ...) but some programs do create there own system for using a proxy.
  1. Firefox: "Edit", "Preferences", "Advanced", "Network", "Settings" and then select "Auto-detect proxy settings for this network"
  2. In KDE you can also change the proxy using the Control Center. Just search on proxy and you will find it
  3. (to be continued)

Hopes this is helpful.

Using Debian Lenny (testing)

I needed Debian Lenny (testing) to get my graphics working.

This is how you do it:
  1. edit /etc/apt/sources.list and replace "etch" with "lenny"
  2. update the apt cache
    apt-get update
  3. Now you can upgrade your packages:
    apt-get upgrade
  4. And finally:
    apt-get dist-upgrade


Ain't that easy?

HDA Intel Audio on Dell Latitude D630 (tested on Debian)

First let us look what hardware my audio card is:
lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)

More detailed:
lspci -vv | grep -i audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller
(rev 02)
Subsystem: Dell Unknown device 01f9
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step
ping- SERR+ FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 21
Region 0: Memory at fe9fc000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3ho
t+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0
Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [70] Express Unknown type IRQ 0
Device: Supported: MaxPayload 128 bytes, PhantFunc 0, ExtTag-
Device: Latency L0s unlimited, L1 unlimited
Device: Errors: Correctable- Non-Fatal- Fatal- Unsupported-
Device: RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
Device: MaxPayload 128 bytes, MaxReadReq 128 bytes
Link: Supported Speed unknown, Width x0, ASPM unknown, Port 0
Link: Latency L0s <64ns, L1 <1us
Link: ASPM Disabled CommClk- ExtSynch-
Link: Speed unknown, Width x0
Capabilities: [100] Virtual Channel
Capabilities: [130] Unknown (5)

Ok, it seems that I need the hda-intel modules.
But it looks like the necessary modules are already loaded.

This is what you have to do to fix this:
Download this source tarball:
wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.15rc3.tar.bz2
tar jxvf alsa-driver-1.0.15rc3.tar.bz2
cd alsa-driver-1.0.15rc3
./configure
make
make install # as root


Source: http://forum.ubuntu-nl.org/topic/14940/1

To configure alsa for your audio card use alsaconf:
apt-get install alsa-utils
alsaconf

Select the appropriate card (hda-intel)
Be sure your audio channels aren't muted
alsamixer

See for the "front" channel, it should have "00" at the bottom.
If there is "MM" instead of "00" under the channel it is muted; use the "m" on your keyboard to unmute.

That's it!

HINT: if you have problems getting your audio to work it is always good to use the testing (lenny branch) for apt-get and update your system(or only the packages that have to do with alsa).

Powered by ScribeFire.