Sunday, January 31, 2010

This sucks

I'm giving up on this blog system. It has too many faults.

The user interface is really bad. It's difficult to structure content using h1 and similar tags. Also preview doesn't show these tags.

So after spending more time trying to use this system than actually writing stuff, I'm going to test google sites instead: http://sites.google.com/site/anotater

The content here will slowly be moved, and then deleted.

Sunday, July 26, 2009

Gentoo utilities file and package info

qlist
all installed packages:

$ qlist -I
app-accessibility/epos
app-accessibility/festival
app-accessibility/flite
app-accessibility/freetts
app-accessibility/speech-tools
app-admin/apache-tools
...


qlist will match regexp on substring.

$ qlist -I perl
app-admin/perl-cleaner
dev-lang/perl
dev-perl/AnyEvent
dev-perl/Authen-SASL
dev-perl/Cairo
...
$ qlist -I perl/.*sq
dev-perl/DBD-mysql


Finding files belonging to an installed package

$ qlist .*perl/.*sq
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/auto/DBD/mysql/mysql.so
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/DBD/mysql.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/DBD/mysql/GetInfo.pm
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/DBD/mysql/INSTALL.pod
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/Bundle/DBD/mysql.pm
/usr/share/doc/DBD-mysql-4.00.5/README.bz2
/usr/share/doc/DBD-mysql-4.00.5/ChangeLog.bz2

Slot information

$ qlist -S kde-base/ | head
kde-base/akonadi 4.2
kde-base/akregator 4.2
kde-base/amor 4.2
kde-base/ark 4.2
kde-base/automoc 0
kde-base/blinken 4.2


qfile
The brother of qlist is qfile.
Find which package a file belongs to:

$ qfile /usr/share/doc/DBD-mysql-4.00.5/README.bz2
dev-perl/DBD-mysql (/usr/share/doc/DBD-mysql-4.00.5/README.bz2)


Also works with substring match (but not regexp?)

$ qfile README
app-cdr/cdrtools (/usr/share/doc/cdrtools-2.01.01_alpha57-r1/cdda2wav/README)
app-cdr/cdrtools (/usr/share/doc/cdrtools-2.01.01_alpha57-r1/cdrecord/README)
app-cdr/cdrtools (/usr/share/doc/cdrtools-2.01.01_alpha57-r1/mkisofs/README)
sys-kernel/genkernel (/usr/share/genkernel/modules/README)
sys-kernel/genkernel (/usr/share/genkernel/patches/busybox/1.7.4/README)
sys-kernel/gentoo-sources (/usr/src/linux-2.6.29-gentoo-r5/Documentation/ABI/README)
...


And where to find these tools, and what other tools are there:

$ qlist `qfile -qC qfile` | grep bin
/usr/bin/q
/usr/bin/qatom
/usr/bin/qcache
/usr/bin/qcheck
/usr/bin/qdepends
/usr/bin/qfile
/usr/bin/qglsa
/usr/bin/qgrep
/usr/bin/qlist
/usr/bin/qlop
/usr/bin/qmerge
/usr/bin/qpkg
/usr/bin/qsearch
/usr/bin/qsize
/usr/bin/qtbz2
/usr/bin/quse
/usr/bin/qxpak

Or just try the q command to get descriptions as well. :)

equery
equery does similar things as qlist

$ equery l
[ Searching for all packages in all categories among: ]
* installed packages
[I--] [ ~] app-accessibility/epos-2.5.37-r1 (0)
[I--] [ ] app-accessibility/festival-1.96_beta (0)
[I--] [ ] app-accessibility/flite-1.2-r1 (0)
[I--] [ ] app-accessibility/freetts-1.2.1-r1 (0)
[I--] [ ] app-accessibility/speech-tools-1.2.96_beta (0)
[I--] [ ] app-admin/apache-tools-2.2.11 (0)
...

$ equery l kde-base/
[ Searching for all packages in 'kde-base' among: ]
* installed packages
[I--] [ ~] kde-base/akonadi-4.2.4 (4.2)
[I--] [ ~] kde-base/akregator-4.2.4 (4.2)
[I--] [ ~] kde-base/amor-4.2.4 (4.2)
[I--] [ ~] kde-base/ark-4.2.4 (4.2)
[I--] [ ] kde-base/automoc-0.9.88 (0)
[I--] [ ~] kde-base/blinken-4.2.4 (4.2)
...

