31/12/2007

Ndiswrapper and WPA in a (nut)shell

Say hello to Hactar: cheap office PC (presumably AMD Sempron and some or other chipset) gracing my parents' WPA1-encrypted network via a Siemens Gigaset 108 USB WLAN adapter. The Gigaset is supposed to have an atheros chip, but apparently madwifi cannot handle USB devices yet, so it had to be ndiswrapper. Network cards set up with ndiswrapper don't seem to show up in Yast without effort, so I did it quick n' dirty in a shell.
Note: the ndiswrapper wraps Windows drivers compliant to the Network Driver Interface Specification for use under Linux. The following HowTo is in part taken from openSuSE.

You need the packages ndiswrapper, wpa_supplicant, dhcpcd (all in SuSE distro), and the Windows driver from the installation CD (net5523.inf worked for me).
Do the following in a root shell (in whatever directory you copied the Windows drivers to):
# ndiswrapper -i net5523.inf (install)
# ndiswrapper -l (list drivers, you should get the net5523 here)
Now plug in you WLAN adapter.
# modprobe ndiswrapper
See if you find a wlan0 entry in the ouput of the following lines, note the missing configuration data in iwconfig.
# dmesg
# iwconfig
Scan for available networks:
# iwlist scan
Create a configuration file
# vi /etc/wpa_supplicant.conf
containing this (with the appropriate ESSID and PSK key):
network={
ssid="networkname"
scan_ssid=1
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="mypsk"
}

The next lines do the actual network setup by starting the adapter, setting up the network configuration with wpa_supplicant and getting an IP with dhpcd (if you want a fixed IP, set it with ifconfig). As this is the part to do after every boot, I copied all this to a shell script.
# ifconfig wlan0 up
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
# dhcpcd wlan0


I suppose you can put all this in a startup script in /etc/init.d, but by this time my vacation was up.
BTW, the ndiswrapper module has to be reloaded after a kernel update with modprobe ndiswrapper. I put it also into the shell script (first line), just in case.
A nice overview over network-related shell commands can be found at Wirelessdefence.org.

07/12/2007

HowTo automount external ntfs-formatted USB hard drives with write permissions for normal users AND the correct locale...

To automount your hard drive with write permissions, first backup your fstab.

su
cp /etc/fstab /etc/fstab.bak

Then plug in your drive and give it write permissions in ntfs-config. This puts and entry in fstab, which effectively prevents HAL from automounting the drive. So you need to replace the new fstab with your backup. Then unmount your drive.

cp /etc/fstab.bak /etc/fstab
umount /dev/sdXY

If you now try to mount your drive in Konqueror with right-click --> Mount, it should give you an error message. Now edit your /etc/PolicyKit/PolicyKit.conf and put in any users or UIDs who need to be able to mount the drive.
<config version="0.1">
<match action="hal-storage-mount-removable-*">
<match user="taaris|1001">
<return result="yes">
</return>
</match></match>

Then reload the settings.

polkit-reload-config

If you now plug in your drive or mount it in Konqueror, it should be mounted with read/write permission for everyone.


To mount it (and everything else you mount with ntfs-3g as well) with the correct locale, you need to replace /sbin/mount.ntfs-3g with a small bash script.

su
mv /sbin/mount.ntfs-3g /sbin/mount.ntfs-3g.bak
touch /sbin/mount.ntfs-3g
echo '#!/bin/bash
/bin/ntfs-3g -o locale=de_DE.UTF-8 $1 $2' > /sbin/mount.ntfs-3g
chmod +x /sbin/mount.ntfs-3g

Sources (info, not code!) can be found here and here.

04/12/2007

HowTo (almost) synchronize your Motorola RAZR V3 with KAddressBook

Enable bluetooth. YaST --> Hardware --> Bluetooth

Then plug in your dongle, kbluetooth should start automatically and settle into your systray. Right-click on it and select "KBlueMon". Enable "FindMe" mode ("Sichtbar" in German) and start scanning.

To put new ringtones (32 kbps/22kHz for mp3s is definitely enough) on your phone, right click on KBluetooth again, then select "Send File". Find the file you want to send, select your phone and click "Send". Wow, that was easy ;-)

To bind your phone to a device node (eg. to use in kitchensync or kmobiletools), first figure out its MAC address by

hcitool scan

then configure rfcomm by editing your /etc/bluetooth/rfcomm.conf file and putting in an entry like

rfcomm0 {
bind yes;
device 00:12:8A:A3:70:34;
channel 1;
comment "taaris RAZR V3";
}

now you can either reboot, or bind manually

rfcomm bind all

then create the device node, if you don't have it already

