...making Linux just a little more fun!

<-- prev | next -->

More 2 Cent Tips!

See also: The Answer Gang's Knowledge Base and the LG Search Engine


Re: Upgrading KDE on SuSE 9.0 - A better way.

Jethro Cramp (jsc from rock-tnsc.com)

Jethro Cramp wrote:

Tom,

There is a much easier way to upgrade KDE using Yast2.

All you have to do is add the following directory to the Yast sources

ftp://ftp.suse.com/pub/suse/i386/supplementary/KDE/update_for_9.0/yast-source

To do this you use:

Yast2 --> Software --> Change Source of Installation --> Add FTP.

Then in Yast2 select "Install and Remove Software". The package selections will now have been updated to include all the packages in the updated kde. The packages for which a newer version than the one you have installed will appear in either red or blue (I can't remember which).

Select the packages you want to upgrade (no 'upgrade everything' button available I'm afraid). Let Yast2 sort out package dependencies for you and off you go.

Yast2 will then download, install and configure all the packages for you.

Bit like the extremely good apt that is available on Debian. apt4rpm is also available for SuSE if you'd rather have that flexibility.

If the download site is too slow an alternative one can be selected. Go to suse's site and find the list of ftp servers and choose an alternative.

All the best,

Jethro Cramp

Thanks! That's a piece of info I've been missing. I've been told that you can do it directly inside Yast, but couldn't figure out how. I'm going to forward your tip to the Answer Gang, so everybody can benefit.

Tom Brown.


Gentoo: packages website

Kevin Williams (kevin from bantamtech.com)

Gentoo must have other users who commented on the "packages.debian.org" web page, because Gentoo adopted the same thing a couple of months ago. http://packages.gentoo.org is a similar page where you can find lots of info including searching by category or name.

[Frodo] but I am the first to admit, it is not nearly as powerful as the Debian site.
[Robert Krig] There is a link to this on the main page. Although it is easily overlooked.


Gentoo: check your package versions

Robert Krig (rkrig from gmx.de)

If you want to know what version of a package you have installed, just open a terminal, and type

emerge -pv packagename

The -p tells portage to pretend to emerge and the -v tells it to be verbose about it. In effect this will show you the package version it would like to install, and next to it in brackets it will show which version of the package you currently have installed. It should also show you any dependencies that need to be upgraded in case there is a newer version. And of course the -v option will show you possible use flags.

Thanks to everybody who wrote in with this one :) -- Heather


Gentoo: searching with emerge

Robert Krig (rkrig from gmx.de)
emerge -s packagename

This will search for anything with "packagename" in its packagename, i.e. emerge -s mozilla would list mozilla, mozilla-bin, mozilla-thunderbird, mozilla-firefox, etc. You get the picture.

emerge -S packagename

will search the descriptions for the word specified, however this tends to take quite a while.


Gentoo: speedier emerge searches

Frank Rodolf (The LG Answer Gang)

Gentoo's package query tools (equery and qpkg) aren't complete. They'll list the files a package contains but several other features are marked "not implemented". There didn't seem to be a way to quickly see which version of a package is installed: something equivalent to "rpm PACKAGE" or "dpkg -l PACKAGE". "emerge search PACKAGE" does it, but it takes several seconds, and you have to page through other information and entries for any other packages the substring matches.

You might want to emerge app-portage/esearch - it provides about the same functionality as emerge search, but uses a search-index, which makes it a lot faster. (Of course, the index has to be built, which takes time, but can be done with a cronjob.)

Grtz,

Frodo


Gentoo: rpm fans, take heart!

Klavs Klavsen (klavs from EnableIT.dk)

If you are used to rpm - you can use the tool epm which emulates rpm's features. To list all packages installed (incl. versionnr.) do epm -qa. to list info of one package - do epm -qi packagename etc. etc. It even does the epm -V (verify md5sum etc. from install-time is still the same - ie. a "small intrusion detection" tool).


Gentoo: pointers about nvidia cards

Robert Krig (rkrig from gmx.de)

As far nvidia gfx cards are concerned, seems for some it works without a hitch, for others there seem to be problems. Although it seems to me that proportionally many more users have no trouble with nvidia cards than the ones that do.

Just a few pointers about nvidia cards under gentoo:

Whenever you recompile your kernel, you need to re-emerge nvidia-kernel AND nvidia-glx

you should then also always run

opengl-update nvidia

Also in the /etc/X11/xorg.conf file, in the "Device" section, the driver is called "nvidia" and not "nv". Xorg's nvidia driver is used if you define it as "nv", nvidia's binary driver is used if you define it as "nvidia".

Also, if you are using a 2.6 kernel, make sure that you dont have "4k stacks" option active. I think its somewhere in the basic kernel config. The default should be 8k stacks, and the nvidia drivers dont work well if at all with 4k stacks. This info should be displayed at the end of emerge nvidia-kernel.

On a little side note, ever since I've switched from xfree86 to xorg and from kernel 2.4 to 2.6.8, my framerate in Quake3 Urban Terror has increased by 20+-30+fps. Dont know if your a gamer, but I thought that was pretty cool.


Gentoo: samba

Robert Krig (rkrig from gmx.de)

As far as samba problems are concerned, have you tried using LinNeighborhood? Using that program, I have no problems mounting windows shares.

emerge LinNeighborhood

You mentioned that when you mount a samba share, then you are denied access. Have you tried accessing them as root? Still, in case you havent yet, try LinNeighborhood.

I have read somewhere that Window's samba implementation can be screwey depending on which version of windows it is. Some like scrambled passwords, some dont. I'm sure you can find more info on the net.

Windows 95 didn't even have the ability to encrypt its passwords, later 98 insisted on it (and wouldn't work without, unless you applied a patch to it). With other mswin versions your mileage may vary. "lanman compatibility" seemed to mean "mention the password twice on the wire, the really old way and whatever new way du jour" - so I recommend any mswin admins out there try to avoid that, you lose enough bandwidth as it is, and it doesn't really help samba any. -- Heather


