Linux Hints & Tips

This section contains some hints, tips and answers to some not-so-frequently-asked questions that I've put together while answering posts in the alt.os.linux.mandrake newsgroup. You'll find that most of these are aimed at people who are fairly new to Linux or fairly new to Mandrake. But it's still worth skimming this section if you're a guru, just in case there's something you weren't aware of. I'll be adding more to this section in future, so come back every now and again. Please let me know if you find any errors or want to suggest changes and/or additions.

Using KNode/slrn/whatever as an offline news reader

The problem: KNode, slrn and some other news clients don't have the ability to cache articles locally. This means that while you can see the header list while offline, you can't read the article bodies.

The solution: You can install a local news caching proxy, such as Leafnode. And to make it easy for you, I've written a tutorial on how to do that. Click here to read it.

What to do if you lose your kicker

The problem: For some reason, your KDE kicker (the panel at the bottom of the screen) has disappeared and you want to know how to get it back. This can happen if you're running KDE2 and you use the Marble style (if you are, just choose another style). It can also happen if you have some junk files left lying around, maybe after your machine has hung, or if you rebooted without shutting down properly. These files need to be deleted.

The solution: You need to delete from your home directory any files that begin with '.DCOP' or '.ICE'. You also need to delete some files in the /tmp directory. The safest way to do that is to go to the text command line so that KDE isn't running. Open a console and enter 'init 3'. You might need to be root in order to do this; if so, enter 'su' then root's password when asked. Once you're at the text console, if you're not root, enter 'su' then root's password. Now run these two commands (type them very carefully):
  rm -rf /tmp/*
  rm -rf /tmp/.*
You can now get back to KDE by entering 'init 5' or 'startx' and you should find that kicker behaves itself.

Handling sound under KDE

The problem: KDE's aRts daemon takes over your sound card and won't give it up.

The solution: There are three solutions that I know of. The simplest is to open KDE's Control Center and go to the Sound section and, on the General tab in the Sound Server section, change the 'Autosuspend if idle for' time to 1 second. This gives other apps a better chance to grab the sound card. Another possible solution is to turn the aRts daemon off altogether. In Control Center, Sound, Sound Server, on the General tab, deselect the Start aRts soundserver on KDE startup item. You'll be asked if you want to shut down the server now; just answer Yes. The third solution only works with some cards. In KDE Control Center, Sound, Sound Server, on the Sound I/O tab, select Use custom sound device and enter /dev/dsp2. This forces the aRts sound daemon to use your card's second digital signal processor, leaving the first for other applications. Remember to click 'Apply' to make the settings permanent.

What to do if your KDE menu disappears

The problem: The menu in Konqueror or some other KDE app has disappeared and you don't know how to get it back. In fact, you don't even remember how you got it to disappear in the first place!

The solution: This is so simple you'll kick yourself. Just press Ctrl+M. It's a toggle: press it once and the menu disappears; press it again and the menu's back. Couldn't you just play with this all day long? :o)

The power of the 'cd' command

The problem: It takes so long to type in a 'cd' command in the command line. I wish there were quicker ways of navigating.

The solution: When you're at the command line, typing cd /usr/share/doc/HOWTO/HTML/en/ is bad enough. When you then need to cd /etc/security/msec to get back to where you were, it's a lot of typing. You probably already know about using the TAB key to speed up entering commands. For example, entering cd /uTABshTABdoTABHOTABHTABeTAB and pressing ENTER will get you there, but it's still a fair amount of work. This is where the CDPATH variable can come in handy.

You can put a definition in your ~/.bash_profile that defines a list of directories to which you often need to 'cd', and bash will know to look there for a directory it can't find. For example, suppose you often need to go to the directory containing the HOWTOs. You can define CDPATH in ~/.bash_profile like this:
  export CDPATH=:/usr/share/doc/HOWTO/HTML/en
and then just enter 'cd en' on the command line; bash will look for an en subdirectory in the current directory and, if it doesn't exist, it will then look in the CDPATH environment variable. Next thing you know, you're where you want to be. If you want to add more directories to CDPATH, just keep adding a : (colon) to the end of the CDPATH, followed by the full path to the directory.

Here's a couple of other 'cd' hints. You probably already know that if you do 'cd ~' or 'cd $HOME' it will take you to your home directory. If you do 'cd -' it will take you to the directory you were in just before you issued the last 'cd' command. For example, you do 'cd /etc/security'' followed by 'cd ~'. If you then do 'cd -' you'll be back in /etc/security. Do another 'cd -' and you'll be back in your home directory. A third 'cd -' takes you back to /etc/security again. And remember that you can use environmental variables to represent complex subdirectory names. For example, if you put this in your ~/.bash_profile:
  export HOWTO=/usr/share/doc/HOWTO/HTML/en you can do 'cd $HOWTO' to get there in far less time than it would take typing the whole thing.



Site design © Garry Knight 1998-2007