mknod /dev/rfcomm0 c 216 0

Now get the permissions sorted out. Create a group called phone and put yourself (and anyone else who's going to access your gadget) in it. Restart your session.

chgrp phone /dev/rfcomm0 (you might have to repeat this if you cannot access the device anymore after a reboot)
chmod 660 /dev/rfcomm0

To give credit where it's due, most of this info was found here.

Now you can configure kmobiletools to use with your RAZR V3. Not that this is really helpful at the moment, since you cannot actually synchronize your phone just yet - but let's hope for KDE4 and KDEPIM.

launch kmobiletools
Settings --> Main Settings. The Configure dialog will pop up.
nnder Devices set:
'Mobile phone device': /dev/rfcomm0
Leave other settings at defaults.
Under Mobile phone set:
'Phone type': Generic GSM device
'Dialing options': CKPD dial System
Select the 'Use Motorola battery indicator' check box.

Then go to Settings --> Reinitialize GSM Device.

27/11/2007

Who is using IDL anyway?

I am porting some video data analysis scripts (written in IDL) to Linux just now. Installing was the usual struggle: Archimedes' mainboard is not supported by older OS's, so 10.3 it had to be. On the other hand, the slightly dated IDL version (new licences are pretty expensive) doesn't work with xorg-x11-libs > 6.8. Makeshift workaround: install/deinstall the old lib before and after using IDL and use no other graphical apps inbetween. I'm not amused.
Should have learned Python right away.

24/11/2007

ATI Catalyst 7.11 (AKA fglrx 8.433), AIGLX and compiz

This time I adhered to The Gospel According To CyberOrg:

I prepared my kernel sources as I did with fglrx 8.40, forced an aticonfig and edited my xorg.conf by hand instead of having it written by sax2. Benefits: much smaller file.


# cd /usr/src/linux
# make mrproper
# make cloneconfig
# make modules_prepare
# make clean
# rpm -e $(rpm -qa |grep fglrx)
# cd <directory where you put the driver>
# sh ./ati-driver-installer-x.xx.x-yy.run --buildpkg SuSE/SUSE102-AMD64
# rpm -Uhv <some or other fglrx>.rpm
# aticonfig --initial --input=/etc/X11/xorg.conf --force

Don't run sax2 now!
Modify /etc/X11/xorg.conf
Section “Module”
     Load “dbe”
     Load “type1″
     Load “freetype”
     Load “extmod”
     Load “glx”
     Load “dri”

EndSection

Section “ServerFlags”
     Option “AllowMouseOpenFail” “on”
     Option “IgnoreABI” “on”
     Option “AIGLX” “true”
EndSection

Section “Device”
     Identifier “aticonfig-Device[0]”
     Driver “fglrx”
     Option “FSAAEnable” “off”
     Option “Capabilities” “0×00000000″
     Option “VideoOverlay” “on”
     Option “OpenGLOverlay” “off”
     Option “FSAAScale” “0″
     Option “XAANoOffscreenPixmaps” “true”

EndSection

Section “Extensions”
     Option “DAMAGE” “true”
     Option “Composite” “true”

EndSection

Modify
/usr/bin/compiz-manager:
COMPIZ_OPTIONS="--no-libgl-fallback --ignore-desktop-hints --replace"
WHITELIST="nvidia intel ati radeon i810 fglrx“


and change "Xgl" for "Xorg" in /etc/sysconfig/displaymanager.

Works, at least if I don't run Compiz and video apps at the same time.

23/11/2007

Bloody bleeding edge - KDE4 in openSuSE 10.3

openSuSE is known to be somewhat experimental in its package selections - like shipping a new release including an Xorg RC...
In 10.3 they have some fun with mixing up KDE 3 and 4 by default - such as including krdc/KDE4 in default KDE, which program completely failed to connect me to any VNC server.
Equally confusing is the fact that in KDE4 they isolated some programs out of rpms containing entire suites in KDE3. For example, if you search for "karamba" by name and summary in Yast, you will get KDE4-Superkaramba only (didn't work on KDE3 for me). A search by description gives you the kdeutils3-extra suite containing KDE3-Superkaramba.

I hope they will clear this up before releasing KDE4 for openSuSE...

15/11/2007

Beautifying Katapult

During my quest to polish Pandora's looks, I also figured out how to remove that ugly second shadow from the Katapult window when running compiz. It's as easy as running ccsm, going to the "Window Decoration" plugin and entering !name=katapult in "Shadow windows".

Truetype fonts on KDE

Installing additional TrueType fonts on KDE:

KDE Control Centre -> System Administration -> Font Installer

Life can be so easy...