Linux Tips & Tricks


This page contains some tips and tricks I've picked up for Linux over the years. I hope you find them useful. Enjoy.


How to Reset or Flush KDE's Most Used Applications Menu

This was easier than I thought it'd be - you just have to find the right file. In ~/.kde/share/config/kickerrc, there is a line in the [menus] section that tracks the application usage. It is "RecentAppsStat". I made a backup of kickerrc, closed KDE, and removed everything after the equals sign on that line. Restart KDE, and the most-used application menu was empty and is now being filled as I start applications from the KDE menu.

Note - this seems to only count items you start from the KDE menu. For example, I have Firefox in a button on the toolbar, and after starting Firefox it did NOT appear in the "Most Used Applications" menu. However, starting OpenOffice from the KDE menu once did cause it to appear as a most used application.

I wanted to post this because I searched and searched and couldn't find the answer, nor could a lot of other people. Hopefully I've included all the important keywords so that others will be able to find the answer.

This worked for me using KDE 3.5.4 running Slackware 11.0


Mandrake 8.2: Suspend & Resume commands

This applies to Mandrake 8.2, but I'm sure it's the same in other rpm-based distributions.

I wanted to actually stop and restart MySQL when I suspended/resumed my laptop for a couple reasons. Those reasons aren't really important; the idea here is to explain how to add/remove commands from the suspend/resume sequence.

It's pretty simple: as root, look in /etc/sysconfig/apm-scripts. You'll find two subdirectories in there, resume.d/ and suspend.d/. In those subdirectories, there are several scripts (my stock install had 1sound, 2hdparm, etc.); just add another script. Make sure it's executable. For example, my "8mysql" script is pretty simple:

----------------------
#!/bin/sh
# Stop MySQL during suspend if running (and indicate it was running)
#
if [ -a /tmp/mysql.sock ]; then
  touch /tmp/mysql_was_running
  /etc/rc.d/init.d/mysql stop
fi
----------------------

The "11mysql" script in the resume.d/ directory is just as simple:

----------------------
#!/bin/sh
# Restart MySQL if it was running
if [ -f /tmp/mysql_was_running ]; then
  /etc/rc.d/init.d/mysql start
  rm /tmp/mysql_was_running
fi
----------------------

As I said, I used this for MySQL, but you could use it for anything you wanted. Hope you found it useful.


Mandrake 8.2: Using your Windows fonts

Although many users probably dual boot their Mandrake systems with Windows, the font server isn't configured to use the fonts you have on your Windows partition. It's an easy fix, so you might as well put them to use! (Again, this tip probably applies to other rpm-based distributions as well.)

First, make sure your Windows partition is mounted automatically on boot. Type ls /mnt/windows. If there are files there, you're fine. If not, start the Mandrake Configuration Tool and run the disk partition program. Click on the Windows partition of your hard drive at the top of the window, then tell it to mount your Windows partition by clicking on the "Mount" button on the left side. Mandrake usually puts this at /mnt/windows.

Your fonts folder is probably /mnt/windows/windows/fonts if /mnt/windows is where your Windows partition is mounted. Note, I'm used to Win98; other Windows versions may have the fonts folder in a different location. Look for a directory with a lot of .ttf files.

Edit the file /etc/X11/fs/config (as root, of course), and add the line "/mnt/windows/windows/fonts" (or the appropriate directory if yours was different) after the last line. Be sure to put a comma at the end of the previous line. Save the file.

Execute the command "/etc/rc.d/init.d/xfs restart" as root from the command line to restart the font server. You should be good to go: any TrueType fonts in your Windows partition will now be available to X Windows.


http://www.rjmarq.org/linuxtips.html
Written by RJ Marquette on 12/9/2002. Updated 1/23/2007.
Copyright © 2002 RJ Marquette webmaster@rjmarq.org