$ equery l -I -p -f sci.*/.*meme
[ Searching for package '.*meme' in 'sci.*' among: ]
* Portage tree (/usr/portage)
[-P-] [M~] sci-biology/embassy-memenew-0.1.0 (0)
[-P-] [M~] sci-biology/embassy-memenew-0.1.0-r1 (0)
[-P-] [M~] sci-biology/meme-3.5.4-r1 (0)
[-P-] [M~] sci-biology/meme-3.5.7 (0)


equery can find files in installet packages

$ equery f app-portage/gentoolkit | grep bin
/usr/bin
/usr/bin/eclean
/usr/bin/eclean-dist
/usr/bin/eclean-pkg
/usr/bin/epkginfo
/usr/bin/equery
/usr/bin/eread
/usr/bin/euse
/usr/bin/glsa-check
/usr/bin/revdep-rebuild
/usr/sbin


But I don't think the equivalence of qfile is here.

epkginfo is cool though:

$ epkginfo kde-meta
Package: kde-base/kde-meta
Herd: kde
Maintainer: kde
Location: /usr/portage/kde-base/kde-meta
Keywords: kde-meta-3.5.9:
Keywords: kde-meta-3.5.10: alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~mips
Keywords: kde-meta-4.2.4: ~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~x86

Saturday, July 25, 2009

Hardware inspection tools

lshw (sys-apps/lshw)

lspci

lsusb

cat /proc/cpuinfo

rsync and screen

rsync is a file copying tool that has the ability to compare source and target directories and only copy differences.

The following is a script that copies data from one machine to another.

#!/bin/sh
SOURCE=source.site.no:/home/atle/file/dir
TARGET=/home/atle/download
KBPS=30
rsync -v -u -a --compress --delete --progress --bwlimit=$KBPS --rsh="ssh" $SOURCE $TARGET


The options I'm using is something I just copied from a backup-script. They work so I haven't spent time on it. The only thing I added was bwlimit to limit band with to 30 kilobyte per sec. This is because the source has limited band with on the up link.

screen
screen is a so called terminal multiplexer. It can run several terminals at once in one terminal, and switch between them. Also it is possible to detach from screen and leave it running as a background process, and later connect to it again.

What I use this for is:
Logging on to a remote machine from home.
Starting screen
Starting the rsync script
Press Ctrl-a d to detach from screen.
Log off

Later logging on to remote machine again
Start screen with -r option to reattach
Check download status, and if necessary restart the script to continue an interrupted download

Monday, July 20, 2009

Java maintenance

java-check-environment will check the java environment, and give information about problems and remnants of old installations not needed any more.


# java-check-environment
* === Java Environment Checker ===
* The purpose of this script is to check the sanity of your Java Environment.
* We have significantly changed and improved the way Java is handled in many
* respects.
* Please refer to our upgrade guide for details:
* http://www.gentoo.org/proj/en/java/java-upgrade.xml

* Checking fastjar ... [ ok ]

* Checking vm_environment_files ... [ ok ]

* Checking user_settings ...
* Running as root. Don't need to check user settings. [ ok ]

* Checking generation_1_system_vm ... [ ok ]

* Checking java_config_1 ...
* dev-java/java-config:0 (version 1.x) seems to be installed
* It is no longer needed, you can uninstall it.
$ emerge -av --depclean dev-java/java-config:0 [ ok ]

* Checking global_classpath ... [ ok ]

* Checking virtual_provides ... [ ok ]

* Checking overlays_eclasses ... [ ok ]

* Checking package_env ... [ ok ]

* Checking proc_mounted ... [ ok ]

* Java environment is sane. Congratulations!


Do doing as suggested removes the old crud.

# emerge -av --depclean dev-java/java-config:0

Calculating dependencies... done!

>>> These are the packages that would be unmerged:

dev-java/java-config
selected: 1.3.7-r1
protected: none
omitted: 2.1.8-r1

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

Would you like to unmerge these packages? [Yes/No]
...

kmail wants to use .kde4.0

I tried starting kmail on my job computer, for det first time after upgrading kde to 4.2.4


$ kmail -v
Qt: 4.5.1
KDE: 4.2.4 (KDE 4.2.4)
KMail: 1.11.4




And then kmail exits!

The correct path should be .kde4. I could of course symlink, but that is the cowardly way out.

Reemerging kmail didn't work.

Update:
This is a strange one indeed. A test on my two other computers revealed no similar problems. I've posted a question on the gentoo forums.

Update:
This was embarrassing. There was some old settings in the .kde4 folder the messed up. I search for this everywhere but the most obvious place.


~/.kde4 $ grep -R kde4\.0 .
./share/config/kmailrc:folders[$e]=$HOME/.kde4.0/share/apps/kmail/mail

Sunday, July 19, 2009

X freezes when changing channel on receiver

Watching /var/log/everything. When switching channel away, this appeared. But plenty of these both in the kernel log, and I dmesg is "normal" with my setup.

Jul 19 19:23:15 [kernel] [fglrx:firegl_find_any_map] *ERROR* Invalid map handle!<3>[fglrx:drm_vm_open] *ERROR* map not found -> inconsistent kernel data!!! vma_start:0x7fbced85b000,handle:0xd1694000
Jul 19 19:23:15 [kernel] [fglrx:firegl_find_any_map] *ERROR* Invalid map handle!<3>[fglrx:drm_vm_close] *ERROR* map not found -> inconsistent kernel data!!! vma_start:0x7fbced85b000,handle:0xd1694000


More interesting is Xorg.0.log. When changing channel away:

(II) fglrx(0): Hot-plug event occurs on device: 1:0:0
(II) Loading sub module "ddc"
(II) LoadModule: "ddc"
(II) Module "ddc" already built-in
DRIUnlock called when not locked


And when switching back again:

(II) fglrx(0): Hot-plug event occurs on device: 1:0:0
(II) Loading sub module "ddc"
(II) LoadModule: "ddc"
(II) Module "ddc" already built-in
(II) fglrx(0): Check EDID for requested display: DFP on internal TMDS
(II) fglrx(0): Display1 EDID data ---------------------------
(II) fglrx(0): Manufacturer: SNY Model: 4c01 Serial#: 16843009
(II) fglrx(0): Year: 2008 Week: 10
(II) fglrx(0): EDID Version: 1.3
(II) fglrx(0): Digital Display Input
(II) fglrx(0): Max Image Size [cm]: horiz.: 115 vert.: 65
(II) fglrx(0): Gamma: 2.20
(II) fglrx(0): DPMS capabilities: Off
(II) fglrx(0): Supported color encodings: RGB 4:4:4 YCrCb 4:4:4
(II) fglrx(0): First detailed timing is preferred mode
(II) fglrx(0): redX: 0.633 redY: 0.333 greenX: 0.205 greenY: 0.702
(II) fglrx(0): blueX: 0.150 blueY: 0.081 whiteX: 0.292 whiteY: 0.322
(II) fglrx(0): Supported established timings:
(II) fglrx(0): 640x480@60Hz
(II) fglrx(0): Manufacturer's mask: 0
(II) fglrx(0): Supported detailed timing:
(II) fglrx(0): clock: 27.0 MHz Image Size: 1152 x 648 mm
(II) fglrx(0): h_active: 720 h_sync: 732 h_sync_end 796 h_blank_end 864 h_border: 0
(II) fglrx(0): v_active: 576 v_sync: 581 v_sync_end 586 v_blanking: 625 v_border: 0
(II) fglrx(0): Supported detailed timing:
(II) fglrx(0): clock: 74.2 MHz Image Size: 1150 x 648 mm
(II) fglrx(0): h_active: 1280 h_sync: 1390 h_sync_end 1430 h_blank_end 1650 h_border: 0
(II) fglrx(0): v_active: 720 v_sync: 725 v_sync_end 730 v_blanking: 750 v_border: 0
(II) fglrx(0): Monitor name: SONY AVAMP
(II) fglrx(0): Ranges: V min: 49 V max: 61 Hz, H min: 15 H max: 75 kHz, PixClock max 170 MHz
(II) fglrx(0): Number of EDID sections to follow: 1
(II) fglrx(0): EDID (in hex):
(II) fglrx(0): 00ffffffffffff004dd9014c01010101
(II) fglrx(0): 0a120103807341782a1bbea25534b326
(II) fglrx(0): 144a5220000001010101010101010101
(II) fglrx(0): 0101010101018c0ad090204031200c40
(II) fglrx(0): 5500808842000018011d007251d01e20
(II) fglrx(0): 6e2855007e884200001e000000fc0053
(II) fglrx(0): 4f4e59204156414d500a2020000000fd
(II) fglrx(0): 00313d0f4b11000a202020202020012d
(II) fglrx(0): End of Display1 EDID data --------------------
(II) fglrx(0): Primary Controller - DFP on internal TMDS
(II) fglrx(0): Total of 28 modes found for primary display.
(--) fglrx(0): Virtual size is 1920x1080 (pitch 1920)
(**) fglrx(0): *Mode "1920x1080": 148.5 MHz (scaled from 0.0 MHz), 67.5 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1920x1080"x60.0 148.50 1920 2008 2052 2200 1080 1084 1089 1125 (67.5 kHz)
(**) fglrx(0): Default mode "1920x1080": 148.5 MHz (scaled from 0.0 MHz), 56.2 kHz, 50.0 Hz
(II) fglrx(0): Modeline "1920x1080"x50.0 148.50 1920 2448 2492 2640 1080 1084 1089 1125 (56.2 kHz)
(**) fglrx(0): Default mode "1920x1080": 74.2 MHz (scaled from 0.0 MHz), 33.8 kHz, 30.0 Hz (I)
(II) fglrx(0): Modeline "1920x1080"x30.0 74.25 1920 2008 2052 2200 1080 1084 1094 1125 interlace (33.8 kHz)
(**) fglrx(0): Default mode "1920x1080": 74.2 MHz (scaled from 0.0 MHz), 28.1 kHz, 25.0 Hz (I)
(II) fglrx(0): Modeline "1920x1080"x25.0 74.25 1920 2448 2492 2640 1080 1084 1094 1125 interlace (28.1 kHz)
(**) fglrx(0): *Mode "1776x1000": 147.1 MHz (scaled from 0.0 MHz), 62.1 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1776x1000"x60.0 147.05 1776 1880 2072 2368 1000 1001 1004 1035 +hsync (62.1 kHz)
(**) fglrx(0): Default mode "1776x1000": 69.2 MHz (scaled from 0.0 MHz), 31.1 kHz, 30.0 Hz (I)
(II) fglrx(0): Modeline "1776x1000"x30.0 69.18 1776 1824 2000 2224 1000 1001 1004 1037 interlace +hsync (31.1 kHz)
(**) fglrx(0): *Mode "1680x1050": 146.2 MHz (scaled from 0.0 MHz), 65.3 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1680x1050"x60.0 146.25 1680 1784 1960 2240 1050 1053 1059 1089 +hsync (65.3 kHz)
(**) fglrx(0): *Mode "1440x900": 106.5 MHz (scaled from 0.0 MHz), 55.9 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1440x900"x60.0 106.50 1440 1520 1672 1904 900 903 909 934 +hsync (55.9 kHz)
(**) fglrx(0): *Mode "1440x576": 54.0 MHz (scaled from 0.0 MHz), 31.2 kHz, 50.0 Hz
(II) fglrx(0): Modeline "1440x576"x50.0 54.00 1440 1464 1592 1728 576 581 586 625 +hsync (31.2 kHz)
(**) fglrx(0): *Mode "1440x480": 54.0 MHz (scaled from 0.0 MHz), 31.5 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1440x480"x60.0 54.05 1440 1472 1596 1716 480 489 495 525 +hsync +vsync (31.5 kHz)
(**) fglrx(0): *Mode "1400x1050": 121.8 MHz (scaled from 0.0 MHz), 65.3 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1400x1050"x60.0 121.75 1400 1488 1632 1864 1050 1053 1057 1089 +hsync (65.3 kHz)
(**) fglrx(0): *Mode "1280x1024": 108.0 MHz (scaled from 0.0 MHz), 64.0 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1280x1024"x60.0 108.00 1280 1328 1440 1688 1024 1025 1028 1066 (64.0 kHz)
(**) fglrx(0): *Mode "1280x960": 108.0 MHz (scaled from 0.0 MHz), 60.0 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1280x960"x60.0 108.00 1280 1376 1488 1800 960 961 964 1000 (60.0 kHz)
(**) fglrx(0): *Mode "1280x768": 79.5 MHz (scaled from 0.0 MHz), 47.8 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1280x768"x60.0 79.50 1280 1344 1472 1664 768 771 778 798 +hsync (47.8 kHz)
(**) fglrx(0): *Mode "1280x720": 74.2 MHz (scaled from 0.0 MHz), 45.0 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1280x720"x60.0 74.25 1280 1390 1430 1650 720 725 730 750 (45.0 kHz)
(**) fglrx(0): Default mode "1280x720": 74.2 MHz (scaled from 0.0 MHz), 37.5 kHz, 50.0 Hz
(II) fglrx(0): Modeline "1280x720"x50.0 74.25 1280 1720 1760 1980 720 725 730 750 (37.5 kHz)
(**) fglrx(0): *Mode "1152x864": 81.6 MHz (scaled from 0.0 MHz), 53.7 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1152x864"x60.0 81.62 1152 1216 1336 1520 864 865 868 895 +hsync (53.7 kHz)
(**) fglrx(0): *Mode "1024x768": 65.0 MHz (scaled from 0.0 MHz), 48.4 kHz, 60.0 Hz
(II) fglrx(0): Modeline "1024x768"x60.0 65.00 1024 1048 1184 1344 768 771 777 806 +hsync +vsync (48.4 kHz)
(**) fglrx(0): *Mode "800x600": 40.0 MHz (scaled from 0.0 MHz), 37.9 kHz, 60.0 Hz
(II) fglrx(0): Modeline "800x600"x60.0 40.00 800 840 968 1056 600 601 605 628 (37.9 kHz)
(**) fglrx(0): *Mode "720x576": 27.0 MHz (scaled from 0.0 MHz), 31.2 kHz, 50.0 Hz
(II) fglrx(0): Modeline "720x576"x50.0 27.00 720 732 796 864 576 581 586 625 +hsync +vsync (31.2 kHz)
(**) fglrx(0): *Mode "720x480": 27.0 MHz (scaled from 0.0 MHz), 31.5 kHz, 60.0 Hz
(II) fglrx(0): Modeline "720x480"x60.0 27.03 720 736 798 858 480 489 495 525 +hsync +vsync (31.5 kHz)
(**) fglrx(0): *Mode "640x480": 25.2 MHz (scaled from 0.0 MHz), 31.5 kHz, 60.0 Hz
(II) fglrx(0): Modeline "640x480"x60.0 25.20 640 656 752 800 480 490 492 525 +hsync +vsync (31.5 kHz)
(**) fglrx(0): Default mode "640x432": 21.1 MHz (scaled from 0.0 MHz), 26.9 kHz, 60.0 Hz
(II) fglrx(0): Modeline "640x432"x60.0 21.07 640 648 712 784 432 433 436 448 +hsync (26.9 kHz)
(**) fglrx(0): Default mode "640x400": 24.9 MHz (scaled from 0.0 MHz), 31.5 kHz, 60.0 Hz
(II) fglrx(0): Modeline "640x400"x60.0 24.92 640 664 760 792 400 460 462 525 (31.5 kHz)
(**) fglrx(0): Default mode "512x384": 19.8 MHz (scaled from 0.0 MHz), 29.8 kHz, 60.0 Hz
(II) fglrx(0): Modeline "512x384"x60.0 19.81 512 544 624 664 384 451 453 497 (29.8 kHz)
(**) fglrx(0): Default mode "400x300": 22.3 MHz (scaled from 0.0 MHz), 45.0 kHz, 60.0 Hz (D)
(II) fglrx(0): Modeline "400x300"x60.0 22.33 400 416 480 496 300 601 605 742 doublescan (45.0 kHz)
(**) fglrx(0): Default mode "320x240": 12.6 MHz (scaled from 0.0 MHz), 31.5 kHz, 60.0 Hz (D)
(II) fglrx(0): Modeline "320x240"x60.0 12.59 320 328 376 400 240 491 493 525 doublescan (31.5 kHz)
(**) fglrx(0): Default mode "320x200": 12.6 MHz (scaled from 0.0 MHz), 31.5 kHz, 60.0 Hz (D)
(II) fglrx(0): Modeline "320x200"x60.0 12.59 320 336 384 400 200 457 459 524 doublescan (31.5 kHz)
(++) fglrx(0): DPI set to (112, 112)
(II) fglrx(0): Enabled display: DFP on internal TMDS

At this point, X has frozen.

Interestingly, switching back and forth again generates the same output in Xorg.0.log. (Not thoroughly compared) Which indicates that even though there is no visual response, not everything is locked.

Switching when in the log in-screen (kdm) poses no problems. Turning of desktop effects also makes it possible to switch. Changing virtual terminal (ctrl+alt+F1) and back works.

A manual check indicates that the logs are identical, with the only difference is that "DRIUnlock called when not locked" only appears when the screen is freezing. Google time!

To be continued ...