Gentoo: genkernel

Robert Krig (rkrig from gmx.de)

A note on genkernel. It can be very screwey depending on your setup.

genkernel --menuconfig all

this command will allow you to make modifcations to the default genkernel setup. Although I would still recommend to everyone to compile your own kernel.

Building your own optimal kernel is not only a good way to learn more about linux but boot time usually feels a lot faster with generic support for things you don't even own left out entirely - since it never gets probed for anymore. Surely both knowledge and speed are a Good Thing for gentoo fans :) -- Heather


Gentoo: be careful updating!

Robert Krig (rkrig from gmx.de)

By the way. It is not recommended to blindly issue the "update all" portage command. Sometimes new stuff, can break some old stuff, and there have been plenty of cases where people simply did a emerge -u -deep world and found their system not working anymore. I find that the best way to update your system is to do a

emerge -upv -deep world.

This will show me which packages COULD be updated and then I just manually upgrade from there. Very handy if for example a newer version of an app has been ported from gtk to gtk2 or to qt or whatever, and you dont want to compile all this extra stuff.

Secondly, often enough when you update any packages, portage will tell you that you need to run etc-update in order to update the config files. Be VERY careful here as well. Since 90% of the time the only change to config file is to label it as "version x.x.x". However the process if not done carefully, will overwrite to specific config file with defaults. etc-update offers you options to manually select inside the file, what can be removed and what not, but its quite confusing to read. I would suggest, when it comes to etc-update, certain config files can be overwritten no problem, e.g. all the ones that you havent changed in any way. But always keep a current backup of all the configs that you edited. e.g. make.conf, smb.conf, rc.conf, lilo.conf, etc. I usually make copies, let etc-update overwrite them, and then manually copy+paste relevant stuff back into the new file. I'm sure there is a much better way to do this, and I recall that I read something about that in the forums. Either way, just letting you know to take care when etc-updating. But then again, I think its always wise not to blindly update everything as soon as it comes out. Unless its a much needed security fix.


