Jump to content

Tips for Linux Explorers


Bruno

Recommended Posts

CONEXANT DIAL-IN PCI MODEM in REDHAT

 

George did send us a short how-to summing up the steps he had to take configuring his Conexant PCI dial-in modem in RedHat 9.0

 

He did download the drivers Here, choose the type of drivers carefully ( HCF or HSF ) and go to the download section. There are many types for all kinds of kernels and operating systems !

 

If you´ve been trying to configure the modem before without having much luck, a complete re-install of your operating system is the best advice, because there will be all kind of files conflicting with the new configuration you´re about to set up.

1: Before Installing get your driver while in windows - and save it to disk -

 

2: install your distro

 

3: Right click and copy your driver RPM

 

4: Paste driver RPM into your home dir.

 

5: Open terminal and type su + root Password

 

6: install RPM using < rpm -i (your particular driver ) .rpm >(Wait for prompt to return this can take quite awhile)

 

7: Open internet configuration wizard

 

8: click on hardware tab and edit

 

9: type in Modem Device < /dev/ttySHCF0 > ( or if it is a hsf modem < /dev/ttySHSF0 >) ( without the < > )

 

10:Close and save all changes.

 

11:Open network device control and activate

 

Thanks George for submitting this description. I know you did this several times already, so anyone looking for help: George is the man you´re looking for !

 

cool.gif Bruno

Link to comment
Share on other sites

  • Replies 375
  • Created
  • Last Reply

Top Posters In This Topic

  • Bruno

    321

  • greengeek

    5

  • havnblast

    4

  • Peachy

    4

INSTALLING REDHAT ( First time )

From a real "Linux Explorer"

 

Steve_H was completely new to Linux as he did his first install of RedHat. Hearing all the stories that Linux was so hard to install, he was pretty nervous to start with, the bigger was his surprise that the actual install process was so easy and smooth. He wrote us in 9 steps how to go about installing RedHat 9.0:

This page sums up everything I did to get Red Hat 9 installed and running.

 

1. Checked Red Hat web site for hardware compatibility.

http://www.redhat.com/software/linux/technical/hcl/

-- I checked my system by looking at my manuals and running Compaq and Windows diagnostics.

 

2. Downloaded iso files to hard drive (600+MB each).

http://ftp.redhat.com/pub/redhat/linux/9/en/iso/i386/

-- iso files are "images" of the files you'll need that fit one iso file per disc.

 

3. Downloaded check sum file [md5sum (string of numbers)] from same location as iso files.

http://ftp.redhat.com/pub/redhat/linux/9/en/iso/i386/

-- To make sure the iso files were downloaded perfectly, compare this file's numbers with the numbers generated by the check sum checker following.

 

4. Downloaded check sum checker and installed it.

http://www.md5summer.org/

 

5. Ran check sum checker on the iso image files and compared against the check sum file.

 

6. Downloaded Nero CD burner and installed it.

http://www.ahead.de/en/index.html#download

-- If I burned the iso image files with Windows' default CD burner, they would be burned as iso files, which are not suitable for booting from. So I downloaded Nero, which recognizes image files and burns them correctly, separating all the files properly.

 

7. Burned iso image files to CD with Nero.

 

8. Inserted CD into Compaq Presario CD-ROM and booted up.

-- I thought I needed to press F10 to change the BIOS settings, but there were no settings for changing the bootup drive. It turns out that the Compaq read the CD drive boot info and booted from the CD with no problems. It was exciting when the Red Hat logo showed up in place of the Windows screen.

 

9. Download manuals from Red Hat site.

http://www.redhat.com/docs/manuals/linux/

-- As I am finding out, Linux does things very differently than Windows!

 

Steve H

 

Thank you Steve, this will help the "Linux Explorers" get their feet wet.

 

 

cool.gif Bruno

Link to comment
Share on other sites

SonicDragon

Thanks so much for doing these tips. I (finally) found time to read them all and am loving it! In fact, i'm in the new knoppix now B) I've got to try the Slackware Live CD soon :)Thanks again!

Link to comment
Share on other sites

ALIASES

 

To make your commandline experiences even more fun then they are already, here is a tip every lazy Linux user will love.

For long and complicated commands we can set an alias, that way an often repeated command can be brought back to one or two characters.

 

There are only a few rules you have to take in account: the alias comes always directly after the prompt and if you want to use more of them in one line you´ll have to add a space as you set the alias.

 

O.K. lets first set up some example files and directories:

 

NOTE: you will see the full prompt "bruno:~$" in these commands because in this case it is needed to show you how it works.

bruno:~$ mkdir -p ~/downloads/programs/extra/

(Will make a directory /extra in /home/bruno/downloads/programs, we use the -p argument in order to make all the underlying directories as well if they do not already exist. )

 

bruno:~$ vi ~/downloads/programs/extra/index

(Make a textfile called ¨index¨ where we will write a simple text:)

 

i ( to put vi in insert mode ) and type the line:

 

¨This is an index of downloaded programs¨

 

Esc + ZZ ( to save the file )

 

Good, the example files are created, now the real fun starts, we set up the aliases first:

bruno:~$ alias c='cd '

(Note the space after cd !!!)

 

This is because you can only use 2 aliases one after the other if you have that space ! )

bruno:~$ alias dp='~/downloads/programs/extra'

 

Now we will use the aliases:

 bruno:~$ c dp

(so these are the alias for the command; cd /home/bruno/downloads/programs/extra)

 

And the proof that c dp actually worked, here is the new prompt:

bruno:~/downloads/programs/extra$
bruno:~/downloads/programs/extra$ ls

( lets see what is in that directory )

 

index

 

We make another alias, note the space after cat !

bruno:~/downloads/programs/extra$ alias s='cat '

bruno:~/downloads/programs/extra$ s index

( short for ¨cat index¨ )

 

This is an index of downloaded programs

( and that was the line we typed in the file )

 

We use the c alias again:

bruno:~/downloads/programs/extra$ c ~[code]
( will put you back where we started )

[code]bruno:~$ rm -rf ~/downloads/programs

( will remove the remains of our little test, but leaves the directory downloads as it was before the test )

 

bruno:~$ unalias c dp s

( will undo the aliases we made here above )

 

NOTE: these aliases will only be there for as long as you do not log-out ! If you want to use them on a permanent basis you can write them in in /home/bruno/.bashrc ( clever if you have to use the same long commands every day ).

 

IMPORTANT: You can do "alias -p" to see what aliases are already set on your system, so you won't use ( overwrite ) one that is already in use !!

 

cool.gif Bruno

Link to comment
Share on other sites

THE RESET BUTTON

 

I know most computers have a reset button, used to be real handy back in the DOS days, Windows does not really like the reset-button but can live with it and recover most of the time fairly good. Sometimes it is the only way out for Windows users to escape a freeze of their computer.

 

It is my duty to warn you though: In Linux you better put a nice sticker or case badge over that button. Don´t ever use the reset-button in Linux !

 

There are far more sophisticated ways to get out of a freeze of your Linux system. Let me just remind you previous Tips: Run-Away Processes and Skinny Elephants.

 

This is really the only way to do it, so NEVER the reset-button !

 

 

cool.gif Bruno

Link to comment
Share on other sites

LINUX USER GROUPS ( LUGs )

 

 

Linuxdude32 ( Jason Wallwork ) wrote us a nice long post about Linux User Groups, the quote here below is a short version of his post, containing the most essential information, you can find the full version here

Linux clubs are almost always known as LUG (Linux User Groups). Don't let the "user" part fool you, though, LUGs often have developers, technicians, computer science students and teachers in them. And we're not just geeks. Some of the members of my group are novices or intermediate users. What we share are our interests in learning more about Linux and learning more about how we each use Linux. LUGs can vary in the services they offer, but at a minumum, you can expect:

 

(1) People who will answer your questions or point you in the right direction,

 

(2) Presentations, probably monthly, about Linux programs or new distributions.

 

(3) Discounts on some Linux programs or magazines (Linux Journal offers subscription discounts),

 

(4) A place to get Linux CDs either downloaded for you or borrowed and,

 

(5) An online list where you can ask questions in between meetings.

 

 

Additionally, many LUGs have extras such as:

 

(5) A Linux borrowing library,

 

(6) Installfests, where anybody can bring their computer to get Linux installed on them for free,

 

(7) A newsletter and,

 

(8) chances at winning cool prizes.

 

The best feature though, that every LUG is sure to have, is the people, just like you, who can help you with your Linux questions or just to show off to when you get that great new distribution. Chances are, there is a LUG already near you. And if there isn't, why don't you start one? There's no central list of LUGs on the Internet, but you should be able to find a LUG nearby on one of them. Here's some of the ones I know of below. Check Google for more.

 

Linux Online

Linux User Groups Worldwide

Tux.org

Red Hat's User Group Program

Yahoo Directory

 

One of the things I can't stress enough whether you're joining a LUG or creating your own is to get involved and get everybody else involved! And the other thing is that no matter how small a group is, go to the meeting. Small groups can't become big groups until people go to it. And more people become a magnet to getting more. And the success of a LUG isn't just in how many people are in it, anyway. It's in the social aspect, the comraderie, giving people not known for being social and place to belong.

 

The other aspect of LUGs it activism. Promoting Linux gives the people a voice, a chance to give everyone an alternative to Windows. LUGs are one of the best ways to give choice to a public that doesn't know there is any choice. Microsoft has said a lot of wrong things about Linux, but a couple of things that it has said are true, it is viral, in that amongst experienced computers, it catches on. Microsoft also called it a toy. They're right, Linux makes computing fun again and even a child can learn how to use it. A LUG can raise awareness in a community by having public Install-fests, by giving away CDs for free, by helping out a local school by building them a cheap computer lab using Linux software. Doing all of this by yourself is pretty hard, but a LUG makes it possible.

 

Get involved!

 

Jason Wallwork

President, Peterborough Linux User Group

My Webpage

 

Thanks Jason, already many of our forum friends contacted their local LUG to become a member.

 

cool.gif Bruno

Link to comment
Share on other sites

VERSION NUMBERS

( for curious people )

 

You might have been wondering; what are all those numbers in the name of .rpm and .tar.gz:

The version numbers for packages are build up like this:

 

Example: xmms-3.14.7-22.i586.rpm

 

Program xmms, major version = 3, minor version = 14, patch = 7, package version = 22, compiled for an Intel 586. packed as rpm.

 

For kernel versions:

 

Example: kernel 2.4.21-0.13mdk

 

Kernel version = 2, patchlevel = 4, sublevel = 21, extraversion = 0,13mdk

 

For distro versions:

 

Example: Mandrake 9.1

 

Major version = 9, minor version = 1

 

I do admit this info is not really of much use for people new to Linux, but I thought it would be fun to know what all those crazy numbers are about.

 

 

cool.gif Bruno

Link to comment
Share on other sites

RE-INSTALL and UPGRADES

 

Re-install:

 

Sometimes, due to whatever dark reason , you will have to do a re-install of your distro. ( As you´re new to Linux you often mess up your system just because you´re not sure how to do things in Linux and try keystrokes / mouse clicks at random. It has happened to the best of us ! ) In that case it´s good to know that all the personal files and settings can be saved without a problem. All these files are stored ( sometimes hidden ) in your /home directory. So at a reinstall you re-format all your partitions except your /home and in the case you have one the /backup partition. This way you won´t have to redo all the preferences of your desktop and all your mail, mail-settings & addresses will be saved !

Because a re-install does often not take more then half an hour, it really is no big problem . . .

 

Upgrades:

 

Every now and then ( mostly 6 month ) there will be a new release of your favorite distro, with updated packages and the newest versions of KDE, Gnome, Mozilla etc.

There is a golden rule for upgrading: for a jump from let´s say 9.1 to 9.2 you can take the upgrade option at install. This will only upgrade those packages that are new. However this is NOT always the best solution, but any software that you installed yourself after the previous install will stay intact. ( I personally do prefer a clean install at every change of version number. I just leave the /home and /backup as it is )

A jump from 8.2 to 9.0 ( major version ) however means always a clean install: re-formatting all partitions ( also /home, not the /backup ) The personal settings for KDE and Gnome will simply have to be done again . . .

Your mail and bookmarks however can be backed up and imported in the new version after install.

 

Golden rule: nothing beats a clean install !

 

cool.gif Bruno

Link to comment
Share on other sites

Bruno if you could could you put together a quick tip on the different commands such a -ivh vs -uvh and other commands such as su one can do for installing or uninstalling or updating etc.... I know -i is for install but I don't know what the v or h stand for - I imagin the -u is uninstall.When I install a package I just use rpm -i package.rpmThanks

Link to comment
Share on other sites

Hi KellyHave a look on page 3 of The Tips:

# rpm -ihv samba-2.2.1a-4.rpm ( will install the package )

# rpm -Uhv samba-2.2.1a-4.rpm ( will upgrade the package )

# rpm -e samba-2.2.1a-4.rpm ( delete the package )

# rpm -l samba-2.2.1a-4.rpm ( will list the files in the package )

# rpm -ql samba-2.2.1a-4.rpm ( will list the files and state the installed version of the package )

 

and there is much more there . . ;)

 

The -v stands for "verbose" ( display verbose file listing )

The -h stands for "hash" ( print hash marks as package installs, good with -v )

 

More info on different arguments :

"rpm --help" will give you all the info.

 

:) Bruno

Link to comment
Share on other sites

UPDATING YOUR DISTRO

 

A very important job to do on a regular basis is to get the updates for your distro: Bugfixes and security updates. Some distro´s need very few updates, others need long lists and large amounts of MB´s to keep them running smooth and safe.

 

In a nutshell here is why; Distro´s like Mandrake and Redhat are always pressed to get the cutting edge of new verions KDE, Gnome, Mozilla etc. Also there is a big competition between the two of them, this puts pressure on their new releases that come every 6 month.

