| View previous topic :: View next topic |
| Author |
Message |
choco n00b


Joined: 10 Jun 2003 Posts: 49 Location: Jackson, MI
|
Posted: Sun Jun 22, 2003 12:10 am Post subject: |
|
|
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).
http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Optimize-Options.html
Sure beats the heck out of reading endless threads and debates on the topic  _________________ Who would win in a fight between Sandman and Clayface? |
|
| Back to top |
|
 |
SmegTheLight Tux's lil' helper

Joined: 05 Jul 2002 Posts: 97 Location: 3rd Planet
|
Posted: Sun Jun 22, 2003 1:13 am Post subject: |
|
|
My all time favorite was this one:
http://forums.gentoo.org/viewtopic.php?t=14562&highlight=screen+script
Using "screen" and "script" to be able to start an emerge of something remotely, detatch from the terminal, and have the emerge continue.
Allowed me to start large ebuilds on my home machine from work via ssh, and not have to worry about keeping the ssh session open.. |
|
| Back to top |
|
 |
RedBeard0531 Guru


Joined: 21 Sep 2002 Posts: 415 Location: maryland
|
Posted: Mon Jun 23, 2003 12:34 am Post subject: |
|
|
emerge -pl shows changelog entries
emerge -pv shows use flags
[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! |
|
| Back to top |
|
 |
clumsyninja n00b


Joined: 27 Jun 2003 Posts: 61 Location: North Texas
|
Posted: Sat Jul 05, 2003 4:36 pm Post subject: |
|
|
thanks for the tips, this has to be one of the most useful threads on this site!
my tip: add "listen-on" to your /etc/named.conf to create a private network dns lookup
| Code: | listen-on {
192.168.54.0/24;
127.0.0.0/8;
}; |
_________________ katana root # cat /proc/sys/kernel/osrelease
2.4.20-gentoo-r7 |
|
| Back to top |
|
 |
meowsqueak Veteran


Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Thu Aug 28, 2003 2:13 am Post subject: |
|
|
| spyderous wrote: |
I've tried xxdiff too, in an attempt to get a GUI etc-update working, but it's been a little weak so far. |
tkdiffb is a good graphical diff and merge tool. It's part of tkcvs (which is also a good cvs frontend).
Insert into /etc/etc-update.conf replacing existing entries:
diff_command="tkdiffb %file1 %file2"
merge_command="tkdiffb %orig %new -o %merged" |
|
| Back to top |
|
 |
kybber Apprentice

Joined: 25 Jun 2002 Posts: 228 Location: Trondheim, Norway
|
Posted: Thu Aug 28, 2003 8:47 am Post subject: |
|
|
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:
| Code: | rm /usr/src/linux
ln -sf /usr/src/linux-$(uname -r) /usr/src/linux
|
|
|
| Back to top |
|
 |
hook Veteran


Joined: 23 Oct 2002 Posts: 1398 Location: Ljubljana, Slovenia
|
Posted: Thu Aug 28, 2003 8:53 am Post subject: |
|
|
my favourte tip was (in my very early stages): "Don't use root (or su) unless you really REALLY need to" and "Never blindly believe that your blind typing is 100% accurate when doing something importaint" ...probably not what you'd want to hear, but those are my fav tips ...well alongside the "Don't rm -Rf / unless you really know what you're doing" _________________ tea+free software+law=hook
(deep inside i'm still a tux's little helper) |
|
| Back to top |
|
 |
delta407 Bodhisattva


Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Thu Aug 28, 2003 11:52 pm Post subject: |
|
|
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.
Actually, doing this has allowed me to sharpen my worst-case disaster-recovery skills. Quite handy.  _________________ I don't believe in witty sigs. |
|
| Back to top |
|
 |
caefer Apprentice


Joined: 14 Jan 2003 Posts: 170 Location: Hamburg, Germany
|
Posted: Fri Aug 29, 2003 5:59 am Post subject: |
|
|
I definitely agree with SmegTheLight!
screen is the most important feature if you want to install from an ssh connection.
shh in, type screen and do your work. if you crash or leave, do not mind, since your started processes run along fine without you.
/christian |
|
| Back to top |
|
 |
UncleTom Apprentice

Joined: 20 Aug 2003 Posts: 194 Location: Bern, Switzerland
|
Posted: Fri Aug 29, 2003 7:39 am Post subject: |
|
|
Since screen has been mentioned already, I had to search my soul for another one. Here it is:
Use to get back to the directory you were in before your last cd command. _________________ bug, n: A son of a glitch. |
|
| Back to top |
|
 |
neuronal Apprentice


Joined: 11 Feb 2003 Posts: 174 Location: Alicante/Spain
|
Posted: Fri Aug 29, 2003 6:15 pm Post subject: |
|
|
One of nicest tricks I've ever seen is the possibility to connect to kernel.org finger daemon and get the latest kernel versions
You only need a finger client (emerge netkit-fingerd) and do:
| Code: | meteora:~$ finger @kernel.org
[kernel.org]
The latest stable version of the Linux kernel is: 2.4.22
The latest prepatch for the stable Linux kernel tree is: 2.4.23-pre1
The latest snapshot for the stable Linux kernel tree is: 2.4.22-bk4
The latest beta version of the Linux kernel is: 2.6.0-test4
The latest snapshot for the beta Linux kernel tree is: 2.6.0-test4-bk2
The latest 2.2 version of the Linux kernel is: 2.2.25
The latest 2.0 version of the Linux kernel is: 2.0.39
The latest prepatch for the 2.0 Linux kernel tree is: 2.0.40-rc6
The latest -ac patch to the stable Linux kernels is: 2.4.22-ac1
The latest -ac patch to the beta Linux kernels is: 2.6.0-test1-ac3 |
It's an old trick but it's still cool
I've wrote a post about this in my (spanish) blog. Here it is.
Greetings (and sorry for my bad English :\) _________________ #!/Enrique/Barbeito/García ...
http://enrique.barbeito.org |
|
| Back to top |
|
 |
meowsqueak Veteran


Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Sat Aug 30, 2003 1:31 am Post subject: |
|
|
| neuronal wrote: | You only need a finger client (emerge netkit-fingerd) and do:
meteora:~$ finger @kernel.org
|
Strange, I tried this in Debian and just got:
| Code: | $ finger @kernel.org
[kernel.org] |
...and nothing more. |
|
| Back to top |
|
 |
funeagle Tux's lil' helper


Joined: 05 Aug 2003 Posts: 95 Location: London
|
Posted: Sat Aug 30, 2003 2:16 pm Post subject: |
|
|
You wrote:
| Quote: |
alias su="su -c 'bash -l'"
|
cd takes you to your ~ direcotry
| Quote: |
to get this working, I had to add a
export HOME=$(pwd)
to my /etc/profile....
|
I followed your alias tip which caused this secound problem, it will cause that the home directory will not be set!
I backed up my system from my archive because I didnt know what's wrong with my roots home direcotry
btw. a small tip, if you have konqueror open and you want to go to your home directory just type ~ there |
|
| Back to top |
|
 |
neuronal Apprentice


Joined: 11 Feb 2003 Posts: 174 Location: Alicante/Spain
|
Posted: Sat Aug 30, 2003 3:41 pm Post subject: |
|
|
| meowsqueak wrote: | Strange, I tried this in Debian and just got:
| Code: | $ finger @kernel.org
[kernel.org] |
...and nothing more. |
May be the finger daemon was unavailable. Try later because it have to work
It doesn't matter what distrobution you use, I make this trick in slackware, debian, suse or gentoo and just worked
Try later
Cheers! _________________ #!/Enrique/Barbeito/García ...
http://enrique.barbeito.org |
|
| Back to top |
|
 |
meowsqueak Veteran


Joined: 26 Aug 2003 Posts: 1549 Location: New Zealand
|
Posted: Sun Aug 31, 2003 5:56 am Post subject: |
|
|
| Yes, finger @kernel.org is working now (with no changes to anything by me)... strange. |
|
| Back to top |
|
 |
viperlin Veteran


Joined: 15 Apr 2003 Posts: 1316 Location: UK
|
Posted: Sun Aug 31, 2003 6:45 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Stu L Tissimus Veteran


Joined: 08 Jun 2003 Posts: 1339 Location: NJ, 5 minutes from NYC
|
Posted: Wed Sep 03, 2003 3:34 am Post subject: |
|
|
Everyone probably knows this one, but it's great for multitasking (and doing stuff while emerging a program).
ALT+F1-6 _________________ old outdated sig |
|
| Back to top |
|
 |
viperlin Veteran


Joined: 15 Apr 2003 Posts: 1316 Location: UK
|
Posted: Wed Sep 03, 2003 4:08 am Post subject: |
|
|
| Stu L Tissimus wrote: | Everyone probably knows this one, but it's great for multitasking (and doing stuff while emerging a program).
ALT+F1-6 |
thats from the command line (in the command line you can use the windows keys to move left and right through them too)
when in X it's CTRL-ALT-F1 -6 to take you to main commandline |
|
| Back to top |
|
 |
cselkirk Apprentice

Joined: 09 Jun 2003 Posts: 199 Location: NL
|
Posted: Mon Sep 08, 2003 4:13 am Post subject: |
|
|
In terms of screen tips prehaps this is useful (add to your shell rc):
| Code: | if [[ $TERM = screen ]]; then
alias sX=screen -X "$1" `pwd`/"$2"
alias SX=screen -X "$@"
fi |
You can now quickly open new screen terminals within screen, eg:
| Code: | sX vim filename
SX lynx http://www.google.com/en |
_________________ cn=cselkirk,dc=xs4all,dc=nl |
|
| Back to top |
|
 |
wrex n00b


Joined: 01 May 2003 Posts: 26 Location: San Jose, CA
|
Posted: Mon Sep 08, 2003 7:36 pm Post subject: two more |
|
|
My two all-time favorite tips for any Unix and X:
1) Put the following in your .Xdefaults
| Code: | XTerm*charClass: 33:48,37:48,45-47:48,64:48
XTerm*cutNewline: False
XTerm*cutToBeginningOfLine: False
|
(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).
Maybe I'm easily amused, but I thought this was a neat hack. |
|
| Back to top |
|
 |
chizu Tux's lil' helper


Joined: 28 Apr 2003 Posts: 127 Location: Oregon
|
Posted: Tue Sep 09, 2003 3:37 am Post subject: |
|
|
| hook wrote: | | ...well alongside the "Don't rm -Rf / unless you really know what you're doing" |
Hook, I did "sudo rm -rf /*" on my own production server thinking I was chrooted. I refused to give my self sudo or wheel on my own computer's for like 3 weeks. _________________ 6*9 = 42 base 13. |
|
| Back to top |
|
 |
wrex n00b


Joined: 01 May 2003 Posts: 26 Location: San Jose, CA
|
Posted: Tue Sep 09, 2003 4:10 am Post subject: |
|
|
| chizu wrote: | | I did "sudo rm -rf /*" on my own production server ... |
Ouch. Hard not to accept blame for that one, chroot or no.
The apocryphal story, though, is of the luser asking: Why is this taking so long?"
Closest I've personally come to this is typing too fast and accidentally inserting a space before the asterisk ("rm -rf foo *" instead of "rm -rf foo*").
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. |
|
| Back to top |
|
 |
wrex n00b


Joined: 01 May 2003 Posts: 26 Location: San Jose, CA
|
Posted: Tue Sep 09, 2003 4:27 am Post subject: |
|
|
| Master_Of_Disaster wrote: |
| Code: | alias ll="ls --color -l"
|
|
I just remembered another tip: I'm EXTREMELY fond of the "-h" option ("human readable") to gnu fileutils like ls, du, and df. I use the following aliases:
| Code: | alias ll="ls --color -l -F -h"
alias du="du -h"
alias df="df -h"
|
Now instead of
| Code: | rex@megrims rex $ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/rootvg/rootlv 4008056 213656 3794400 6% /
/dev/raid0vg/oslv 16776700 4120624 12656076 25% /usr
/dev/raid0vg/varlv 4194172 177548 4016624 5% /var
/dev/raid0vg/optlv 2097084 488052 1609032 24% /opt
/dev/raid0vg/homelv 2097084 719852 1377232 35% /home
/dev/raid0vg/tmplv 1048540 33716 1014824 4% /tmp
/dev/raid0vg/ogglv 12582524 253248 12329276 3% /music
none 257224 0 257224 0% /dev/shm
/dev/hda1 101089 8305 87565 9% /boot
|
I get
| Code: | rex@megrims rex $ df
Filesystem Size Used Avail Use% Mounted on
/dev/rootvg/rootlv 3.9G 209M 3.7G 6% /
/dev/raid0vg/oslv 16G 4.0G 13G 25% /usr
/dev/raid0vg/varlv 4.0G 174M 3.9G 5% /var
/dev/raid0vg/optlv 2.0G 477M 1.6G 24% /opt
/dev/raid0vg/homelv 2.0G 703M 1.4G 35% /home
/dev/raid0vg/tmplv 1.0G 33M 992M 4% /tmp
/dev/raid0vg/ogglv 12G 248M 12G 3% /music
none 252M 0 252M 0% /dev/shm
/dev/hda1 99M 8.2M 86M 9% /boot
|
Definitely a must for interactive shell use.
Last edited by wrex on Tue Sep 09, 2003 6:45 pm; edited 1 time in total |
|
| Back to top |
|
 |
arand Apprentice

Joined: 22 Apr 2003 Posts: 215
|
Posted: Tue Sep 09, 2003 4:37 am Post subject: |
|
|
Heres mine, found this one after screwing around this morning with a new gentoo install.
Do not but a space in
The kernel will boot fine but this gives an error on mount /proc. The only way to fix it is to have a gentoo livecd or something like it around to fix /etc/fstab[/code] |
|
| Back to top |
|
 |
funeagle Tux's lil' helper


Joined: 05 Aug 2003 Posts: 95 Location: London
|
Posted: Tue Sep 23, 2003 9:01 pm Post subject: |
|
|
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...
| Code: |
#! /bin/bash
date > /tmp/timeofupdate
emerge sync
emerge -f world
emerge -B world
emerge world
date >> /tmp/timeofupdate
cat /tmp/timeofupdate
rm /tmp/timeofupdate
|
|
|
| Back to top |
|
 |
|