Gentoo: who was that Masked package?

Robert Krig (rkrig from gmx.de)

Mike, in your article. You mentioned that the day before your install, KDE3.3 came out and it was still in the "masked" section.

Just to clear things up. Masked, does not automatically mean unstable, it also means "testing". More often than not apps in "masked" simply havent been tested enough. Doesnt have to mean that this package will definately fail to build or even crash once you use it. However sometimes you need to use an obscure app which hasn't been included in portage until recently, and the only version available is masked. Although sometimes it can happen that a dependancy required by the app is still masked. Usually I would say, stick to the main portage tree as much as you can. Recompiling small apps, once theyre moved from "masked" to "stable" shouldn't be too big of a deal.


Gentoo: unmasking

Klavs Klavsen (klavs from EnableIT.dk)

Using distcc is actually quite easy - one just has to ensure that if you use f.ex. hardened (stack smashing protection and friends) your gcc on all distcc machines (can even be a windows machine some of them) has to have the same abilities. You can even use distcc to do all the compiling on another machine, if you are installing on an older machine, it sometimes makes most sense to let someone else do the hard work :)

The /etc/portage/package.mask package.unmask package.use and package.keywords files you really should know about - they are great tools to make portage do exactly what you want. Say you thrust that newest releases of kde is stable enough for you to use (you can have several versions installed - so you can just select the on you want to use globally in /etc/rc.conf) you just add the kde packages to the package.keywords files. A search in the forums, will show you exactly what format to use :)


Gentoo: USE your own per-package options

Frank Rodolf (The LG Answer Gang)

USE="-X" emerge links

Later, after you've installed X, you simply "emerge links" again, and it will rebuild itself with the X support.

I realize you are using an example where you only temporarily set $USE, but it might be worth noting that one can also set specific options for separate packages, in a more permanent way, using /etc/portage/package.use.

In this file, one can put lines like these:

net-www/links -X
net-p2p/amule stats
x11-base/xorg-x11 -pie

Some other interesting files in that directory are package.mask, package.unmask and package.keywords. The last one is, btw, the preferred way to add experimental packages, while running stable mostly.


Gentoo: I did it MY way...

Kevin Williams (kevin from bantamtech.com)

The best way to implement a package differently than the package maintainer intended is to create a local overlay of the portage tree. This should be is the docs, but here's my quick notes:

  1. Uncomment the "PORTAGE_OVERLAY" option in /etc/make.conf
  2. mkdir -p /usr/local/portage/dev-php/php/files
  3. Copy /usr/portage/dev-php/php/php/php-<version>.ebuild to /usr/local/portage/dev-php/php - I suggest changing the build version or release number to identify your version
  4. Tweak the ebuild file
  5. Run 'ebuild /usr/local/portage/dev-php/php/php-<version>.ebuild digest'

Now, if you use "emerge -pv php" you should see your build and a notation that the ebuild is coming from the /usr/local/portage overlay location. The biggest problem with all this is that now you are a package maintainer but it's on your local system. Keeping your changes in sync with new ebuilds from Portage can be a hassle. It's a good idea to request a new USE flag for your desired ./configure arguments in http://bugs.gentoo.org and let the official package maintainer worry about it going forward.


Gentoo: share the load, build that code

Klavs Klavsen (klavs from EnableIT.dk)

Using distcc is actually quite easy - one just has to ensure that if you use f.ex. hardened (stack smashing protection and friends) your gcc on all distcc machines (can even be a windows machine some of them) has to have the same abilities. You can even use distcc to do all the compiling on another machine, if you are installing on an older machine, it sometimes makes most sense to let someone else do the hard work :)


Another Gentoo tidbit - revised boot ISO available

Brian Bilbrey (bilbrey from orbdesigns.com)

I'd seen people with problems a couple of times recently, but had no answer to the problem of non-booting but "good" (as in MD5SUM) images. It appears that the Gentoo folks came up with a possible solution, and did a respin of the 2004-2 minimal install ISO that was "rebuilt to solve the problem of certain buggy BIOS versions not booting the Minimal LiveCD."

If people write in with similar problems installing from the small Gentoo ISO images, we could do worse than point them in the direction of the revised image. Here's a link to such on one of the mirrors:

http://lug.mtu.edu/gentoo/experimental/x86/livecd/x86

Not every mirror carries the "experimental" part of the tree, here's a link to the list of mirrors:

http://www.gentoo.org/main/en/mirrors.xml

FYI,

.brian (who still hasn't found a way to add custom X-Headers to Thunderbird)


search google from command line

Raj Shekhar (rajshekhar from hotpop.com)

Hello all,

This is a ugly hack that I am using to search the google from command line. Any decent Python programmer would be able to make it much better. You need to have Pygoogle (http://pygoogle.sourceforge.net) module installed. In its unaltered form, the script will require Python2.3 to run. However, if you remove the #--ugly hack part (see the comments in the code), it will run with Python2.2 too.

#!/usr/bin/python2.3
import google,sys,codecs
from sgmllib import SGMLParser

# HTML Stripper class to strip out html from the google search
# returned.  shamelessly copy pasted from
# http://mail.python.org/pipermail/tutor/2002-September/017573.html

class HTMLStripper(SGMLParser):
     def __init__(self):
         SGMLParser.__init__(self)
         self._text = []

     def handle_data(self, data):
         self._text.append(data)

     def read_text(self):
         return ".join(self._text)"


def strip_html(text):
     stripper = HTMLStripper()
     stripper.feed(text)
     return stripper.read_text()

print "Searching the World Live Web "

google.setLicense('your google key') # must get your own key from
http://www.google.com/apis/ -> free but requires registration
n_show_results = 10 #change the number of search results that are shown
from here

codecs.register_error('xml', codecs.xmlcharrefreplace_errors)

search_str = ""
for i in range(1,len(sys.argv)):
     search_str = search_str + " " + sys.argv[i]

print "Searching for " ,search_str

data = google.doGoogleSearch(search_str,0,n_show_results)

print 'Search took %f time and I found a total of %d results\n' % \
	(data.meta.searchTime, data.meta.estimatedTotalResultsCount)

for result in data.results:

     # if you are going to call this script from within emacs, replace
     # this part with the code within the #begin hack -- #end hack code

     print 'Title\t:', strip_html(result.title)
     print 'URL\t:', result.URL
     print

     #-- begin hack

     # if you want to call this script from within emacs, then you have
     #to put in this ugly hack. Other wise emacs will stop with an
     #error message "UnicodeEncodeError: 'ascii' codec can't encode
     #character u'\xfc' in position 1: ordinal not in range(128)"

     # see  http://www.informit.com/articles/article.asp?p=31272&seqNum=5
     # to know why this ugly hack is needed

##     temp = result.title
##     in_tuple=codecs.getencoder('ASCII')(temp, 'xml')
##     in_str = str(in_tuple)
##     print 'Title\t:', strip_html(in_str)
##     print 'URL\t:', result.URL
##     print
     #-- end hack

print "\n "




Raj Shekhar
System Administrator, programmer and slacker


Re: Upgrading a KDE Install article

R. (p0z3r from earthlink.net)

Mr. Brown:

I read your article on upgrading to kde 3.3 today. The reason I'm mailing you is because I'm one of the developers for Superkaramba. I noticed your article mentioned that the Superkaramba widgets are "always on top". This has been resolved in the latest release, 0.34, and in CVS, with our pending release of 0.35. You would need to recompile for KDE 3.3, as the code needed for the two versions are different and detect your version upon compilation.

Thanks,
-Ryan Nickell

ps. Here's a link to our FAQ:
http://www.superkaramba.com/faq.html


This page edited and maintained by the Editors of Linux Gazette
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

 

Copyright © 2004, . Released under the Open Publication license unless otherwise noted in the body of the article. Linux Gazette is not produced, sponsored, or endorsed by its prior host, SSC, Inc.

Published in Issue 107 of Linux Gazette, October 2004

<-- prev | next -->
Tux