At the other end of the spectrum there are Debian and Slackware.

Debian has not had a new version since 2 - 3 years, they still do their super-stable ¨woody¨ 3.0 uptill today ( also the base of Knoppix ), all the bugs are fixed long ago and the only updates are security. Slackware is not really pressed for new versions either, they only include fully tested and bug-free apps in their releases, Slackware´s pride is the name they have in stability.

 

Alright, now we know why to update, here is how:

 

Mandrake/Mandriva: Mandrake Control Center --> Software Management --> Mandrake Update. A full discription and update-allerts are in This thread, subsribe to the thread and you will get a notification from this forum each time a new update comes out. ( For Mandrake 9.2 Here For Mandrake 10 Here For Mandriva 2006 Here )

( NOTE: The updates you do during install are only minimal, after the install you have to do a full update in the Mandrake Control Center )

 

RedHat/Fedora: All you have to do is type "up2date" in a console or at a shell or click on that ever so annoying red exclamation mark next to the clock.

 

Debian: Also very simple open a console ¨su¨ root and type ¨apt-get update¨ and after that ¨apt-get upgrade¨

 

Slackware: Major security updates are announced on the front page of slackware.com and changes are always being made to the "current" branch. You can follow the changes by checking out This link .

A good and reliable tool for updating is Swaret

 

SuSE As far as I know Yast has an update function build in:

:Specifically, YOU (YaST2 Online Update) and with 8.2, there's a thingie in the task tray (that checks once a day for updates and turn red if there are some available (SuSEWatcher). You can further configure it to automatically download and install updates without user intervention (it does it through a cronjob once per day).

 

For people on dial-in: Here you can find a list of update RPMs for SuSE. You can download them on any machine connected to broadband and install them later on your own PC.

 

 

So, from now on, no more excuses for not being fully updated and bugfree . . .

 

 

cool.gif Bruno

Link to comment
Share on other sites

Thanks for the User Groups links. Found the Calgary Linux Users Group and will be going to an 'installfest' June 21. :rolleyes:

Link to comment
Share on other sites

MANDRAKE/MANDRIVA CLUB URPMI

 

 

Members of the Mandrake/Mandriva Club can add a few extra URPMI sources and have access to hundreds packages of extra software, also software you normally would have to pay for !

The nice thing from URPMI is that install is super easy and can´t go wrong; it picks up the additional packages needed for the selected software as well, you just need an internet connection . . .

 

Here is how you can add the sources, we take as example ¨contributions¨ because this is the largest source:

 

Log in on the Mandrake Club Site and go to the "Downloads" page.

In the left column you will see the heading "Mirror finder" that's the page you want.

 

Set the "Architecture" and "Distribution version" to what you are currently running and set the "Resource type" to "Contributions" ( Note: there is a difference between the free available "contributions" and the "Club-Contributions" )

 

Next press "Search Mirrors" and select your favorite mirror form the list and click on "URPMI set up" this will give you a line of code.

 

Go to a console, log in as ¨su¨ and paste the line after the prompt and hit enter.

Now it should work and get the list . . . be patient, it takes a while.

Then as you get the prompt back, close the sonsole ( Ctrl+d , 2x ).

 

Now that we have added the ¨contrib¨ source to your software manager, we can have a look at all the packages:

 

Go to the MCC --> Software Management --> ¨RpmDrake helps you install software packages¨ ( the icon with the + ). Now you will see the text : ¨All packages¨ under the search-box., ¨All packages¨ ¨by group¨ change the by group in: ¨ by source repository¨ and you will get a list with the sources you can coose from: CD1, CD2, CD3 and also the Updatesource and the ¨Contrib¨ source. That is the one: ¨Contrib ftp¨, click in the little triangle in front of ¨contrib ftp¨, and a list will fold out with all the packages you can choose from . . . . FUN, MAGIC, BLISS !

 

The other sources you can add:

- Contributions ( we just did this one )

- Distribution ( the things that usually are on your Cds but then updated, this will replace the sources from CDs 1 – 3 ! )

- Club-software ( adapt urpmi line with your nick and password )

- Club-commercial ( adapt urpmi line with your nick and password )

- Club-contributions ( adapt urpmi line with your nick and password )

- Club-contributions testing ( adapt urpmi line with your nick and password )

- PLF free( the Penguin Liberation Front )

- PLF non-free

 

 

Every now and then you will need to update the sources because new packages are added every day, this is how you do that in one single command ( as root ):

# urpmi.update -a

 

If you would like to install all the packages you have access to after adding these sources, you better get yourself an extra HD of 100 G !

Of course for all these goodies you have to be a member of the Mandrake Club . . . . . but nobody is forcing you . . . . . .

 

 

B) Bruno

Link to comment
Share on other sites

THE COMMAND LESSIf the "cat" command shows you the contents of a file, it does often happen that the file is to long for your screen. "Piping" it through "less" makes it appear on your screen page by page.An example: ( you have to be root to read the log-messages )

$ cat /var/log/messages

The output is un-readable because it flashes over the screen

$ cat /var/log/messages | less

( The "|" pipe-sign is the character on the key between "Backspace" and "Enter". ). It shows the file one page at a time.Also you can also do a search in less: Press the "?/" key, type the word to look for and hit Enter. It will mark all the matching entries in a different color.Shift + "?/" searches backwards."80G" will put you on line 80 of the file.You change page with the spacebar and close off with "q"No more to say about "less", except that it does more or less the same as "more". ;)*( "more" is another command, but it's not as effective as "less" ;) );) Bruno

Link to comment
Share on other sites

THE ¨LINKS¨ BROWSER

 

 

Here is a nice program to give a try: ¨links¨

Open a console and type:

$ links forums.scotsnewsletter.com/index.php?

 

and hit enter.

 

Links is a very fast browser that is purely text based, works also outside X, you could do Ctrl+Alt+ F1 to leave X and do the browsing pure in text. ( Alt+F7 will get you back to X )

 

The arrow keys make you jump, link to link and the enter key selects the link.

 

Some command options for link are:

 

-download-dir <path>

Default download directory.

(default: actual dir)

 

-anonymous

Restrict links so that it can run on an anonymous account.

No local file browsing. No downloads. Executing of viewers

is allowed, but user can't add or modify entries in

association table.

 

Keys:

ESC display menu

^C quit ( ^ is the sign for the Ctrl key )

^P scroll up (text mode)

^N scroll down

[, ] scroll left, right

up, down select link (text mode)

-> follow link (text mode), scroll right (graphics mode)

<- go back (text mode), scroll left (graphics mode)

z go back

g go to url

G go to url based on current url

^G go to url based on current link

/ search

? search back

n find next

N find previous

= document info

\ document source

d download

q quit or close current window

Alt-1 .. Alt-9 switch virtual screens (svgalib and framebuffer)

 

 

You might say, well I prefer Mozilla . . . but just imagine your X is broken and you have to download a file to fix it and install it. Links might just prove itself in that kind of situations.

Or you have an old P I with little memory, and install a distro without X, an only text-based distro . . . links ( and also lynx, another text based browser ) will permit you to browse and download extra software.

 

 

B) Bruno

Link to comment
Share on other sites

What about an old P3? Do we fit in the same category? Interesting way to browse - reminds me of the days in the 80s when our connections were all purely text!

Link to comment
Share on other sites

What about an old P3? Do we fit in the same category. Interesting way to browse - reminds me of the days in the 80s when our connections were all purely text!
Ain't that fun going all nostalgic, Julia ? If you like it there is also a few nice email-clients that can run outside X: Mutt and Pine. I won't let you know which one I prefer because that always leads to war between Pine adepts and Mutt fanatics ! :DB) Bruno* I can't help you set up Pine, but I could write you a little how-to on Mutt though B)
Link to comment
Share on other sites

. . . links ( and also linx, another text based browser )...
Could that be a possibly "Lynx" as i have used it in text mode.It also requires from you to enter protocol http:// or ftp:// before www, otherwise it won't work :)
Link to comment
Share on other sites

GREP IS FOR SEARCHING ( within a file )You better sit down for this one, grep is not the easiest command ! ( grep = Global Regular Expression Printer )We will talk about Global and Regular expressions tomorrowThe command "grep" searches for words or pattern in a textfile. Best explain this with an example:

$ grep 'pointer' /etc/X11/XF86Config

Will give no result !

$ grep -i 'pointer' /etc/X11/XF86Config

Will show the line where the word Pointer is written in the XF86Config file. ( the -i option tells grep to ignore upper or lowercase, so always handy :D )

$ grep -ni 'pointer' /etc/X11/XF86Config

The -n option will even show you the line number that the word Pointer is written.Now do:

$ grep -ni 'section' /etc/X11/XF86Config

You get a long list from line 8 to line 260 with the word "section" in it, you can easily see where the part is you're looking for. After this editing the file with vi will be a breeze.Or:

$ grep -ni 'Sony Vaio C1' /etc/X11/XF86Config

Gives you only the line and line number with "Sony Vaio C1" in it !Another example: Imagine you have problems with "postfix" and want to check your /var/log/messages ( you'll have to be "su" ):

$ grep -ni 'postfix' /var/log/messages | less

This will only show you the lines of /var/log/messages with "postfix" in it, because even this list is too long for the screen I pipe it through "less".( don't forget to close "less" with "q" :) )grep has much more options and advanced search functions, see "grep --help" for all the information !:) Bruno

Link to comment
Share on other sites

GLOBAL ExpressionS

 

Today we start a series of 2: Global Expressions and Regular Expressions.

Not really easy to explain but I´ll have a go at it, trying to keep it simple and only mentioning what the basics are. ( We use Global expressions to search files, Regular expressions to search in files )

 

Global expressions are mostly used in combination with the command ¨ls¨ ( list files ).

I suppose you know that the ¨*¨ sign is a wild-card and can stand for one or more characters. The ¨?¨ is a wild-card for only 1 character. The ¨!¨ excludes the characters that follow.

 

Here are some examples:

$ ls [a-e]*

 

This will only list the files that start with a, b, c, d or e. ( Not A or B ! )

$ ls [a-eA-E]*

 

Will do the same but then also A, B ,C ,D and E

$ ls *[a-e]us

 

The files that end with: aus, bus, cus, dus and eus

$ ls ?[a-e]re

 

Will show the files; dare, acre, mere, bare, . . . etc.

$ ls *[!a-b]re

 

Shows files that end with ¨re¨, but not the ones on ¨are¨ or ¨bre¨

$ ls *.{jpg,png,gif}

 

List all the files that end with .jpg, .png and .gif

 

Notice the difference in { } and [ ] !!!

 

This is as far as I go with Global Expressions, tomorrow we do the Regular Expressions, that is not as straightforward as the Global ones, but as I said before: I will do the ultimate to keep it simple !

 

cool.gif Bruno

Link to comment
Share on other sites

REGULAR ExpressionS

 

Regular expressions are more or less the same as the Global ones, but are mostly used to search strings ( any sequence of characters ) and to perform changes, within a file. ( We use Global expressions to search files, Regular expressions to search in files )

They are widely used with the following commands: "grep", "egrep" and "sed". Also for searches in the "vi" editor we use Regular expressions.

We will keep our search limited to "grep".

 

NOTE: First 2 striking differences with the Global expressions:

"?" stands for 1 random character in Global expressions, "." is the sign for it in Regular expressions.

[! . . . ] stands for "not" in Global expressions, and [^ . . . ] is what we use in Regular expressions.

 

In fact, the "^" has 2 meanings in a regular expression, depending on its place: "[^" means "not" , where just "^" at the beginning of the expression means that the string or word should be at the beginning of the line.

A "$" at the end of the expression means that the word should be at the end of the line. ( This will all become clear in the examples. )

One more thing: the regular expression always starts and ends with ' ( an apostrophe ).

 

Grep will search a string of characters specified by the Regular expression and print the lines in which it finds those strings to the screen.

 

O.K. Here are some simple examples:

$ grep -n 'cr[i-z]ft' example-file

 

Will print the lines with "cruft" and "croft" in it ( with the line numbers )

$ grep -n 'sh[^a-h]re' example-file

 

Prints the lines with "shore" and "shire"

$ grep -n '^ Fast. *them $' example-file

 

Will search for the lines that starts with the word "Fast" and end with the word "them"

 

Regular expressions interpret the . \ [ ] * in a special way, so if you want them to be part of the string you look for, you need to use the escape sign: \

 

Another formula: \{ . . . \} tells grep how many times a character should show: a{2\} means 2x the "a"

 

Example: Imagine you have a long list of names and telephone numbers, and you want to search for a name that starts with a "B" and has 66 in the phone number.

$ grep -n '^ B* 6\{2\} * $' phonelist

 

Another little hint:

$ grep -n 'bat' example-file

 

Will find lines with the words "bathroom", "batter" and so on.

$ grep -n '\<bat\>' example-file

 

Only finds the line with the word "bat" in it

 

O.K. We had enough complicated stuff lets have some FUN, try this one:

$ grep -e '^\(.\)\(.\)$' /usr/share/dict/words

 

To find 4 letter palindromes

or:

$ grep -e '^\(.\)\(.\)\(.\)$' /usr/share/dict/words

 

To find 6 letter ones

 

So this gave you a little taste of what a Regular expression is. For a deeper insight see: Here.

Or if you really want to know it all, the "Mastering Regular Expressions" book at O'Reillyor at your local bookstore.

 

B) Bruno

Link to comment
Share on other sites

\CONFIGURING and COMPILING THE KERNEL

 

It's not that I want you all start tinkering with the kernel, but for the very curious ones amongst us:

If you download the kernel sources to your /usr/src directory you can compile the kernel yourself and adapt it to the specific needs of your system.

The things that could be said about compiling your own kernel are too many for the Tips. ( See the links below for deeper info ) I just want to give you a quick starter to go by.

 

In shorthand:

# cd /usr/src/<directory of your new kernel>
# make mrproper
# make menuconfig or make xconfig ( with xconfig you get a GUI )
# make dep
# make bzImage ( watch it the i from image is a capital i ! )
# make modules
# make modules_install

 

Then copy /boot/vmlinuz to vmlinuz.old

Then copy /usr/src/<dir. new kernel>/arch/i386/boot/bzImage to /boot/vmlinuz

Then copy /usr/src/<dir. new kernel>/arch/i386/boot/System.map to /boot/System.map

Edit your /etc/lilo.conf or /boot/grub/menu.lst to add a configuration line for your new kernel. ( leave the old part in there and point it to vmlinuz.old, in case of troubles you can always boot the old one )

If using lilo run /sbin/lilo

 

That should be it !

 

Must read: Sourceforge. More info: Linuxplanet. Good Howto with screenshots: BitbenderForums

 

 

NOTES:

][/b](Bruno @ Forum June 6 2003)

every six month a new kernel will be in your distro from the start, I do not really see any good in upgrading your kernel in between ( unless you´re a real hardcore tweaker and are prepared for some "extra" work . . ). I did it once, long ago, took me two days to get the new kernel to be accepted without the "panic" in the first place and adapted to my wishes/needs it in the second place. Since that day I'm the lazy kind of guy and wait till the new Boxed CD's are delivered at my door. I do like tweaking and fiddling my system . . . . but there are limits to the fun.

 

(Jong357 @ Forum June 12 2003)

also don't update the Kernel.... Many things are dependent on the Kernel version. Every six months there will be a new release anyway, so why bother.....

 

cool.gif Bruno

Link to comment
Share on other sites

CD RIPPING with KONQUEROR

 

 

After all the serious and more complicated Tips, here is an easy one:

 

For ripping a CD to .wav or .ogg format, insert a CD into your CD-ROM and click on the ¨home¨ icon on your KDE desktop.

In the side bar, click on the icon that says ¨services¨, you will see the ¨Audio CD Browser¨ appear, then select ¨by name¨ or ¨by track¨ for .wav or ¨Ogg Vobis¨ for .ogg format. Copy and paste the files to your /home/bruno/music directory and the job is done.

( .wav can be easily converted to mp3 if you really would want that with the ¨wav2mp3¨ or ¨Lame¨ program. If Lame is installed Konqueror will show the option MP3 too )

 

Enjoy the music.

 

 

cool.gif Bruno

 

* The Lame converter is also called ¨notlame¨ these days. Don´t ask me why but there sure is a reason for it. ( in the desciption it says; ¨this is not Lame¨ but it is the same software )

Link to comment
Share on other sites

EXTRA FONTS IN MANDRAKE

( might work in other distro´s as well )

 

 

For the lucky ones amongst us running Mandrake, you can install extra fonts as many as you like.

 

Just look for ttf fonts :

 

http://www.fontsnthings.com/h/h.html

 

http://www.identifont.com/free-fonts.html

 

or any other site.

And simply copy them to: /usr/share/fonts/ttf/docoratives or /usr/share/fonts/ttf/western

 

Have fun with your fonts !

 

 

cool.gif Bruno

 

 

PS: Dual-booters, you can also import your Windows fonts with a special tool in the Mandrake Control Center.

Link to comment
Share on other sites

I'm almost sure that importing windows fonts is what cause my display problems.Suggestion is do not import Windows fonts from XP.mike180

Link to comment
Share on other sites

SCREEN SAVERS in KDE

 

You will probably have noticed that since KDE 3.0 there are by default only 4 screen savers included. Also adding them from kdelook.org does not really work like it should . . . .

 

The solution is simple: install ¨kdeartwork¨ via RPM or better even URPMI and you will see 27 screen savers appear in the KDE Control Module. ( kdeartwork is on your CDs )

 

27 Sceen savers not enough ?

Got a 3D accelerated card ?

Xscreensaver-gl has another 32 of them !

 

( Type: ¨xscreensaver-demo¨ at the prompt to see if they are already installed or not. )

 

A few commands:

$ xscreensaver-demo

 

( will also start the deamon, default: 10 minutes )

 $ xscreensaver-command -exit

 

( will stop the deamon )

 $ xscreensaver-command -restart

 

( will restart the deamon )

 

There is a .xscreensaver file in your /home where you can override the default settings.

 

A little script in KDE autostart with just the line ¨xscreensaver¨ makes the deamon startup at boot.

 

Read the docs: http://www.jwz.org/xscreensaver/man.html

about how to install and get them working.

 

Of course, as you´re logged in on the forum, there is more fun in reading then watching a screen saver.

 

cool.gif Bruno

Link to comment
Share on other sites

FSTAB and MTAB

 

These are some of those critical programs for your computer. Without these, your computer will not know where to find any of the partitions or drives on the computer. Goof this up and you can be dead in the water. Never make any changes without a good backup copy.

 

/etc/fstab

 

In this file there is a description of the various file systems. Commands like ¨fsck¨ and ¨mount¨ consult this file for the actions they take.

This looks like a complicated description of the files on your computer, but it is really simple if you break it down into the parts of each entry. Take a look below.

( OR :In order for certain programs to be able to determine where certain partitions are supposed to be mounted by default, the /etc/fstab file is used )

 

/dev/hdb1 / ext3 defaults 1 1

none /dev/pts devpts mode=0620 0 0

/dev/hdb6 /home ext3 defaults 1 2

none /mnt/cdrom supermount dev=/dev/hdc,fs=auto,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0

none /mnt/cdrom2 supermount dev=/dev/scd0,fs=auto,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0

none /mnt/floppy supermount dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,sync,codepage=850,umask=0 0 0

/dev/hda1 /mnt/windows vfat iocharset=iso8859-1,codepage=850,umask=0 0 0

none /proc proc defaults 0 0

/dev/hdb7 /usr ext3 defaults 1 2

/dev/hdb5 swap swap defaults 0 0

/dev/sda1 /mnt/memory_card auto user,iocharset=iso8859-1,kudzu,codepage=850,noauto,umask=0,exec 0 0

 

I will try to bring some clarity in there. Let´s only take the partitions, here for Linux : / and /home and swap. For Windows C:

< partition >< mount point >< file system >< mount options >< dump >< fsck order >

/dev/hdb1 . . . . / . . . . . . . . . . . . ext3 . . . . . . . . . defaults . . . . . . . 1 . . . . . . . . . 1

/dev/hdb6 . . . . /home. . . . . . . ext3 . . . . . . . . . defaults . . . . . . . 1 . . . . . . . . . 2

/dev/hdb5 . . . . swap . . . . . . . . swap . . . . . . . . defaults . . . . . . . 0 . . . . . . . . . 0

/dev/hda1 . . . . /mnt/win_c vfat . . . iocharset=iso8859-1,codepage=850,umask=0 0 0

 

For the CD-ROM and floppy drive:

none . /mnt/cdrom . . supermount dev=/dev/hdc,fs=auto,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0

none . /mnt/floppy supermount dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,sync,codepage=850,umask=0 0 0

 

You can see the CD-ROM and floppy have the same codes as the Windows partition because they are not Linux default.

 

For the memory card reader:

 

/dev/sda1 /mnt/memory_card auto user,iocharset=iso8859-1,kudzu,codepage=850,noauto,umask=0,exec 0 0

 

Two additional entries are ¨devpts¨ and ¨/proc¨

 

The devpts file system provides an interface to pseudo-terminal (pty) devices. It is typically mounted at /dev/pts.

 

The /proc filesystem is to provide an easy way to view kernel and information about currently running processes.

 

If you build Linux from scratch, you will have to write your own /etc/fstab file.

 

/etc/mtab

 

This file handles the mounted devices and is automatically updated by the mount command.

And it looks a bit similar to fstab but not the 100% same ( notice rw and ro for read/write and read only ) And it does only lists the mounted devices !

 

/dev/hdb1 / ext3 rw 0 0

none /proc proc rw 0 0

none /proc/bus/usb usbdevfs rw 0 0

none /dev devfs rw 0 0

none /dev/pts devpts rw,mode=0620 0 0

/dev/hdb6 /home ext3 rw 0 0

none /mnt/cdrom supermount ro,dev=/dev/hdc,fs=auto,--,iocharset=iso8859-1,codepage=850,umask=0 0 0

none /mnt/cdrom2 supermount ro,dev=/dev/scd0,fs=auto,--,iocharset=iso8859-1,codepage=850,umask=0 0 0

none /mnt/floppy supermount rw,sync,dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,codepage=850,umask=0 0 0

/dev/hda1 /mnt/windows vfat rw,iocharset=iso8859-1,codepage=850,umask=0 0 0

/dev/hdb7 /usr ext3 rw 0 0

/dev/sda1 /mnt/memory_card vfat rw,nosuid,nodev,iocharset=iso8859-15,codepage=850,umask=0,user=julia 0 0

 

Next time we will do the ¨mount¨ and ¨umount¨ commands related to these /etc/fstab and /etc/mtab files.

 

cool.gif Bruno

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...