24/01/2008

Fun with MPlayer and ImageMagick

Just a loose collection of stuff I found very easy to do with MPlayer and, occasionally, ImageMagick.

11/01/2008

change LCD brightness

If you cannot change your LCD brightness under openSUSE 10.3, this might be due to a "feature" in the new xorg which prevents the module video.ko from being loaded. The following steps will help you regain control over your LCD brightness again. Yaaaaaay for battery life!

sudo vi /etc/modprobe.d/xorg-x11-driver-video

Comment out the line "install video /bin/true"

sudo modprobe video

If the module loaded correctly, you should now have a file called /proc/acpi/video/VGA/LCD/brightness.

Now open kpowersave. You should be able to enable scheme specific brightness settings. Play around with the slider until you find your preferred brightness. At least on my computer (Toshiba Satellite A100-01L), the percentages do not correspond to the actual brightness levels, so you might have to fiddle around a bit until you get your settings sorted out.

I can set my brightness to 8 different levels, which correspond to the following percentages on the slider: 100 - 90 - 75 - 60 - 50 - 35 - 25 - 24

To load the module at boot time, go to

YaST --> System --> /etc/sysconfig editor --> system/kernel/MODULES_LOADED_ON_BOOT

and add "video" (without the quotes).

Source.

Edit: It seems that you need to repeat the commenting out part after each update of xorg-x11-driver-video. Fortunately though, those don't seem to happen too often - otherwise I would've noticed that much sooner.

04/01/2008

I'm sorry, Dave, I'm afraid I can't mount that...

Some experimental research on HAL automount issues. I've let this posting lie idle for weeks, so I have to rely on my somewhat vague memory here.

4 guinea pigs (Xanthippe, Tisiphone, Archimedes and Hactar), each starting off with openSuSE 10.3. All but Hactar experienced a HAL automount failure for USB drives after a kernel update. Both dmesg and lsusb identified the devices correctly, mounting by hand as root worked also.

A similar problem has been solved in some forums by reverting to an older HAL version, but that one must be prehistoric by now. I fiddled a bit with HAL policies, as explained in this KDE list posting, but with no success.

As it turned out, Archimedes had the gparted issue posted by taaris, what I did with Xanthippe I can't remember (miracle healing after just another kernel/HAL update?), and Tisiphone got a clean reinstall of the whole distribution after even CD/DVD mounting failed - I had additional graphics problems anyway.

So, everything is working again and I have no idea how or why - maybe some rogue update messed with a config file I don't know about...

01/01/2008

GParted and automount

Do your KDE automounting abilities appear to be broken after installing GParted? Here's how to fix it. This has been driving my crazy!

# cd /usr/share/hal/fdi/policy/

# rm gparted-disable-automount.fdi

Now why does GParted have to mess with HAL in the first place? The solution was found here, btw.

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.