Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Application Discovery Thread [formerly: app that does this?]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6 ... 15, 16, 17  Next  
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
fizz
Guru
Guru


Joined: 31 Aug 2003
Posts: 309
Location: Florida

PostPosted: Tue Oct 28, 2003 7:16 pm    Post subject: Reply with quote

a tip for the paranoid :)
Code:

echo "rm ~/.bash_history" >> ~/.bash_logout

_________________
Athlon 64 3200, MSI NEO NForce 3, 1Gig PC3700, EVGA Geforce 6800 GT
Back to top
View user's profile Send private message
grzewho
l33t
l33t


Joined: 31 Dec 2002
Posts: 626
Location: /home/g

PostPosted: Tue Oct 28, 2003 7:31 pm    Post subject: Re: Make your startup MUCH faster... Reply with quote

sman wrote:
changing RC_PARALLEL_STARTUP="no" to "yes" in
/etc/conf.d/rc
took ~20 seconds off my boot time


my entire boot time takes about 20 secs on a celeron 300 (@374), but the parallel option gives no speedup :(
_________________
Code:
USE="freedom -software_patents" emerge --deep --update world
Back to top
View user's profile Send private message
n3x
Apprentice
Apprentice


Joined: 14 Apr 2003
Posts: 247
Location: Kingston, Ontario (uni) Westport, CT (home)

PostPosted: Tue Oct 28, 2003 10:46 pm    Post subject: Reply with quote

Some of you may know this, but it hasn't been said yet.

CTRL + backspace or delete or arrow or arrow+shift does the corresponding action to an entire word...e.g., if you do CTRL+right arrow+SHIFT, you highlight the entire word to the right. If you just do CTRL+arrow, your cursor jumps a whole word backwards or forwards.

--james

fizz, your avatar is awesome! how'd you do that?
Back to top
View user's profile Send private message
Mallrats
Guru
Guru


Joined: 15 Jul 2002
Posts: 414
Location: Cleveland Ohio

PostPosted: Wed Oct 29, 2003 4:36 am    Post subject: Reply with quote

Hi all, I'd like for a regular user to be able to read from a directory I mounted a shfs to. I keep getting Operation not permitted. Any ideas?
_________________
BitWise Chat
Back to top
View user's profile Send private message
_ibz
n00b
n00b


Joined: 06 Oct 2003
Posts: 3

PostPosted: Wed Oct 29, 2003 11:17 am    Post subject: Reply with quote

Code:
 tar cf - ${olddir} | ( cd ${newdir}/; tar xf - )


Brilliant.
Back to top
View user's profile Send private message
jesterspet
Apprentice
Apprentice


Joined: 05 Feb 2003
Posts: 215
Location: Atlanta

PostPosted: Wed Oct 29, 2003 12:05 pm    Post subject: Reply with quote

Advice I once got from a sysadmin that all the other sysadmins looked up to...

The most important things to learn about are (in order of importance):

  • Your console editor
  • Grep
  • Sed
  • Awk

Any job you take, will be much easier on you in the long run.
_________________
(X) Yes! I am a brain damaged lemur on crack, and would like to buy your software package for $499.95
Back to top
View user's profile Send private message
Strubie
n00b
n00b


Joined: 08 Dec 2002
Posts: 59
Location: Paris

PostPosted: Wed Oct 29, 2003 2:37 pm    Post subject: Reply with quote

One thing I love with zsh (might work with bash, but I wouldn't know how to do it) is directory hashes : I've got "hash_dirs" in my zsh options, and
Code:

hash -d li=/usr/src/linux
hash -d rc=/etc/init.d
hash -d po=/usr/portage
hash -d ov=/usr/local/portage
hash -d pt=/mnt/Portage/portage-tmpdir/portage
hash -d ptt=/var/tmp/portage

in my zshrc. That way, "~rc" means "/etc/init.d", thus I can use
"~rc/sshd start" to start sshd, "ebuild ~ov/foo/bar.ebuild compile" to compile an ebuild from my portage overlay directory. And when the compilation fails, I can go to ~ptt (portage-tmpdir in tmpfs for not-too-big builds) or ~pt (portage-tmpdir on firewire hd for bigger builds) to check what went wrong.
Of course, this is even nicer with my dvorak keyboard, since the "~" is easier to type :D
Back to top
View user's profile Send private message
mikeg
n00b
n00b


Joined: 05 Apr 2003
Posts: 39

PostPosted: Wed Oct 29, 2003 4:14 pm    Post subject: Reply with quote

This tip is geared for vi/Vim users.

Tired of reaching for the Escape key at the upper-left of the keyboard? Then this tip will remap the keyboard to put the escape key in an easier to reach place.

If you have a keyboard with the Caps Lock key next to the `a' key (most keyboards that I have seen), then this will swap the Caps Lock and Esc key and you will have the Esc key on the home row! A much better location for vi/Vim and all other vi clones.

Create the file ~/.xmodmaprc with the following code:

Code:

!
! Swap Caps_Lock and Escape
!
remove Lock = Caps_Lock
keycode 66 = Escape
keycode 9 = Caps_Lock
add Lock = Caps_Lock


(The `!''s are comments.)

And add this line to the beginning of your ~/.bash_login (or appropriate login file for your shell)

Code:

# This remaps the Escape and Cap Lock key
xmodmap $HOME/.xmodmaprc


Note, this is only for X logins. I do know how to do this for all users for terminal logins but not individual users.
Back to top
View user's profile Send private message
codon011
n00b
n00b


Joined: 09 Oct 2003
Posts: 5

PostPosted: Wed Oct 29, 2003 10:27 pm    Post subject: command-line tricks Reply with quote

I've seen a couple of tricks that I've learned and enjoy, mostly bashism like "fc" and the {,...} notation. (The last is really great when doing commands with multiple/similar file names:
Code:

cvs ci -m'foo files' some/dir/{base{1,2}}.pl

This along with Alt-. to get the last commandline argument is great.
Code:

cvs tag foo [Alt-.]

I've always used vi* as an editor, but emacs is my command-line editor. It gives me ^A/^E for begining/end of line (simple). It also gives me ^O (execute current line in history and move to next). This is great for compile/test/fix cycle. Try this:
Code:

$ vi foo.c

[edit file]
^Z

$ gcc -o foo foo.c
$ ./foo
$ fg

[more edits]
^Z

$ ^P^P^P^O
$ ^O
....


Seems silly, but it saves a lot of typing when you are trying to debug/have to do repetitive commands.[/code]
Back to top
View user's profile Send private message
squiddy
n00b
n00b


Joined: 31 Mar 2003
Posts: 39
Location: Colorado, USA

PostPosted: Thu Oct 30, 2003 2:38 am    Post subject: re: Reply with quote

The website that I could have used most when I was a real linux noob was http://linuxshop.ru/linuxbegin/win-lin-soft-en/. It is a list of linux replacements for windows programs. Here are some of my favorite real tips, though.

Command Substitution:
Code:
echo my username is `whoami`

backquotes run a command and return the output for use in another command (as seen above with whoami returning your username to be printed by echo).

History related tips:
Code:
!$

refers to the last argument of the previous command.
Code:
^string1^string

runs the previous command replacing "string1" with "string2".
Code:
!string

will run the last command in the history starting with "string".

Tips for tcsh users:
Code:
stringEsc-P

That is, type a string and hit Escape followed by p. That will jump back to the last command in your history starting with "string".
Code:
ls /ur/prtageEsc-S

That is, hit Escape followed by S. In the case above it will replace "/ur/prtage" with "/usr/portage". It tries to correct the spelling of the argument directly behind the cursor. I have found this useful when typing long paths late at night. :)
Back to top
View user's profile Send private message
Atreillou
Apprentice
Apprentice


Joined: 29 Oct 2002
Posts: 257

PostPosted: Thu Oct 30, 2003 10:20 am    Post subject: Re: Make your startup MUCH faster... Reply with quote

grzewho wrote:
sman wrote:
changing RC_PARALLEL_STARTUP="no" to "yes" in
/etc/conf.d/rc
took ~20 seconds off my boot time


my entire boot time takes about 20 secs on a celeron 300 (@374), but the parallel option gives no speedup :(


I don't have RC_PARALLEL_STARTUP in my /etc/conf.d/rc...

Can i add it ?
Back to top
View user's profile Send private message
_ibz
n00b
n00b


Joined: 06 Oct 2003
Posts: 3

PostPosted: Thu Oct 30, 2003 12:29 pm    Post subject: Re: command-line tricks Reply with quote

codon011 wrote:
I've seen a couple of tricks that I've learned and enjoy, mostly bashism like "fc" and the {,...} notation. (The last is really great when doing commands with multiple/similar file names:
Code:

cvs ci -m'foo files' some/dir/{base{1,2}}.pl

This along with Alt-. to get the last commandline argument is great.
Code:

cvs tag foo [Alt-.]

I've always used vi* as an editor, but emacs is my command-line editor. It gives me ^A/^E for begining/end of line (simple). It also gives me ^O (execute current line in history and move to next). This is great for compile/test/fix cycle. Try this:
Code:

$ vi foo.c

[edit file]
^Z

$ gcc -o foo foo.c
$ ./foo
$ fg

[more edits]
^Z

$ ^P^P^P^O
$ ^O
....


Seems silly, but it saves a lot of typing when you are trying to debug/have to do repetitive commands.[/code]


You can just stick with vim, and forget about dropping back into the shell to run "gcc" or make or whatever.

The next time you are in Vim, read up on ":help quickfix", ":help :make", ":he grep" and you will speed up your edit-compile-edit cycle even further. Vim is simply awesome.
Back to top
View user's profile Send private message
freakin_duck
n00b
n00b


Joined: 28 Oct 2003
Posts: 19
Location: Boston, MA

PostPosted: Thu Oct 30, 2003 10:35 pm    Post subject: Reply with quote

Another one that's obvious, but for us newbies:

When installing/tweaking your kernel, you should always have two boot entries.

One is your stable build, and the other is you unstable build.

I default to my unstable build (called bzImage in my
/boot partition), and when I am satisfied that it is
stable, I copy it to bzImage_stable, which
always has an entry in grub/lilo.

This is especially nice when you rebuild your kernel to get a new piece of hardware working, like my new DVD writer.

There's a lot of non-intuitive kernel options to turn on for that to work, i guess.
_________________
"Like stealing candy from a baby?" Isn't candy a choking hazard?

Athlon T-Bird 800 (VIA chipset)
1+ GB ram
Geforce 2 Ultra64
Back to top
View user's profile Send private message
Ragnar
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2002
Posts: 92
Location: Faroe Islands

PostPosted: Fri Oct 31, 2003 12:57 am    Post subject: Re: Some tips I didnt see Reply with quote

redog wrote:
And I helped a guy once who wanted this behavior, I forget why , but mabe someonelse will find it useful...
For an aditional script to run when you logout of bash you can set this trap in ~/.profile
Code:
trap '[[ -r $HOME/.bash_logout ]] && . $HOME/.someother_logout' 0 1 3 15


What does this do?
_________________
hmmmmm, gentoo.
Back to top
View user's profile Send private message
Basti_litho
Apprentice
Apprentice


Joined: 13 Aug 2002
Posts: 179

PostPosted: Fri Oct 31, 2003 7:11 am    Post subject: Re: Make your startup MUCH faster... Reply with quote

Atreillou wrote:
grzewho wrote:
sman wrote:
changing RC_PARALLEL_STARTUP="no" to "yes" in
/etc/conf.d/rc
took ~20 seconds off my boot time


my entire boot time takes about 20 secs on a celeron 300 (@374), but the parallel option gives no speedup :(


I don't have RC_PARALLEL_STARTUP in my /etc/conf.d/rc...

Can i add it ?


install new "baselayout"
_________________
Aktives Mitglied bei:

Folding@Home
http://folding.stanford.edu/

Team: Germany (Nr. 3)
Back to top
View user's profile Send private message
redog
n00b
n00b


Joined: 06 Nov 2002
Posts: 35

PostPosted: Fri Oct 31, 2003 8:39 pm    Post subject: Re: Some tips I didnt see Reply with quote

Ragnar wrote:
redog wrote:
And I helped a guy once who wanted this behavior, I forget why , but mabe someonelse will find it useful...
For an aditional script to run when you logout of bash you can set this trap in ~/.profile
Code:
trap '[[ -r $HOME/.bash_logout ]] && . $HOME/.someother_logout' 0 1 3 15


What does this do?


Im soo sorry!
I actually misstyped that the trap should go in .bash_profile not .profile

It causes $HOME/.someother_logout to be executed before the shell exits.

.bash_logout is executed when a login shell exits, this trap will cause .someother_logout to be run on a non interactive shell exit as well. So if you
Code:
su user ; exit ;
.someother_logout will execute. If you,
Code:
su - user ; exit;
both .bash_logout and .someother_logout will execute.

Again...I haven't used this myself but the guy I helped was extatic about it when we finaly got it working....
Back to top
View user's profile Send private message
Air2
n00b
n00b


Joined: 02 Nov 2003
Posts: 1
Location: Zeist, Holland

PostPosted: Sun Nov 02, 2003 2:21 pm    Post subject: Stolen tip Reply with quote

Well was some time ago on a forum, don't remember wich one and saw this genius tip.
No accedental rm -rf /* etc. anymore
just do in /:

touch -- -i

it makes a file -i and rm will see this as the -i switch and will ask permission. Of course you can do this in other dirs too.
Well its not my own tip, if I know who thought of this I would mention the name, but unfortunally I forgot.

Auke
Back to top
View user's profile Send private message
TenPin
Guru
Guru


Joined: 26 Aug 2002
Posts: 500
Location: Kansas City

PostPosted: Mon Nov 03, 2003 4:06 pm    Post subject: Reply with quote

A script I wrote the change file & directory names to lowercase recursively. Could easily be modified to accept a single file argument. I think this is quite easy to do with 'find' too but I like writing it as a recursive function.

Code:

#!/bin/bash

directory () {
    cd "$1"
    change
    for x in *
    do
        if [ -d "$x" ]
        then
            directory "$x"
        fi
    done
    cd ..
}

change () {
    for f in *
    do
        g=`echo "$f" | tr '[A-Z]' '[a-z]'`
        if [ "$f" != "$g" ]
        then
            echo "Moving $f to $g"
            mv "$f" "$g"
        fi
    done
}

case $# in

    0)
        change
    ;;
    1)
        directory "$1"
    ;;
esac
Back to top
View user's profile Send private message
meowsqueak
Veteran
Veteran


Joined: 26 Aug 2003
Posts: 1549
Location: New Zealand

PostPosted: Mon Nov 03, 2003 7:14 pm    Post subject: Re: Stolen tip Reply with quote

Air2 wrote:
it makes a file -i and rm will see this as the -i switch and will ask permission.


On the surface, this is a good idea. However, I actually tried this for a while, and I think it actually makes things worse. Consider a directory containing such a file ('-i'). Therefore, using '*' on the command line will pick up this file and present it to the program, which will see it as the option '-i'. For rm, this is quite useful. But for other programs, it can be quite dangerous. For example, 'scp * host' will fail because -i means something different and expects the next argument to be something specific.

If you don't do much in your home directory, it can be a good way of adding a second level of defence, but I found it too intrusive with other commands, as well as being potentially dangerous, so I decided to remove the file. (Which you can do with:
Code:
$ rm -- -i
btw).
Back to top
View user's profile Send private message
redog
n00b
n00b


Joined: 06 Nov 2002
Posts: 35

PostPosted: Wed Nov 05, 2003 7:06 pm    Post subject: Reply with quote

:lol: ooh ooh ooh this ones for the artistic types out there, well I guess anyone really but well here
Gentoo Framebuffer, Bootsplash & Grubsplash How-To

I don't take any responsibility for this howto, and have not tryed it myself but I have seen it done!
Back to top
View user's profile Send private message
ben_h
Tux's lil' helper
Tux's lil' helper


Joined: 26 Nov 2002
Posts: 118
Location: Australia

PostPosted: Tue Nov 11, 2003 10:57 am    Post subject: Reply with quote

I was just reading on page one, about the dyndns updating scripts. I figure, what's the point of using www.whatismyip.com when the information is already there in the output from ifconfig (if you're on the gateway, that is).

Code:
echo $(ifconfig eth0 | grep "inet addr" | awk '{print $2}' | cut -c 6-)
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2831
Location: Bay Area, CA

PostPosted: Tue Nov 11, 2003 8:07 pm    Post subject: Reply with quote

for RH8 users who don't want to lose the existing install, this one:

https://forums.gentoo.org/viewtopic.php?t=28559&start=50

portage simply rocks! its the most beautiful thing ever!
Back to top
View user's profile Send private message
redog
n00b
n00b


Joined: 06 Nov 2002
Posts: 35

PostPosted: Sat Nov 15, 2003 6:40 pm    Post subject: Reply with quote

ben_h wrote:
I was just reading on page one, about the dyndns updating scripts. I figure, what's the point of using www.whatismyip.com when the information is already there in the output from ifconfig (if you're on the gateway, that is).

Code:
echo $(ifconfig eth0 | grep "inet addr" | awk '{print $2}' | cut -c 6-)


or echo $(ifconfig eth0 | sed /d/s/addr:// | awk '/inet/ { print $2 } ')
or echo $(ifconfig eth0 | awk '/inet/ { print $2 } ' | sed /d/s/addr:// )
Back to top
View user's profile Send private message
freakin_duck
n00b
n00b


Joined: 28 Oct 2003
Posts: 19
Location: Boston, MA

PostPosted: Mon Nov 17, 2003 2:10 pm    Post subject: getting the ip address from a router Reply with quote

Related to this topic, I wanted to know if anyone has a way to solve this problem:

I have a Linksys router, and this router connects to my DSL account and gets a dynamic ip address...

I'd like to be able to find this ip address from the command line, not using a web browser (links doesnt allow me to log into my router due to browser security incompatibilities...).

is there a way to get this info from the command line? All these other commands return the ip address of the machine i am on, which is the ip generated by the DHCP daemon running on my router (192.168.x.x)
_________________
"Like stealing candy from a baby?" Isn't candy a choking hazard?

Athlon T-Bird 800 (VIA chipset)
1+ GB ram
Geforce 2 Ultra64
Back to top
View user's profile Send private message
benow
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jun 2003
Posts: 84

PostPosted: Mon Nov 17, 2003 6:27 pm    Post subject: wheel/su/sudo Reply with quote

Great tips! I've a few:

1) Add yerself to wheel and modify config files to remove the need for password entry during su or sudo:

Code:

# emacs /etc/groups
<add your primary login to the wheel group>
# emacs /etc/pam.d/su
change
#auth       sufficient   /lib/security/pam_wheel.so use_uid trust
to
auth       sufficient   /lib/security/pam_wheel.so use_uid trust
# emerge sudo
(if not already installed)
# emacs /etc/sudoers
change
#%wheel   ALL=(ALL)   NOPASSWD: ALL
to
%wheel   ALL=(ALL)   NOPASSWD: ALL


Now anybody in wheel group can su or sudo without a password.

2) SSH without requiring a password

SSH can be configured to authenticate quietly using a keyfile as shown here:
http://www.cs.umd.edu/~arun/misc/ssh.html

3) Get a pair of datahands.

http://datahand.com

No RSI, good upper body posture, no reaching for the mouse... sheer bliss, after a couple weeks of backspacing. Can be hooked up to chair arms for a better experience... I have them on a herman miller aeron and have not seen a better workstation.

http://www.hermanmiller.com/CDA/SSA/Product/0,,a10-c440-p8,00.html


Thanks again for the good tips!

Andy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6 ... 15, 16, 17  Next
Page 5 of 17

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum