sexta-feira, 19 de novembro de 2010

Slackware: Unpack initrd.img

Unpack:
$ gzip -dc ../initrd.img | cpio -i -d -H newc --no-absolute-filenames
Pack:
$ find . -print | cpio -o -H newc | gzip -9 > ../initrd.img

segunda-feira, 15 de novembro de 2010

Shell: Battery monitor

BATTERY_DEVICE=$(hal-find-by-property --key info.category --string battery | head -n 1)
if test -z "${BATTERY_DEVICE}" ; then
BATTERY=0
else
BATTERY=$(hal-get-property --udi ${BATTERY_DEVICE} --key battery.charge_level.percentage)
fi
echo " ${BATTERY}% "

Drunk Penguins

Drunk Penguins
Drunk Penguins