Mounting DOS HDD image

Mounting dos hdd image, first partition:

mount -o loop,offset=32256 dos-hdd.img dir

I’m using such image to update BIOSes in machines where bios doesn’t fit into floppy image. Such hdd image can be places inside iso image to be booted at virtual or real cdrom.

mkisofs -v -r -T -J –hard-disk-boot -b dos-hdd.img -o ../test.iso .

Asus E35M1-I DELUXE, surround 5.1 sound and dmix

Make HDMI card be second while SB card be first one:


options snd-hda-intel index=1,0

Enable dmix with surround 5.1 support (no upmixing):


pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid false # let multiple users share
ipc_perm 0666 # IPC permissions (octal, default 0600)
slave {
pcm "hw:0,0"
channels 6
# buffer_size 16384
}
}

pcm.!default {
type plug
slave.pcm dmixer
slave.channels 6
}

to /etc/asound.conf. Enable 6 channels in alsamixer, too.

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.

Tabs, vim and 256 colors – tips

Having tabs and spaces visible as separate entities in vim is very neat feature especially if you use colors to differentiate.

Switch TERM to konsole-256color in kde konsole terminal emulator (or whatever emulator you use – rpm -ql ncurses terminfo | grep 256 for more) and put into .vimrc:


colorscheme darkblue
highlight TabGroup ctermbg=233 guibg=233
match TabGroup /t/

Now tab characters are a bit brighter than spaces.

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.

DNS vulnerability testing

How to test if your caching nameserver is vulnerable to recently hot cache poisoning issue:

dig @ip_of_your_caching_ns +short porttest.dns-oarc.net TXT

Example:

$ dig @192.168.1.254 +short porttest.dns-oarc.net TXT
z.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.
"x.y.z.q is GOOD: 26 queries in 5.0 seconds from 26 ports with std dev 17652.90"