noisebleed

This user hasn't shared any biographical information


Posts by noisebleed

Don't let updatedb take your Linux down

Coffee break everyone?

Everyday morning was the same: updatedb came and took my Gentoo away. The symptoms were clear, X/KDE applications starting to become slow and unresponsive, and then the two inevitable choices: go for a coffee and wait or pkill the bastard.

Asking updatedb to be nice (the wrong way)

To fix this came to my mind the nice command. This is well known to Gentoo users because of the PORTAGE_NICENESS feature include in make.conf. Nice is a program that adjusts the process scheduling (aka niceness) of the desired programs so setting a value of 19 (the maximum) would make updatedb to be “nicer” to other applications and therefore being less bossy. So I’ve edited /etc/cron.daily/slocate, placed “nice -n 19″ before the updatedb command and waited. But, once again, updatedb came and owned my computer.

Asking updatedb to be I/O-nice (the right way)

So. what’s wrong here? Updatedb is not a CPU-intensive application so nice won’t change a thing. The bottleneck is disk access so what we need here is a nice for I/O. The solution? Ionice.

Ionice is able to set the I/O scheduling class and priority for a given program. To give updatedb a low priority we pick the class 3, the idle one.

Again, let’s go to crontab and edit the slocate entry.

# vim /etc/cron.daily/slocate

Put ionice -c 3 before the updatedb command.

#! /bin/sh

if [ -x /usr/bin/updatedb ]
then
        if [ -f /etc/updatedb.conf ]
        then
                ionice -c 3 /usr/bin/updatedb
        else
                ionice -c 3 /usr/bin/updatedb -f proc
        fi
fi

And if you’re asking where (in Gentoo) is this ionice program, the solution is sys-apps/util-linux, which I’m pretty sure is already installed. If not: emerge -a sys-apps/util-linux.

This is all good but… what’s this updatedb thing?

Updatedb is a tool ran daily by cron to update the slocate database. And Slocate (Secure Locate) is a security enhanced version of the GNU Locate, which is used to index all the files of your system allowing a (very) quick search of them. In Gentoo Linux the slocate is available in Portage through sys-apps/slocate.

Meme Miner: the translation tool I've been looking for

No, this will not replace Google Translate or Babel Fish. But it does something that these tools simply can’t offer.

For some time I’ve been using Wikipedia to translate expressions that a normal translator couldn’t give exact results, because they use literal translations. Now there is a faster way.

MemeMiner, brought to us by Fred Rocha, is a Web tool that does this work and gives us a easy and fast way to get this translations.

From the author own words:

For most of it’s articles, Wikipedia provides the equivalent expression of that concept in other languages.
With MemeMiner you can effortlessly find out how a certain idea is expressed across the language spectrum.

Now go ahead and try this tool at http://fredrocha.net/MemeMiner/

Meme Miner webpage

Meme Miner webpage

Thanks Fred!