LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-22-2003, 05:17 PM   #106
jadugarr
LQ Newbie
 
Registered: Jul 2003
Location: Lexington
Distribution: Mandrake 10
Posts: 24

Rep: Reputation: 15

For slackware 9 users trying to play cds in XMMS, you have to download and install the cdread plugin first ... its not installed with XMMS for some reason. I spent hours trying to figure this one out, only to find that it was something simple.
 
Old 07-27-2003, 05:55 PM   #107
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
Has it ever happened to you that you accidentally used cat on a binary file and got your terminal full of weird characters? Well it happened to me, and I solved the problem with:
reset

which initializes your terminal.

I have some long files in my home, which I review frequently and instead of using:
less file

i add #!/usr/bin/less at the beginning of it, make it executable and run it.
 
Old 07-28-2003, 11:33 AM   #108
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
I hate typing those long directory names!

Ever get tired of typing long directory names? Try using the directory stack with the commands pushd, popd, and dirs. The directory stack allows you to keep a list of directories and navigate between them.

# pushd adds a directory
# dirs lists all directories on the stack
# popd removes the top entry and cd's to that directory

Here is an example on my machine:
Code:
[root@uilleann root]# pwd
/root
[root@uilleann root]# pushd /usr/src/linux-2.4.18-3
/usr/src/linux-2.4.18-3 ~
[root@uilleann linux-2.4.18-3]# pushd /usr/share/doc
/usr/share/doc /usr/src/linux-2.4.18-3 ~
[root@uilleann doc]# dirs
/usr/share/doc /usr/src/linux-2.4.18-3 ~
[root@uilleann doc]# popd /root
/usr/share/doc /usr/src/linux-2.4.18-3
[root@uilleann doc]#

Last edited by fancypiper; 07-28-2003 at 11:40 AM.
 
Old 07-30-2003, 12:21 PM   #109
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
Besides the one that is mentioned at the bottom of the man page for man (man man):
man man.page | col -b > man.page.txt

there is another way of extracting man pages into a file (suggested by UGU ):
first you have to set and export the variable PAGER to cat (for BASH):
export PAGER=/usr/bin/cat

then redirect the man page:
man man.page > man.page.txt

And at the end you must not forget to unset the variable:
unset PAGER

Last edited by lfur; 07-30-2003 at 12:23 PM.
 
Old 08-05-2003, 07:42 PM   #110
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
External view filter (reading email in Pine)

If your system mails you output from logrotation, maybe it's filtered tru Logwatch, logsurfer or the like, or maybe not. If your logs are huge and you're not sure you're eyeing all the "important" stuff, try piping it tru a filter. This example should work with any CLI mailreader that can work with pipes (I'm using Pine).
Save the file somewhere in your $PATH as "peg", make it executable. Open up Pine, pull up one of them logs, type pipe symbol, on the commandline type "peg", and enter.

Code:
#!/bin/bash
# Purpose: peg or "Pine Error Grepper"
# Args: none
# Deps: Bash, GNU utils
# Run from: pine as pipe filter
case "$1" in v|-v|r|-r|-rev|--reverse) rev="v";; esac
egrep -${rev}ie "(fatal|err|fail|warn|deny|denied|auth|kill|remov|exit|could|termin\
|signal|sync|sysrq|sudo|ignore | no | block | down | stop)"
exit 0
nb[0]: If you type "peg -v" you get the reverse, which is good to check on the grepping itself.
nb[1]: If your boxen usually do NOT have interfaces in promiscuous mode, then add "promisc" as a term to grep for.
nb[2]:If you use this filter, and you change/add something that could benefit us all, please post an update, TIA.
 
Old 08-11-2003, 05:24 AM   #111
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
@lfur

(First method worked, but without the enhancements -- like bold text, underlined etc.)

The second does not: Firstly, my pager resides in /bin/cat (obstacle overcome ), but so the distros vary. The text in the newly created file then contains a lot of ?escape-sequences? like m^H, U^H etc.

My standard pager is "less". But "man <command> > output.file again lacks the enhancements.
Tested options, anybody? (less -isr??)

Last edited by JZL240I-U; 08-11-2003 at 05:25 AM.
 
Old 08-11-2003, 06:19 AM   #112
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
hmmmm...well I found this one a while ago and I'm not sure if its categorized as a tip or trick but I'll share it anyway.

Apache comes with a neat little utility called apache bench which benchmarks your web servers performance. The command goes as follows:

ab -c 5 -n 200 http://www.yoursite.com/index.php

ab is the the apache bench command. It simulates 5 users(-c 5) accessing your site 200 times(-n 200). It takes a while to run but it spits out some very usefull information.

Give it a try but be patient with it.
 
Old 08-11-2003, 05:15 PM   #113
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
JZL240I-U,

I know. But it works fine with less (or more). But than again, you can use tr to remove unwanted characters
 
Old 08-25-2003, 01:11 AM   #114
engnyr
LQ Newbie
 
Registered: Jul 2003
Location: New Zealand
Distribution: mandrake
Posts: 10

