My favorite tip for the "I wish I'd known/done this a long time ago" was actually looking at the gcc manual to decide on what stuff to put in CFLAGS (specifically, what is and is not included in -O options).

[shameless plug]
If you go here you can find out how to make it display the size of the files to d/l, a good way to aproximate compile time.
[/shameless plug]_________________OH MY GOD! Kenny just killed Kenny!
That Basterd!

If you keep having to recompile alsa-driver or some other package that depends on the sources after switching kernel, it can get annoying constantly having to relink /usr/src/linux. I've put the following in my /etc/conf.d/local.start to always have the link pointing to my currently running kernel:

One thing I like to do is to install Gentoo to a VMware virtual machine, change its disk type, do something horrific (dd if=/dev/urandom of=/dev/hda bs=1M skip=50 count=50 -- write 50 MB of random data 50 MB into the disk, or wipe the partition table, or...), and see how various things (filesystem, etc.) react. Then, when I'm done experimenting, I reboot the virtual machine, purging changes to its disk, and do it again.

Just Found this out by accident (trying to type a speeckmark ' " ')
In Mozilla Firebird 0.6.1 (and maybe other versions) you can press CTRL-1 to take you to tab one. CTRL-2 to take you to Tab 2, and so on. quite usefull. (the numbers on the top row, the numpad will not work)
also CTRL-Page up and CTRL-Pagedown will switch between tabs.

(you can "xrdb -merge ~/.Xdefaults" or simply restart X to have this take effect)

This makes double-clicking and triple-clicking FAR more useful in xterms.

It expands the definition of a "word" to include characters like "~", ".", and "/" so you can just double-click to select an entire filepath.

With these settings, triple-clicking selects from the current word to the end of the line, but DOESN'T put the trailing newline in the selection buffer. This is usually what you want for pasting. To select the entire line you need to put the cursor in the first word before triple clicking, but frequently you don't *want* to select the noise at the beginning of the line (how many times have you been replaying commands from a typescript or email/document that includes the shell prompt at the beginning of each line?).

As always, middle mouse button pastes (or the chorded equivalent for two button mice in a properly configured system).

2) This is arcane but a neat hack. It's not all *that* useful, but it's still a favorite tip of mine.

When piping the output of "ps" to grep to search for a particular process, you can use a character class to avoid matching the grep process itself.

For example, if I was grepping for the "gimp" process, I could type:

Code:

ps auxww | grep '[g]imp'

Since $0 for the grep process doesn't contain the literal sequence "g", "i", "m", "p", the grep process itself won't match the pattern (the square brackets around a single character don't change the interpretation of the pattern, but they do change the literal string).

At least sudo tends to give me pause before hitting return -- give me a root shell and it's hard not to immediately bang on the return key after typing a command.

Which sorta makes this a tip: use sudo (but carefully).

Gives you a log of what was done with root privilege when and by whom (lifesaving on a system with multiple admins), follows the principle of "least privilege" (don't run unnecessary commands as root), and prevents "shared" passwords.

If you are emerging KDE or something that takes a lot of time to compile then it's useful to use a script like bellow. I had my Konqueror not working for a few hours because half of the dependencies were old half new...