DRI PRIME

Multiple graphic cards accessible from Linux:

$ glxinfo |grep -i renderer
OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset
$ DRI_PRIME=1 glxinfo |grep -i renderer
OpenGL renderer string: Gallium 0.4 on AMD RV620

$ xrandr –listproviders
Providers: number : 2
Provider 0: id: 0x83 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 3 associated providers: 0 name:Intel
Provider 1: id: 0x54 cap: 0xd, Source Output, Source Offload, Sink Offload crtcs: 2 outputs: 3 associated providers: 0 name:radeon
$ xrandr –setprovideroffloadsink 0x54 0x83
$ xrandr –listproviders
Providers: number : 2
Provider 0: id: 0x83 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 3 associated providers: 1 name:Intel
Provider 1: id: 0x54 cap: 0xd, Source Output, Source Offload, Sink Offload crtcs: 2 outputs: 3 associated providers: 1 name:radeon

Google for more.

Eating power – Intel GM45 vs Radeon HD 3400

ThinkPad T400 switched into integrated gpu mode – running Intel GM45 eats ~12W of power.
ThinkPad T400 switched into discrete gpu mode – running Radeon HD 3400 eats … ~28W of power!

Which means that radeon itself eats more than 16W of power (meausred with powertop). That’s more than whole notebook in integrated gpu mode. Nightmare!

Note that HD 3400 was driven by open source radeon driver which doesn’t have any power management support at this moment.

200904 update: ati driver in git contains updated power management and it’s eating ~16W here instead of ~28W now with DynamicPM turned on.

Very fast IPv6 setup on PLD/Linux Th

If you need IPv6 on some PLD Th machine, like in my case laptop, you can just do:

poldek -uGv miredo-client-teredo
service miredo-teredo start

and verify that IPv6 works by doing for example:

mtr -6 www.pld-linux.org

This solution doesn’t require any configuration (well, there are some options that can be altered). It should work even if you are behind some NATs and other weird gateways thanks to Teredo.

Working setup causes new interface to appear, for example:

20: teredo: mtu 1280 qdisc pfifo_fast state UNKNOWN qlen 500
link/[65534]
inet6 2001:x:xx:xx:xx:xx:xx:e4b6/32 scope global
valid_lft forever preferred_lft forever
inet6 fe80::ffff:ffff:ffff/64 scope link
valid_lft forever preferred_lft forever

Of course there are other solutions for non-native IPv6 like 6to4 (pure rc-scripts are enough), ISATAP (see miredo-client-isatap package) or just typical SIT tunnel.

Booting PLD/DOS from USB pendrive

Create partition on your flash drive (using fdisk or cfdisk). Mark one of partitions bootable in fdisk/cdisk. Format that partition with FAT/FAT32 filesystem:

mkfs.vfat -F 32 /dev/sdXY

where sdXY is your partition.

Mount it and copy contents of PLD RescueCD like x86 and x86_64 ISO image to that partition, to /rcd subdirectory.

Make MBR record:

ms-sys -s /dev/sdX

(where sdX is entire flash disk; ms-sys comes from ms-sys package)

Copy syslinux configuration for USB to root directory of your flash drive as syslinux.cfg. DOS/Windows image should be placed in /rcd/boot/dos.gz (compress it with gzip first).

Run:

syslinux -s /dev/sdXY

to load syslinux onto your flash drive.

Reboot your system and check if it boots correctly 🙂

Note that some systems have problems with booting from flash driver (especially big like 1G or 2G flash drives).

Booting PLD RescueCD from LILO

Copy files from rescuecd iso image and add section similar to this one to lilo.conf:

image=/boot/rescuecd-20070617/boot/isolinux/vmlinuz
label=rcd
root=/dev/ram0
initrd=/boot/rescuecd-20070617/rescue.cpi
append=" console=tty0 console=ttyS1,38400n81 panic=60"

AppArmor protection for your Apache (including mod_php, mod_python and others)

The biggest weak of Apache httpd web server is lack of security when using it in multiuser enviroment.
All httpd processes run under the same UID and GID which means that user JOE can create simple
php script which when run via httpd will be able to open and read other users web files (which means
that other users database passwords hidden somewhere in web configuration files are not protected).

There are some ways to protect your files: (more…)