Rep: Reputation: 0
the best thread around

MasterC .... a great thanks to you. I was compiling the source code for my icewm and i so wished that there was a way around! And ahaa... here you go the good guys over here have done that... Thanks very much...
Having decided to say thanks, won't be fair if i don't do any of my the usual trick which i learnt in the due course... Excuse if someone has already done this over here. I jus' read the first 5 pages...

Ever wondered how to print a simple tex file( or in that whatever file..)
$> enscript file.tex -o file.ps -- u get a postscript file...

there are many options for enscript like 2(for two columns), E(for highlighting keywords in C,C++,...)...
still not happy with the ps, you can convert to the pdf as well...

$>ps2pdf file.ps

this is for starters... there are a lot of options for "ps2..." hope this helps some newbie...

cheers,
me
 
Old 08-25-2003, 04:55 AM   #115
Bebo
Member
 
Registered: Jul 2003
Location: Göteborg
Distribution: Arch Linux (current)
Posts: 553

Rep: Reputation: 31
Gotten tired of all the beeps your computer produces when you happen to hit backspace one time to many? I'm SOOO tired of this - a computer should be SILENT all the time unless I play something on it! So, what I did is to put the line "set nobeep" in my .cshrc (I'm using tcsh), and it is...silent! Great! Don't know if this works in bash though.

Do you have more hints on how to make the computer shut up?
 
Old 08-25-2003, 05:19 AM   #116
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I think editing inputrc to 'set bell-style none' will do it. I dunno - I don't mind the beeps - let's me know when I'm screwing up. Although I do need to change my mail-notification sound, since it's the same beep and that can be disconcerting. *g*

Cutting the speaker wire will also work wonders.
 
Old 08-25-2003, 05:29 AM   #117
Bebo
Member
 
Registered: Jul 2003
Location: Göteborg
Distribution: Arch Linux (current)
Posts: 553

Rep: Reputation: 31
lol! Yeah, I think I'll try cutting the wire. Or not

Nah, I haven't found anything good with the beep, since it is often VERY obvious what the problem is. For instance, it's extremely obvious that I've "screwed up" when I bang the cursor into the prompt with an extra backspace

...but then again, it WOULD be nice to hear the beep when I get new mail
 
Old 08-26-2003, 03:21 AM   #118
gniv
LQ Newbie
 
Registered: Aug 2003
Location: New Jersey, USA
Distribution: Red Hat
Posts: 3

Rep: Reputation: 0
Great thread. Lots of neat stuff.
While reading the posts, I remembered some tricks that I use:
1. If you find pushd and popd cumbersome, you may be satisfied with just
cd -
It will get you to the previous directory. Then do it again to get back. It's like the recall button on the TV remote

2. Somebody mentioned having an alias like this:
alias server1='ssh me@server1.com'
Normally, when running this, you are asked for the password. You can get rid of this step as well by adding public key authentication. It's not very complicated, but you should understand what's happening, for obvious reasons. Instructions are found in man ssh and man ssh-keygen. Executive brief: run ssh-keygen on the client and update the file $HOME/.ssh/authorized_keys on the server.

3. An alternative command to find the 20 largest files in a directory tree:
du -aS /usr | sort -rn | head -20
(explanation: du -aS lists all files and their usage, excluding directories, sort -rn sorts the entries generated by du in reverse order based on file size, and head -20 displays only the top 20 lines returned by sort).

That's it for now.
 
Old 03-12-2004, 07:01 PM   #119
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Quote:
Originally posted by Cyclo
Great feature of vim (heard there's something simliar in emacs) is folding, if you're a programmer.

You can collapse and expand sections of code you specify, handy if you have a function thats 300 lines long or something
works like this:
first, turn it on by typing ":set fdm=marker", then surround the bit you want to hide with:

//{{{ brief description here
whatever you want to hide
//}}}

also works with:
/*{{{ brief descriptinon */
whatever
/*}}}*/

to hide or close a section, type "zo" to open, "zc" to close
If you're writing a bash script, where // doesn't work as a comment, you can replace // with a # and get the same result. Also, adding "set fdm=marker" to .vimrc will permanently enable this feature.
This is one of the best threads on LQ...thanks peeps.
 
Old 03-26-2004, 06:26 AM   #120
crypto2phreak
LQ Newbie
 
Registered: Mar 2004
Posts: 14

Rep: Reputation: 0
i think this is awesome for most newbs even i understood a few things and i just installed red hat 8 for the first time 4 hours ago. ( i know don't ask me y) . I wish more people would go into a little more details about some of the simple commands and source code and give an explaination on termanology used in this thread. just giving my $0.000002
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wargame Hints? the_p0et Linux - Security 3 10-19-2003 11:04 PM
hints and tips bigjohn LQ Suggestions & Feedback 0 08-04-2003 01:48 PM
Slackware CUPS hints mi6 Slackware 3 06-05-2003 08:56 PM
Hints - process myquestion Programming 2 04-15-2002 07:26 PM
gcad hints ? jamaso Linux - General 0 03-02-2002 08:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration