Friday, March 31, 2006

revdep-rebuild

Yesterday after I executed emerge --sync && emerge -uDav world to update my system, portage asked whether I want to update expat-1.95.8 to expat-2.0.0 so I answered yes. Emerge went fine with no error and I was about to surf the internet. I clicked on the Firefox icon but after a few minutes, nothing showed up. So I tried clicking it again (in case I missed :P), the harddisk LED blinked for a few times then stop and Firefox window never appeared.

I thought "well I should try starting it from the command line so that I can see some error messages", so I clicked on the Terminal icon to bring up a new terminal emulator. But, as you may guess, nothing popped up.

After a few more clicks, I found that most of my Xfce stuffs, Thunar, OpenOffice.org and some other apps using gtk were also broken!

However, I still had a Terminal left opened after emerging the update so I tried to run Firefox and a few other apps using command line and found that they all complained about "cannot find libexpat.so.0". After that I tried to re-emerge Terminal, Thunar and the whole Xfce stuffs. After re-emerging, those applications worked again.

Now the question was how many apps do I have to re-emerge? I tried the command equery d expat and got about 5-6 packages that depend on expat. I re-emerge them all except Firefox and OpenOffice.org because it was too time-consuming. But the result was not what I expected, I still could not open gThumb, Gaim, EasyTAG etc.

The problem was that most of the broken apps were not listed when I executed the equery command above. This was annoying, I didn't know exactly which apps need to be re-emerged. I could not access Gentoo Forums because Firefox was the only browser installed on the system and I was too sleepy to re-emerge Firefox (it would take more than an hour with my AthlonXP 1600+). So I decided to run emerge -e world to rebuild everything and went to bed. Yeah that was silly, I know =.=

Nevertheless, this evening I got my system up and running. Then I went to Gentoo Forums and found a sticky post about expat-2.0.0 in no time. They suggest running revdep-rebuild to fix the problem, which I never knew before. I always thought that revdep-rebuild is to be used after running emerge --depclean only!

Well, at least the next time this happen again I will know what to do >_<

Tuesday, March 28, 2006

REAL Transparent Terminal

Many terminal emulators in Linux come with so-called "Transparent background" option, which makes your terminal window *LOOKS* transparent by displaying your desktop wallpaper as terminal background instead of a solid color. This looks good if you have only one terminal window on your desktop, but if you have many windows placed over each other, you'll get a feeling that this "transparency" is fake (well, at least that's what I feel :P).

Terminal with pseudo transparency
Thanks to Benedikt Meurer @ Xfce Diary, who did the transparent Terminal hack to enable *REAL* transparency in Terminal (a very popular terminal emulator used by Xfce users).

This hack consists of two patches, which you can find from the link above. In addition, here're things that you need for these patches:
  • Latest Terminal from SVN
  • xfce4-dev-tools (to compile Terminal)
  • VTE 0.11.18 (the author mentioned it should also work with newer versions)
Once I applied the patches and re-compiled Terminal and VTE, here's the result.

Terminal with real transparency
Quite impressive, isn't it? :)

Sunday, March 26, 2006

Firefox and gcc Optimization Flag

As you might already know, to optimize Gentoo we have to set a couple of variables which impact Portage behaviour. Those variables are stored in /etc/make.conf. Some of the important variables are CFLAGS and CXXFLAGS, which define the optimization flags for the gcc and C++ compiler respectively. My CFLAGS and CXXFLAGS are defined as follow:
CFLAGS="-march=athlon-xp -pipe -O3"
CXXFLAGS="${CFLAGS}"

(quoted from Gentoo Linux x86 Handbook)
One of the options in CFLAGS is the -O flag (that is capital O, not zero), which specifies the gcc optimization class flag. Possible classes are s (for size-optimized), 0 (zero - for no optimizations), 1, 2 or 3 for more speed-optimization flags.

As you see, I use -O3 for more speed optimization and that works well with most applications on my Gentoo box.

However, when I use Firefox on this machine I noticed some strange behaviour such as the font size is not the same as what I configured in Preferences. No matter what size I specified in the "Minimum font size" setting, it always show as small font as possible. So I have to hit Ctrl + "+" several times in order to be able to read the content of the web.

Moreover, sometimes when I move back/forward between each page, the font size just randomly got decreased automatically, which is quite annoying.

I saw some people discuss about this problem in Gentoo Forums and they said it's Firefox 1.5.0 's bug. Some even suggest to downgrade to Firefox 1.0.7 but I don't think that's a good idea.

So I have been living with the font problem like for a month, then I got a new problem . My Firefox just doesn't like some web site, sometimes when I click on a link from Google, or try to read an email in my Gmail account, Firefox crashes! Fortunately I have installed Tab Mix Plus extension, which can restore the last session I was surfing before Firefox crashed -- but that's not the right solution for sure.

This time I'm pretty certain that the problem is related to the optimization flag because I have read it somewhere and it said more speed optimization = less stable software. So I edited the /etc/make.conf and put -O2 instead of -O3 and executed emerge -av mozilla-firefox before I went to bed last night...

This morning I came to check the results, emerge went fine and Firefox seems to be happy with my emails and other web sites. More than that, I noticed that the fonts displayed on the web are bigger, like it should be according to my settings in Preferences. Surprisingly, I have fixed both of my problems at the same time. Yeah! :D

Now I changed my CFLAGS option back to -O3 and have to remind myself to change it to -O2 before emerging Firefox. That's all :)

---------------------
edited: 17 Apr 2006

Here's some useful information about Mozilla DPI-related Font Size Issues on Unix

Saturday, March 25, 2006

Accessing ext2/ext3 File System from Windows

Although Linux does support read/write files on FAT32 partition, I always format my Windows partition using NTFS, so I ended up having to create a FAT32 partition to share files between Windows and Linux. And that wastes quite a lot of my harddrive space.

However, today I was reading blog archives at Poonlap's Linux Blog and found a very interesting entry about IFS (Installable File System) for Windows. This is just what I have been looking for -- the way to read/write files on Linux (ext2/ext3) partition when I work in Windows without having to shut down Windows and boot into Linux.

Now I am just hoping that some day Linux would fully support writing files on NTFS partition (or maybe WinFS that will come with Windows Vista?) :)

My Desktop

My desktop cube in the middle of spinning
My Gentoo GNU/Linux desktop running Xfce4, XGL and compiz.

Tuesday, March 21, 2006

Web Badges/Buttons

Looking for a nice web badge/button for your site?

There's a tutorial on how to create web badges and a LARGE collection of nice web badges/buttons ready for use at ZwahlenDesign. Check it out :)

updated:
If you need something for your forum signature, try this one: Userbars.com