Learn Linux for Beginner

Thursday, April 28, 2005

Internet2: About Internet2

Internet2: About Internet2: "About Internet2�
Internet2 is a consortium being led by 207 universities working in partnership with industry and government to develop and deploy advanced network applications and technologies, accelerating the creation of tomorrow's Internet. Internet2 is recreating the partnership among academia, industry and government that fostered today�s Internet in its infancy. The primary goals of Internet2 are to:
Create a leading edge network capability for the national research community
Enable revolutionary Internet applications
Ensure the rapid transfer of new network services and applications to the broader Internet community.
Through Internet2 Working Groups, Internet2 members are collaborating on:
Partnerships
Initiatives
Applications
Engineering
Middleware
For more information about Internet2 see:
Internet2 Newswire archives, the latest Internet2-happenings.
Internet2 Email Lists that are publicly accessible
Frequently Asked Questions and answers
Internet2 Glossary and Style Guide defines and explains many advanced networking term
Information Kit with downloadable documents and multimedia
Internet2 Videospace has net-accessible, high-performance video about Internet2
For more information about the people and organization supporting the work of Internet2 members, see:
Board of Trustees
Advisory Councils
Bylaws
Staff "

Friday, April 15, 2005

The end of the beginning

The end of the beginning

This is the end of Getting Started with Linux, our beginner's introduction to this operating system. What we have intended to do is take you from the point where you've got some Linux CDs and a computer in front of you without Linux in it to where you've installed and and you're using it productively. This means that you're using it to maintain files, write documents , manage data, keep figures straight with a spreadsheet, surf the web, write email, chat with friends. At the same time you're listening to your favorite music in either MP3 or Ogg format, on a CD or streaming over RealAudio.

The fact is that there is an endless amount of things that you can do with Linux. Our aim here was to give you the basics. Now it's up to you to explore- to try expanding on the things that you've learned here. In the end, the point is to learn and to have a little fun in the process.

Where do you go from here?

At this time we're working on our Intermediate Linux Course. This course, which is still in development, will take you from the beginner level to the point where you feel very comfortable with Linux. Our aim is not to make professional systems administrators out of those who follow the course, but to make you independent enough with your Linux machine that you don't need to seek outside help as frequently as a novice does to solve the occasional problems that arise. Here are a few of the topics that we'll be covering in the next course.

  • general system administration
  • security alerts
  • Linux kernel compiling and installation of new kernels
  • automating services and tasks
  • use of Bash and Perl scripts
  • firewalls
  • setting up a web server with Apache
  • setting up a mail server with sendmail
  • Samba for Windows file sharing
  • Professional databases MySQL and PostgreSQL
  • Linux for the small business

If you are a registered user, we'll keep you posted on updates as to the availability of the Intermediate Linux Course.

Please, feel free to send us suggestions and comments through email at bdlug at bauani.org

This is END of beginning...Welcome to the World of Linux.... Enjoy....

A final word about X-window

A final word about X-window

The GUI applications for Linux are always changing, evolving and adapting to user needs. Linux has come a long way in the past few years. It is becoming a serious threat to the dominance of Microsoft Windows not only in the server market but on the desktop as well. The important work done by the people in the GNOME and KDE projects as well as other those carrying out development of other window managers and XFree86 show the level of commitment there is to getting Linux on the desktops of the worlds computers in offices and homes.

In this lesson we've given you a number of addresses of web pages of these types of projects. The best thing to do to support these efforts is to check back on these projects from time to time, install the latest version and talk to your friends about how good you think they are. Also, contact the developers or join the mailing list for that particular project and provide feedback, both positive and negative, about the software you've tried. That's essentially what the Linux movement is all about. You can also volunteer to do some work. You don't have to be a programmer to make a vital contribution. You can translate the documentation or the graphic interface to your native language, for example. In the end, any form of collaboration is good. That's how Linux grew into the major operating system that it is and that's essentially what the Linux movement is all about.

More X-Window Tips and Tricks

More X-Window Tips and Tricks

Starting X on other virtual terminals

With Linux, you are not limited to starting X-window only once. You may open up another virtual terminal and start another instance of X-window. Remember though that running two instances will use up a lot of memory.

As we saw in previous lessons, to switch to another virtual terminal, press:

CTRL + ALT + F2 (or F3 up to F6)

Then login as another user and type:

startx -- :1

You can switch between instances of X-Window by typing:

CTRL + ALT + F7 and
CTRL + ALT + F8

Using the X-Window programs from another computer

This is the thing I love to show people from the MS Windows world. I point to the computer across the room and then say: "Now I am going to start the browser from that system and make it appear here." You don't need to be David Copperfield to perform this magic. You only need X-window running on one and installed on the other. You also need a means of logging in to the other computer. And here's one more thing. The computer doesn't even need to be in the same room. It can be in a different room in a different building on a different continent. Providing your bandwidth is good enough, you can start a program on a computer 5000 kilometers away and use it on your desktop.

There are two ways to do this. One is not secure and probably should only be used on a local network, if at all. The second one is very secure and can be used for trans-oceanic X-window sessions.

If you have the remote login device telnet and the telnet server installed on the machines, you can use this fairly safely in a local network. For example, if your workstation is called 'amos' and the other machine is called 'andy' and you want to use a program on 'andy', sitting at 'amos', you would type:

xhost +andy

Then with telnet, login into 'amos' (telnet> open amos)

Then, type:

DISPLAY=amos:0.0
then
export DISPLAY

Now you can type the name of any program you want to run that you know is on 'andy'. Remember though, as I mentioned, telnet is insecure. This are better ways of doing this. You should never do this if you're working over a public network, like the Internet.

Remote X sessions with OpenSSH

Open SSH stands for Open Secure Shell. That's just what it is. A secure shell for logging in at other computers in a secure manner. What goes over the network is encrypted and your security is not compromised. Most major distributions will offer this and it is normally installed by default. You may have to specifically install the OpenSSH server which you need to have to for this to work on your local network. Using X on another machine, also known as X forwarding is usually disabled by default so you may have to edit one file to get this to work locally. If you're doing this across oceans or continents the configuration will depend on the remote machine. As long as you have a OpenSSH client and an account on the other machine, you can do this.

As I mentioned, if you want to do this locally. Here's what you have to do. Let's use our 'amos' and 'andy' example again. You're sitting at your workstation called 'amos'. Make sure you have OpenSSH server on installed on 'andy' and have created a user account there. On 'andy' you need to login as 'root' and make sure that there is a line in a file called 'sshd_config', usually located in /etc/ssh that says X11Forwarding yes. If this says X11Forwarding no than you need to change it to yes. Then you need to restart the OpenSSH server. The easiest way is to look for its PID by typing: ps ax | grep sshd and killing it's PID number. Then type: sshd to start the server again.

Then, from 'amos' just connect to 'andy' via SSH, like so:

ssh -l [yourusername] andy
you'll be asked for your password. You log in and then you can run the X application that you want. It will come up on your desktop on 'amos' courtesy of 'andy'.

Tips and Tricks for X-Window

Tips and Tricks for X-Window

.xinitrc

This is a file you'll find in your user directory. You can use it to start programs automatically when you start X-window. Open the file with vi or the text editor of your choosing. Then, for example, add:

xclock -bg wheat -geometry 100x100+1+1 &

-bg sets the background color and the -geometry setting I have used here gives you a fairly small, but not too small clock in the upper left hand corner of your desktop. You can type: man xclock to see more options. Experiment with options first before you put your definitive xclock settings in your .xinitrc file. Just type your settings into an xterm and try different ones. Type: killall xclock to shut off the clock each time.

.Xdefaults file

There's another file in your user directory called .Xdefaults. You can use this file to change the way some of your X-window applications look. It's fun to try out different styles and get some settings that please your eye. Before you try to do this however, make a backup. Type:

cp .Xdefaults .Xdefaults_good
because there is always some danger of making some applications non-operable because you have left spaces where you shouldn't. It is important when you change settings that you leave no trailing spaces. Most major distributions provide a working .Xdefaults file. It's best to leave what you find there, but you're free to add stuff to it.

As an example, let's change the look of emacs, for example.

First, open up the file with Vi or any text editor your prefer. Add this to it:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! emacs changes [date]

emacs*Background: DarkCyan
emacs*Foreground: Khaki
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Let's explain what we've done here. First, the exclamation point (!) in this file is used to make comments. The two rows of exclamation points I've used to show where my emacs section begins and ends. Then I use two to comment that I am changing emacs and I have included [date] where I would put the actual date to show when I made the changes. You don't have to do this. It's just something extra to remind me when I made the changes. Then we make the actual changes.

With: emacs*background: DarkCyan we can change the background of the application's menu bar and frame. You can use any color you like that the system supports.

With: emacs*Foreground: Khaki we've changed the color of the words in the menu.

To make the changes take effect, you have to issue this command in an xterm:

xrdb -merge $HOME/.Xdefaults
This will restart the x-server database and log in your changes. If you don't do this, X-window keeps your old .Xdefaults in memory and you won't see anything new. Restart emacs and you should see your new colors. If emacs doesn't come up, you may have left some trailing white space. If that is the case, just type emacs in an xterm and an error message should appear saying something like: Warning: Color name "khaki " is not defined or similar. If you see a space before the second quotation mark, then you've got whitespace in your .Xdefaults file that needs to be eliminated.

As you get more adept at changing things, you'll make your desktop more to your liking.

xwininfo

If you're interested in seeing a bit of information about certain programs running, you can type xwininfo into a terminal and then click on any window. For example, I had another xterm open and I clicked on it and got this info:

xwininfo: Window id: 0x2c0000e "xterm"

Absolute upper-left X: 211
Absolute upper-left Y: 132
Relative upper-left X: 0
Relative upper-left Y: 0
Width: 581
Height: 340
Depth: 16
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +211+132 -8+132 -8-128 +211-128
-geometry 80x24-3+109
This comes in handy especially to find suitable '-geometry' settings for use in starting up applications and including them in the .xinitrc file.

xset

This is a command line utility to control things like your mouse, keyboard, monitor and pc speaker. Both GNOME and KDE have other graphic apps to do this stuff a lot easier, so I find myself using this less and less. But you can try it out. For example, type: xset b off to stop your computer from beeping at it. And to turn it back on? You guessed it: xset b on. You can also change the tone by typing something like: xset b 30 550 300 The first number is for volume, the second pitch and the third duration of the beep.

xsetroot

In a previous section, we told you how to use xv to put your favorite picture on your desktop. If you get tired of pictures and you want something plain, you can use xsetroot to just put a color scheme on the desktop. For example, typing: xsetroot -solid seagreen will get you a solid dark green color as a background. This one is soothing to the eyes. It's the same color used on pool and card tables. Of course, you're free to use the color you like! Type: man xsetroot to see other options.

Little goodies to improve your quality of life

Little goodies to improve your quality of life

(aka: those little apps you'd rather not live without)

Music

When I got broadband Internet access, my life changed forever. No more paying for dial-ups on a hourly basis. No more painful downloads of software. But what's more important than all of this is that I could now listen to radio! So what, you say. Well, I live more than 6,000 miles from the place where I grew up, so when I could finally listen to a radio station from the city where I was born as easily as my mother (who still lives there) can switch on the radio, I was delighted. RealAudio player for Linux is just one of those little apps I'd rather not live without.

RealPlayer

I can't help but make an editorial comment here about this application. This for me represents more than just a way of listening to your favorite on-line radio station or viewing the BBC World Service broadcast. RealPlayer represents the difference between stations having a choice to "webcast" freely or having to kow-tow to Microsoft. It looks like Gates and Co. plans on dominating the on-line music/information industry. Real Networks is at this point the only thing preventing them from doing it.

Now that I've finished my editorializing, you can go get RealPlayer for Linux and install it and start listening to web broadcasts.

XMMS

XMMS stands for the X multi-media system. If you're familiar with WinAmp, you'll have no trouble getting used to this program. You can listen to your favorite MP3s plus files in the newly emerging free Ogg Vorbis format.

Image viewing and editing

The GIMP

GIMP stands for GNU Image Manipulation Program. It should never be associated with the English word meaning lame. Gimp also has another meaning, according to the dictionary I consulted: Smart; spruce; trim; nice. That's a better description. This is a full fledged image creating and re-touching application. You can apply all sorts of filters and even write scripts for doing things to the images automatically. If you work a lot with images and think that by switching to Linux you'll be unable to work efficiently with graphics, then check out The GIMP. You'll be pleasantly surprised.

xv

In the words of the its author, John Bradley, xv doesn't stand for anything. I use this program all the time, literally. It is what I use to display the image in my desktop window.

type this:

xv -root -max -quit your_favorite_pic.jpg
and xv will display your favorite picture as the pic on your desktop. Sometimes I get bored and I use this script to rotate my favorite pictures.
#!/bin/sh

for i in `ls /home/mike/rotation_bkg/*.jpg`

do

xv -root -max -quit $i
sleep 300
done
If you're looking for heavy duty image software, xv is not it, however. This is the author's own words:
Basically, xv's primary thrust has always been displaying images (in many formats) quickly and nicely on a wide variety of display hardware.

That pretty much sums it up. xv is distributed as shareware.

ImageMagick

ImageMagick is a suite of tools for displaying and manipulating images. It's not as powerful (in my opinion) as The GIMP but more powerful than xv. I use it for three basic things. The 'display' tool I use to tell my email client open images that people send me in emails. Another one I use a lot is the thumbnail generator. If you've got a lot of images in a directory and you want to have an inventory of all of them as one image, then you would type:

display 'vid:*.jpg'

This creates one image of all of the jpg images as thumbnails in the directory you're in. This takes up a lot of CPU power on even a fairly powerful machine, so be patient. If you've got a lot of images in a directory and a slow machine, you might want to consider doing them in small batches.

This next use of ImageMagick is my two-year-old's favorite. I have some pictures of him in a directory and I type:

animate *.jpg

This starts up a slide show of him at blinding speed and he gets a big kick out of it. If you want to get the images rotating at a more manageable speed, just use the shift > keys or click with the right mouse button to call up the menu.

Text editors and viewers

Sometimes you don't want to fire up a whole office suite to read some text file and sometimes you have to create and/or edit documents as plain text. If you wanted, for example, to modify my image rotation script above, you would open up a text editor. There are two that I use on two different occasions.

Emacs

There is a version of Emacs if your not using X-window and then there's XEmacs, a version expressly written for X-window. I refer to the x-window version of Emacs, which is like the console version, but has clickable menus and windows and everything you need to work in a graphical environment. Richard Stallman, founder of the GNU project, first started working on Emacs in 1974. It has since then become the flagship application of the GNU project. It is truly the perfect application to be the one associated with the GNU. It is a Swiss Army Knife of editors. To call it an 'editor' is to insult it somewhat. It does a little bit of everything. To me, it's almost like a mini-operating system in and of itself. If you're a programmer, Emacs is essential for working. If I could not use Emacs for some reason, I would probably go off and herd sheep. (and if you think I'm joking, ask my wife). Even for non-programming tasks I use it. The entire Linux Online beginners' course (yes, the words you are reading right now) were written in their entirety using Emacs. That day in 1974 when Richard Stallman sat down and started development of Emacs is a great day in history.

xedit

xedit is a basic text viewer/editor for X-window. It was one of the first applications. It is not slick or fancy, but there is one thing I like very much about it. The ability to fire it up from an xterm with a couple of preferences of mine. Reading fairly long things on a computer is not one of my favorite activities. My eyes don't seem to like it either. With xedit, you can specify a readable font and some good eye-friendly colors when you start it up.

xedit -bg seagreen -fg navajowhite -fn 9x15*bold some_text_file.txt &

As we're on the topic of basic X-Window applications, you can use xcolors to get a background and foreground combination that suits your eyes. Use the right mouse button to select a font color and the middle button to select the background.

If you want to select colors (for example, for web page work) and you've got the GNOME desktop installed, you can use GNOME Color Browser. It's easier to manage that xcolors and has a nice grab feature to select colors from other places and get their values/names.

Miscellaneous Programs

root-tail

tail is a console application that is normally used for monitoring files that change constantly, like log files. root-tail can be used to display these files on your desktop while you're running X-window. I normally use this to remember important stuff. It really comes in handy. First, you should create a text file with your favorite editor. Call it 'reminders'. Then on each line, write something that you want to remember. Then, you run root-tail. It's best to do this with a few options. For example, this is how I run it:

root-tail -color yellow -font 12x24 -shade -g +10+100 $HOME/reminders &
Let's explain some of these options. First, after '-color' you should use the name of the color you want the text to appear in. Use xcolors to find a color you like that's supported by your system. The next one is '-font'. As you see, I've chosen a good sized one. '-shade' will give the text a little shade under it and will look snazzier. '-g' stands for 'geometry' or the location in the window. I use +10+100 which set it right in front of me. You can experiment with settings. Now you have no excuse for forgetting to buy your loved ones presents on their birthdays!

gkrellm

This is nice little application to monitor what's going on with your computer. You can keep track of you memory usage, swap space, how much bandwidth you're using through your ethernet card and much, much more. You can see it in this screenshot. It's running on the upper right side of my desktop. It's useful as a way to alert you to how many clueless Windows users there are. Invariably, when some Sircam provoked mail comes through, the 'eth0' monitor, which checks bandwidth usage will start rising for no apparent reason. If you do conversions of audio to MP3 or Ogg format, you can watch your CPU usage go off the scale when you do them. Place your mouse over gkrellm and press F1 to configure other monitors. There are also plug-ins and themes/skins available.

Xchat

xchat is a comfortable IRC (Internet Relay Chat) client. It's very easy to configure to your liking. There is the possibility to use Python and Perl scripts to automate some things you do.

A lot of programs to choose from

There are thousands of programs for Linux in our applications section. Have a look and we're sure you'll find the right programs to suit your needs

Office suites word processors and spreadsheets

Office suites, word processors and spreadsheets

StarOffice

StarOffice is a complete, full-featured office suite on the idea of Microsoft Office. It comes complete with word processor (of course), spreadsheet, database interfacing, presentation software plus it offers web browsing and email and a few other features. Originally developed by StarDivision, StarOffice was acquired by Sun Microsystems in 1999. The current stable version of this suite is 5.2 at the time of this writing. However, Sun has announced that they plan to charge for downloads of StarOffice version 6.

KOffice

KOffice is the KDE Project's offering for desktop productivity. It includes all of the standard office suite applications. The software is offered free of charge.

VistaSource's Anywhere Desktop for Linux

This suite was formerly known as ApplixWare. Once again, all the standard office suite tool are offered here. This one boasts a Microsoft Office look and feel. This is not a free product. It cost 99 US dollars at the time of this writing.

Siag Office

Don't let a name like Pathetic Writer dissuade you from checking out this office suite for Linux. The word processor part of the suite can open Microsoft Word format (*.doc) files. The project started with the Scheme in a grid spreadsheet. Now you know why it's called Siag. Another free offering in the office category.

HancomOffice for Linux

Hancom Linux of Korea has developed this commercial full-featured office suite for Linux. Provides compatibility with Microsoft Office formats and smooth integrating into the KDE desktop. An evaluation version is available for download, but the software must be purchased in order to continue to use it.

GNOME Office

GNOME office should actually appear in quotes, because this is not an office suite in the classic sense, but a set of applications that are often associated with office suites, as a package deal, so to speak. Some of the high-lights include:

  • Gnumeric, a spreadsheet application
  • AbiWord, a word processor (it even runs under Windows and MacOS)
  • Gnucash, a personal finance manager
  • GNOME-DB, database connectivity software

If you download the Ximian Desktop, you'll get these applications plus the other productivity tools associated with the GNOME project.

x-window email client of linux

Email clients

The program you use to get, write and send your email is often referred to as a "client". This is to distinguish it from the programs that sit on servers that receive and process emails either sent to or sent from you. Email has become so important in our everyday life that I have observed that advocating one email client over another often takes on a fervor usually associated with religious beliefs. Here we'll look at some of the major email clients for Linux.

Evolution

Ximian's Evolution, part of the GNOME desktop project has received a lot of press lately. It is shaping up to be the only serious challenger to Microsoft Outlook's domination of the groupware scene. Seeing that it has all the features of Outlook, sans the virus problem, then you can see why it's getting some notice. If you're looking for a good email client that comes with scheduling tools, task management, address books and all those things that the busy yet organized person needs, than Ximian is probably the thing for you.

Kmail

Kmail is KDE's major email client. It is not a complete groupware solution like Ximian's Evolution, but its email management capabilities are very powerful. There is support for all major types of email transport, intricate configuration of mail filters, complete support for HTML formatted mail and other useful features.

Sylpheed

Japanese developer Hiroyuki Yamamoto has developed this fast, easy to use full-featured email client. This client is a big hit with developers as it offers really nice threading (the ability to keep track of all mails based on one original mail) and a fairly good way of managing different email accounts. If you have to respond to mail in different capacities (boss, friend, worker), Sylpheed offers the tools to do this all in one client.

Mutt

One of the most famous quotes in the Linux world is the one found at the top of the home page for Mutt: All mail clients suck. This one just sucks less.. This was said by Michael Elkins, who developed this email client. A lot of people will probably point out, and rightly so, that Mutt doesn't have a graphic user interface. That is true. However, this client is so popular in the Linux world that I just had to include it here. If you are a newcomer to Linux, you may not want to use Mutt just yet. Using it efficiently requires a well-written .muttrc file. This is the main configuration file that determines how Mutt is going to work. However, if you get used to Mutt, you are probably not going to ever switch. It's lack of a pretty interface is more than made up for by the ability you have to configure Mutt. After you have some months behind you working with it, emails will practically write themselves. If you handle a lot of email, this is the client you probably want to at least look into.

email clients for Linux Systems

Email clients

The program you use to get, write and send your email is often referred to as a "client". This is to distinguish it from the programs that sit on servers that receive and process emails either sent to or sent from you. Email has become so important in our everyday life that I have observed that advocating one email client over another often takes on a fervor usually associated with religious beliefs. Here we'll look at some of the major email clients for Linux.

Evolution

Ximian's Evolution, part of the GNOME desktop project has received a lot of press lately. It is shaping up to be the only serious challenger to Microsoft Outlook's domination of the groupware scene. Seeing that it has all the features of Outlook, sans the virus problem, then you can see why it's getting some notice. If you're looking for a good email client that comes with scheduling tools, task management, address books and all those things that the busy yet organized person needs, than Ximian is probably the thing for you.

Kmail

Kmail is KDE's major email client. It is not a complete groupware solution like Ximian's Evolution, but its email management capabilities are very powerful. There is support for all major types of email transport, intricate configuration of mail filters, complete support for HTML formatted mail and other useful features.

Sylpheed

Japanese developer Hiroyuki Yamamoto has developed this fast, easy to use full-featured email client. This client is a big hit with developers as it offers really nice threading (the ability to keep track of all mails based on one original mail) and a fairly good way of managing different email accounts. If you have to respond to mail in different capacities (boss, friend, worker), Sylpheed offers the tools to do this all in one client.

Mutt

One of the most famous quotes in the Linux world is the one found at the top of the home page for Mutt: All mail clients suck. This one just sucks less.. This was said by Michael Elkins, who developed this email client. A lot of people will probably point out, and rightly so, that Mutt doesn't have a graphic user interface. That is true. However, this client is so popular in the Linux world that I just had to include it here. If you are a newcomer to Linux, you may not want to use Mutt just yet. Using it efficiently requires a well-written .muttrc file. This is the main configuration file that determines how Mutt is going to work. However, if you get used to Mutt, you are probably not going to ever switch. It's lack of a pretty interface is more than made up for by the ability you have to configure Mutt. After you have some months behind you working with it, emails will practically write themselves. If you handle a lot of email, this is the client you probably want to at least look into.

Popular useful and important programs that run in X-Window

Popular, useful and important programs that run in X-Window

At this point you've chosen your window manager and/or desktop environment. Regardless of the "look" you've chosen, you have to have programs to run. You need applications to surf the Internet, write email, manage your files, write letters and a thousand other things you want to do. The rumors you hear about Linux lacking applications or not being able to "make it on the desktop" are false. There is no major application that a computer user needs that Linux lacks.

Internet/WWW Browsers

Netscape Communicator

The heavyweight of all browsers was one of the first to release a version for Linux. Includes an HTML authoring tool and full-featured email program. Comes with the standard plug-ins to view Flash animation and listen and see Real Audio/Video content. At the time of this writing, version 6.2 is available for Linux.

Opera

Billed as the "fastest browser", Opera Software of Norway released their first version of Opera for Linux in March of 2000. These early versions were not stable but the company kept working and released a finished Opera 5 for Linux. At this time, the company has released a beta version Opera 6 which offers plug-in support for Flash and Real Audio/Video. Their browser for Linux still doesn't have the same features as their flagship MS Windows version (like an email client), but it's fast and extremely stable and reliable.

Mozilla

Mozilla is the open-source version of Netscape. It is almost identical but the people in the Mozilla project have added some extras to it that give it a bit of an advantage over its "brother", Netscape, like being able to open new tabs (like Opera) instead of only having the open to open new windows. If you don't like cluttering up your desktop, this is a welcome feature. It also comes with all the support for plug-ins, Java and JavaScript that Netscape has plus the same email client and HTML authoring tools. It also adds an easy to use IRC (Internet Relay Chat) client to its extras.

Konqueror

Konqueror, part of the KDE project, is a file manager and Internet browser wrapped up into one. You can surf the net and manage your files at the same time. If you're migrating from Windows, you should find it very similar to Microsoft's Internet Explorer. Includes plug-in support as well as enabling for Java and JavaScript. You need to have KDE installed to run this.

Galeon

Galeon is the browser associated with the GNOME project. It is based on the Gekko HTML rendering engine that also runs Mozilla (this converts HTML into content you can read). This browser is essentially Mozilla (you actually need Mozilla to run it) modified somewhat to fit into the GNOME scheme of things. With the use of 'themes', the look is much more configurable than Mozilla itself.


Now, let's look at some popular email clients available for Linux

Protecting the environment in Linux System

Protecting the environment

Most computer users like to have a set of tools that they always see - things like a clock, a region that displays the date, a button that displays a menu with the programs available for you to use. People have become accustomed to an icon system that sits on a "desktop" that allows you, with a click of your mouse, to have your favorite program up and running or open a web browser to your favorite website. This usually goes beyond the call of duty for a window manager. In these cases you need the services of a "desktop environment". This is a uniform looking desktop interface which sits on top of and uses the services of a window manager. There are two major desktop environments, GNOME, which uses the services of independent window managers (at the time of this writing GNOME runs with Enlightenment) or KDE, which has its own background window manager, known as kwm

GNOME or KDE

The question: 'Should I use GNOME or KDE?' was a controversial one not so long ago. Luckily, now, it is just a matter of which interface you like more. The controversy stemmed around the KDE project which was founded in 1996 with the goal of creating a uniform desktop experience for Linux. KDE made the decision to use libraries to create the desktop interface which were not open source. The libraries in question, known as 'QT' are now open source, so the question is pretty much moot. However, at the time, the issue inspired a young Mexican developer named Miguel de Icaza to create a desktop interface known as GNOME.

GNOME was founded in August of 1997 and was an attempt to create a uniform desktop manager that was totally compliant with the GNU's General Public License, avoiding the licensing issues involved in the case of KDE's using the QT libraries. Miguel de Icaza and Nat Friedman founded Helix Code in 1999 to oversee the business end of developing the GNOME desktop. Helix Code later changed its name to Ximian.

What GNOME and KDE can offer

Both of these desktop environments offer a Microsoft Windows-like experience. To date, KDE is the only one of the two to offer an office suite for word processing and its own web browser. Other than that, both offer top-rate productivity applications like email clients, agenda and scheduling software and address books. They offer multi-media software for playing CDs, MP3s and other music formats. Both offer a large selection of games in addition to other sundry applications for system monitoring and other miscellaneous tasks.

Where to get these desktop environments

Most distributions come with both the GNOME and KDE desktop environments. However, if your distribution did not have this or you are reading this and have not yet installed Linux, you may want to check out both offerings.

You can also download the latest versions from their homepages.

Choosing the look that is right for you

Choosing the look that's right for you

In recent years, as Linux has become more popular, members of Linux community have tried hard to shake off the reputation, which I feel has always been unwarranted, that the graphical user interface for Linux is at best, boring and at worst, unmanageable. This is based on, of course, comparisons with the user friendliness of the omnipresent MS Windows and the well-deserved good reputation of the Macintosh OSes. After using Windows 95 from 1995 until the end of 1997 and testing various Mac OSes extensively (at one point using Mac OS 8 exclusively for one month - I was staying with relatives and needed to get some work done), I can safely say that Linux doesn't and probably hasn't had a reason to envy the other two major OS offerings in terms of graphic interfaces since about 1998. Graphic user interfaces under Linux are comparable with these other ones in just about everything and even enjoy some advantages. The major one over MS Windows is, of course, stability and security. The advantage over Macintosh is primarily cost related.

If you're reading this, then you've probably made the decision to try Linux. Before we talk about what your Linux desktop is going to look like, we should first talk about the difference between a window manager and a desktop environment.

Window managers

Most programs made for computers nowadays run in a graphic environment. However, it became apparent that these programs would be more efficient if they could take their attributes from a common source. This is what a window manager does. It decides how the window is going to look, the aspect of its buttons and frames. It determines how it is going to reacted when you click in it or you reduce it or re-size it.

There are more than two dozen different window managers available for Linux. The more popular ones make their way onto Linux distributions. They range from completely minimalist to well-engineered works of art. Here is a list of the ones that generally find their way onto the major distributions' CDs.

You can check out the above sites and find one that you like. The first one, FVWM, is my personal favorite. It is also the most minimalist of the one's I've listed here. This is, as far as I know, the oldest of the aforementioned as well. This is not meant to be an endorsement of this window manager. I just happen to like its minimalist approach and low memory requirements. I'd rather pass that RAM savings on to the really important applications running on my computer.

I have provided a screenshot (153k) of the my view on the world of Linux. * I have a menu item that links to a script that will place a new picture as the desktop image when I get bored of the one I've been seeing for a couple of days (or hours, depending on my threshold of boredom at the moment).

I have fun tweaking the configuration file. I think the main reason that a lot of people prefer other windows managers to fvwm2 is that the file that sets up your desktop menus and buttons and other things has to be worked on by hand. They really prefer the click-as-you-go configuration of other window managers. I happen to like experimenting and I am prone to change it once a month or so (depending on that threshold of boredom factor again). Fvwm2 is so configurable that if you got 5 different configuration files, known as .fvwm2rc, off the Internet and tried them out, you would swear that you're seeing 5 different window managers.

You can check out the .fvwm2rc file behind the above screenshot. I'd like to acknowledge that the main file was written by Jay Kuri. Thanks Jay, wherever you are. I also included some tweaks that I got here and there. The main buttons you see are from Eric S. Raymond's (author of The Cathedral and the Bazaar) .fvwm2rc and modified slightly.

Of course, everyone is not into tweaking and prefer a more "clickable" configuration. Peruse the offerings out there and choose one that suits your needs. You may also want to hold of on the window managers for a bit and read the next section. We talk about desktop environments, the ultimate user-friendly GUI experience for Linux.


*There's a neat application called gkrellm that keeps track of a lot of things that are going on with the system besides displaying the time and date. MS Windows users should take note of the uptime (last time of reboot) of 27 days, 21 hours. We had a power blackout that lasted about 3 hours while a transformer in my neighborhood was being fixed. Previous uptime was 31 days. I don't remember what happened 31 days before that.

default booting option inittab

To boot or not to boot (in graphics mode), that is the question.

Before we start talking about the different windows managers and desktop environments that are available for Linux, let's first see how our bare-bones X-Window setup is working. Some X programs don't need a windows manager to run, so let's try a simple experiment with one of them. Type this in your terminal window:

xinit /usr/X11R6/bin/xedit

This will fire up a simple text editor called 'xedit'. You can try writing something and pushing the buttons. When you push 'quit', you'll notice you go back to your standard terminal. Try the same with an x-terminal:

xinit /usr/X11R6/bin/xterm

Type in a few commands. Then type 'exit'. Your x-term session ends and your back in your terminal.

There isn't any practical reason to use X-Window in this way. It's better to use its powerful capabilities with a full-featured windows manager and desktop environment.

Before we go on to talk about choosing a windows manager that suits you, we should talk about how you want your computer to boot. Do you want it to go directly to a graphical environment or do you want your machine to boot into text mode where you would then issue the 'startx' command? If you want graphics mode right away, then you need to have a program like xdm, which will start your windows manager of choice, or 'kdm' or 'gdm' which will start KDE or GNOME, two desktop environments that we'll talk about a little later.

The decision to startup graphically is made when you first install Linux. If you found that you've changed your mind; that is, you now want to startup graphically or vice-versa, you can usually change this with your distribution's tools.

You can change the start-up behavior by going to your /etc/ directory and changing a file. The file name will depend on your distribution. With SuSE, for example, it is the file called rc.config. You should change the line:

DISPLAYMANAGER=""

to:

DISPLAYMANAGER="xdm"

You may also use 'kdm' or 'gdm' here. Make sure that your CHECK_INITTAB setting is "yes"

In the case of RedHat and RedHat based distributions (Mandrake, KRUD), you'll need to change the file /etc/inittab. In the line: id:3:initdefault:, the number 3 needs to be changed to a 5

As I mentioned, if you want to do just the opposite, change the default graphical login to a text mode login (something which I recommend), just reverse all those changes above. If you decided not to use a graphical login, you may want to un-install 'xdm' (or gdm/kdm).

Well, now that we're clear on whether to use a graphical start-up or not, let's explore some of the possibilities for your Linux desktop.

X-Window configuration of Linux

X-Window configuration

In Linux days of yore, it used to be quite a task to get X-Window running even on a standard Intel type PC. Now all of the major distributions have their own tools to get X running in no time.

SuSE offers a program called Sax. This is about the most user-friendly program I have yet encountered for X setup. It is graphical, so the simple fact that you can run it before you've even start configuring X is a good sign.

Mandrake offers their X configuration right in the install package so you go from start to finish all in the same package.

However, given a situation where your X setup doesn't go smoothly, you can do this this step by step, in text mode, with a program called xf86config. This is a last resort and will almost always get you good results.

This program asks you questions about your peripheral hardware, like your keyboard, mouse and monitor. Here are a couple of examples of what it looks like:

screenshot1

screenshot1

The most important questions that this program will ask you about your hardware are the ones about your monitor. I don't mean to imply that the others are not important. For example, if you don't answer the type of questions about your mouse correctly, your mouse won't work. Or if you don't enter the country/language values for your keyboard layout, you may not be able to use letters or symbols that exist in your native language. That is obviously important. However, if you don't enter the values correctly for the type of monitor you have, your monitor can get seriously damaged. If you enter the vertical and horizontal refresh rates incorrectly, your monitor will become just another useless piece of plastic and glass, like so many others waiting to be thrown away or recycled. It's beyond the scope of this lesson to explain what the vertical and horizontal refresh rates mean (actually, it's the horizontal one that's a real stickler) but trust me - you need to go get the manuals for your monitor and enter the real values when it asks you. If you don't believe me, this is what xf86config says

It is VERY IMPORTANT that you do not specify a monitor type with a horizontal sync range that is beyond the capabilities of your monitor. If in doubt, choose a conservative setting.

At this point in the configuration, you can choose option 11 and enter your own values from the monitor's manuals and you'll be sure to get the correct settings.

Once you have passed this point, the questions are more straight forward and errors have less grave consequences.

In the past years, as I mentioned, major Linux distributions have streamlined this process so you probably won't even need xf86config. But it's nice to know you have it there, especially if your hardware is proving to be less than cooperative.

The GUI family tree

The GUI family tree

Without getting into a lot of technical jargon, in order for those nice windows (yes, with a small 'w') to appear on your computer screen, you have to have some graphics libraries installed on your computer. These libraries determine how a window is to appear, what it is supposed to look like and what the buttons and menus are supposed to do. That fact that you can use GUI based computing under Linux goes back to the time before Linux was even thought of. In the mid-eighties at the Massachusetts Institute of Technology they came up with the X window system. By 2002 standards it was a primitive GUI system to run programs with. The main idea behind this actually came from an earlier project at Xerox called WIMP (Windows, Icons, Menus, Pointer), a project that essentially started the idea that computers could be used in an attractive graphical environment. 1

The 'X Window system' provided the libraries to make the frames, buttons and menus that make up a window. Development of X Window still continues under the auspices of the X Consortium. In 1992 the XFree86 Project was started. This aimed to develop a free version of the X Window System. There have been several versions of XFree86 and the current stable version at the time of this writing is XFree86 4.0. Though there are other equivalents to the libraries that XFree86 offers, it is by far the most widely used window system under Linux. Any attempt at using Linux as a desktop operating system to get "productive" work done (word processing, spread sheets) or to entertain oneself (play games, listen to music, watch TV) will start with the installation of XFree86.

With major distributions, the install process takes care of getting XFree86 on to your system. There are two parts to this. One is installing XFree86 itself. The other is installing the X server that goes with your particular hardware. The X server is just the means of getting XFree86 to work with the graphics card that you have in your computer. For example, if you have a graphics card from ATI, then you would install the XFree packages along with the X server package for ATI. If you have an S3 card, then XFree86 and the X server for S3 cards should get installed. I explain this because some distributions do a pretty fine job of getting you up and running, but you may get asked what graphics card you have when you do a more interactive type of install of Linux. In this case, you have to know what card you have so the correct X server gets installed and you can have a graphical environment to look at after the install process is finished.

Recently, major Linux distributions will also offer you the possibility of getting right into the GUI when you turn on your computer. This is done by way of the program XDM. This is the Microsoft Windows influence on how things are done that I mentioned before. Traditionally in Linux, you would turn on your computer and get the black screen and the command prompt. Then you would type:

startx

and your graphical environment of choice comes up. 'Choice' is the key word here. By having the command prompt and then issuing a command to start the GUI, you can switch into any number of desktop environments "on the fly". Of course, if you're not interested in having more than one, then you can use XDM and have your favorite desktop there waiting for you.

Regardless of the way you choose to start up your machine, before you see your desktop utilities of choice, we're going to have to configure XFree86 to use your monitor, mouse and keyboard. That is, whether you type startx or not, we'll have to come up with a configuration so we can, in fact start X.

1 The X Window User HOWTO by Ray Brigleb, 1999

Graphic User Interfaces with Linux

Graphic User Interfaces with Linux

Some preliminary commentary and perspective

As much as I like Linux and think that it is the best operating system out there today, most people who use computers equate Microsoft with computing. In particular, the only computing environment that most PC users have ever seen comes in the successive versions of their flagship operating system Windows(tm). However, computer scientists and people who have an interest in computers beyond the mere end-user stage know that graphic user interfaces or desktop environments like Windows really represent the look and feel of the computer experience, but not the experience itself. Windows has become famous for essentially blurring the reality of what a computer really does. That is to say that Microsoft Windows, especially since the release of Windows 95, has masked any trace of the traditional "black" computer screen experience. It was still there - you just couldn't see it unless you purposely looked for it.

Bill Gates, chairman of the Microsoft Corporation once stated that: "Linux is 1960's technology with a new development model". What does he mean by this? I think basically that he bet his whole company on the assumption that people didn't want to see the traditional black screen and the command prompt anymore. The sales of Windows 95 proved that with a good marketing campaign he was able to sell the idea that people didn't want it and people responded. Then Linux started to gain in popularity and be noticed by a certain segment of the public around 1998-99. The problem was that Linux offered the black screen and the graphic user interface as a separate package. Bill Gates had already established that this was a no-no and so Linux gets chalked up as "retrograde".

Now it's 2002 and Linux still offers the black screen and graphic user interface separately. But then again, a lot has happened since 1998. For one, IBM has spent 1 billion US dollars on Linux and essentially gotten its investment back. Linux's market share continues to rise. It still pales in comparison with Microsoft's desktop popularity - so much so that as most everyone knows, Microsoft was convicted of being a monopoly in restraint of trade. Then again, in 2000 and 2001 successive email viruses and worms crippled Windows-based IT departments and brought scores of corporate networks to a grinding halt. Why? Because we're in a new world of connectivity. Bill Gates' comment about Linux may be turned back now upon his own company. If you asked your average Linux enthusiast what he or she thinks of Windows, you might get this reply: "Windows is pre-Internet technology with a slick new marketing campaign". Microsoft spends most of its days now fighting security brush fires because in blurring the difference between the operating system and the graphic user interface it sacrificed security for ease of use. Windows development model was conceived before everybody's computers where connected to each other and it continues to reflect that. Linux, however, was born on the Internet and grew up with it. Unfortunately, more complaints about Linux's perceived lack of user friendliness outnumber complaints about Windows being essentially a Maginot Line solution for secure computing. Hopefully in this lesson on graphic user interfaces under Linux, you'll get a good idea how the balance between user friendliness and security is a good one with our favorite OS.

Ogg Format in Linux

Ogg format

Due to the restrictions on the use of MP3 technology, Ogg Vorbis is a good way to enjoy digital music in a compressed format. Though it is associated more with the Linux and Open Source world, both Windows and Macintosh ports of the Ogg libraries are also available. This is proof of its growing popularity as a digital music format. There are even companies now using Ogg format for sound in their games. You can read the latest news on the status of the Ogg Vorbis project at their website.

Installation of the Ogg libraries

First, in order to listen to and make files in Ogg Vorbis format, you should to go over to the Ogg Vorbis website and download some packages that are needed: libao, libogg and libvorbis These are the actual libraries that do the compression and decompression of the sound. The command line software for coding and playing the *.ogg files can be found in there as well, in a package called Vorbis-Tools. Included in this last package are the programs oggenc and ogg123. These are designed to work in the same way as the packages bladeenc and mpg123 in the MP3 world. Their command line options are essentially the same.

Before you actually visit the site and start downloading, if you have bought a boxed set of a major Linux distribution recently, you should have these libraries included on the CDs and be able to install this painlessly with your distribution's installation tools. If you got your CDs from your cousin Larry with "Redhat" written on them in magic marker, then feel free to go over and download the RPMs at www.vorbis.com and install them, as you remember from our lesson on RPMs.

rpm -i libao-[whatever's current].i386.rpm
rpm -i libogg-[whatever's current].i386.rpm
rpm -i libvorbis-[whatever's current].i386.rpm
rpm -i vorbis-tools-[whatever's current].i386.rpm

Note: Don't get the source RPMs (the one with 'src' in the title). You won't need those if you're running Red Hat or any RPM based distribution (like Mandrake, KRUD etc.). Also, install in the order I have given you above and do this as the 'root' user

If you've got some other distribution like Slackware that works better with tarballs than RPMs (or if you are feeling adventurous/masochistic, then get the files ending with *.tar.gz (the tarballs). Un-zip and un-tar them and read the readme and/or install files which will instruct you how to get those packages installed and working. I took this from libogg's own README file:

./configure
make

and optionally (as root):
make install

I guess you get the idea. Now let's see what we can do with these libraries and programs to get some nice sounding *.ogg files.

MP3 Play in Linux Systems

MP3 format

If you've touched a computer in the last couple of years you've at least heard about the MPEG layer 3 format, popularly known as MP3. You have probably listened to an MP3 and you may have even "ripped a track", that is, made an MP3 file from a song on a CD.

MP3 has become somewhat controversial. In light of the Napster case, sharing MP3 files has opened up a Pandora's Box of questions about copyright, fair use and intellectual property. This really isn't the place to debate those questions but there are some issues related to the making of MP3s that concern Linux, Open Source and Free Software in particular.

We'll talk about the programs available to make sound files in MP3 format, but I should point out that MP3 is a non-free format. That is to say, the Fraunhofer Institute and Thomson Multimedia developed MPEG Layer 3 technology and they hold the patent rights it. If you want to write programs that encode and/or decode MP3 format, you have to pay licensing fees. Thomson has set up a website to talk about these issues, if you're interested. What does this mean for Linux? Well, if you are an advocate of the Open Source and/or Free Software model that Linux grew out of, MP3 might be seen as a format to be avoided. Actually, if you think this way, you now have an alternative with Vorbis' *.ogg format. We'll talk about that shortly. But being that MP3 is so prevalent nowadays and encoders/decoders do exist for Linux, we'll talk about making and playing MP3 files.

Let's go back to our "reminder" system. If you go into the /reminders directory we created (cd reminders) and type:

ls -l *.wav

you'll see that the default quality of a 5 second recording gives us a file of about 1/4 megabyte. If we made the file a little better, as I do when I'm working with sample sentence for language learning, you doubled the file size to just under half a megabyte each. To check this, I made one of each format:

-rw-r--r--    1 mike     users      132344 Nov 27 12:11 0intro.wav
-rw-r--r-- 1 mike users 220544 Nov 28 08:37 2001-11-28_fair.wav
-rw-r--r-- 1 mike users 441044 Nov 28 08:34 2001-11-28_good.wav

If for some reason you wanted to keep these reminders, files of this size would quickly begin to take up space. Disk space is cheap, but there's no reason to occupy space if we can compress it. We could take out our tools gzip or bzip2 that we learned about in a previous lesson. 'bzip2' will actually get the file down to about half its original size:

-rw-r--r--    1 mike     users      206442 Nov 28 08:34 2001-11-28_good.wav.bz2

But there is a much better way of doing this, for now, by converting it to MP3 format. Look what we get for the same file as an MP3:

-rw-r--r--    1 mike     users       80234 Nov 28 08:48 2001-11-28_good.mp3

You've got it down to about one fifth of its size. And you can hear it right away with an MP3 decoder/player. Let's show how we did this.

First of all, you need a program that converts *.wav files to MP3 format. There are a few of these available for Linux. One of these, and probably the most popular, is Tord Jansson's BladeEnc. He's had some trouble with the MP3 patent holders so, again, we've stepped into controversy here. How do we avoid bringing patent holders' wrath down upon ourselves? Well, by going over to Fraunhofer's website and getting a demo of their MP3 encoder, appropriately called 'mp3enc' (the demo is actually called 'mp3encdemo' - very logical) we can convert these files in MP3 format. That will at least give us an idea about how all this works in Linux.

You'll get a *.tgz (Slackware package) compressed file. Just unzip and untar in your home directory:

tar -zxvpf mp3encdemo.tgz (or whatever the current file is called)

There is a pre-compiled binary (aka - program that works right away) and some documentation (manual, other README files). There is a section in the manual that says "For the impatient". Being impatient by nature, I went right to that and found out how to convert my *.wav files to acceptable quality MP3s. Now, we're lucky that our reminders aren't very long, because the generous Fraunhofer people have given us a demo that only encodes 30 second long files. I know what you were thinking. You were going to run next door and borrow the neighbor's "Greatest Punk Love Songs" and start rippin'. We'll you're out of luck unless you want to do a medley. At any rate, the Fraunhofer demo will do nicely for learning purposes. To use the program, just pick one of the reminders and type:

mp3encdemo -br 128000 -if 2001-[whatever].wav -of 2001-[whatever].mp3

where [whatever] is the date of your reminder. Let's look at these options. -br stands for bitrate This is 128 kilobits per second and you'll get an acceptable, almost CD quality file. -if stands for "if it works" - naah - that's only a joke. (I couldn't resist). -if means input file, that is, the file your inputing or feeding to the encoder. Logically then, -of means output file, the MP3 file you're going to get. There you have it. Feel free to encode any files you want. (as long as they're under thirty seconds, of course)

Actually any MP3 encoder for Linux that you can find out there works in basically the same way. You input a *.wav file with some options and you get an MP3 file. The program BladeEnc that we mentioned before, behaves similarly and there is no 30 second limit. (wink, wink, nudge nudge, and the author begins to whistle nervously)

Playing MP3 files

OK. Now we have our MP3 file. That begs the question: How can I hear it? Well, we need an MP3 decoder and/or player. I say "and/or" because these could be two different things under the x-window system. Popular graphic MP3 players are actually front-ends for MP3 decoders. That means they provide a graphic control panel for using a program that you don't really see. That's why I usually use the command line programs, as I mentioned earlier. So let's save some CPU power and learn how things work in the process.

'mpg123' is a very popular command line program for playing MP3 files. It is also highly versatile. You can create playlists and play songs in alphabetical order or in random order. You can even play little tricks and create weird disco versions of songs. (no kidding) You can even "reverse engineer" the MP3 file or even parts of it back to *.wav format. As far as I have tried, most graphic programs can manipulate playlists and add an echo effect but can't take full advantage of mpg123's features. You can only do it on the command line.

Anyway, 'mpg123' comes with most major distributions. If you visit mpg123's home page you can find out all about it. You can also get source code and RPMs if you don't have it installed already.

To simply play an MP3 file, enter the directory where the files are and type:

mpg123 your_mp3_file.mp3

Let's say you already have a lot of MP3s. You may have gotten some ... then again, I don't want to know where you got them. You could random play them

mpg123 -z *.mp3

One of my favorite things to do is to create a playlist. Here's how I do it. This will be good review practice for the command line as well.

First, I enter a directory where I have MP3s:

cd classical

Then I see what songs I have:

ls *.mp3

Then I pick out some songs that I particularly like and make a file that is going to be my playlist:

ls -1 Mozart_nightmusic.mp3 > favorites

The command 'ls' with the option '-1' lists the file name without any other information. The > symbol as you remember from our lesson on pipes, etc. creates a file called 'favorites' and includes the 'ls -1' output in it. To add more songs, we would repeat the same command, but this time we would (obviously) change the MP3 file name and most importantly we would change the one > symbol to two >> symbols. This way, we just add to the playlist file and we don't overwrite the file as would be the case if we didn't use two >> symbols.

ls -1 Beethoven_fur_elise.mp3 >> favorites

So I'd just keep adding songs until I had a nice playlist. To see the list, you'd just type:

less favorites

If everything is satisfactory, then we can play these songs. Just type:

mpg123 -@ favorites

The email (@) symbol tells mpg123 to look for the playlist. That would play the songs in the order they are on the list. If you want to play them in random order, you would just add a -z before the -@ option

More fun with mpg123

Let's say you wanted to play "Name That Tune". Don't laugh! I have done this at parties. You know, you only play so much of a song and the people have to guess which one it is. Well, with mpg123, you're all set. This command will only play the first 50 "frames" of a song:

mpg123 -k 0 -n 50 Mozart_nightmusic.mp3

And you'll have the liveliest parties on your block! All courtesy of Linux and mpg123! Seriously, the -k option tells the program which frame to start at and then -n option indicates where it should stop. Pretty easy!

You want more party ideas? Well, how about doing Techno-Mozart? That's easy too. Just type:

mpg123 -d 2 Mozart_nightmusic.mp3

This will make the program skip over every 2nd frame. That is, it will play a frame and skip one. This is *not* the Chipmunk effect. You will hear the same tone of voice because this doesn't effect the sampling rate of the file. It will just sound "techno" as I pointed out. Even though I mentioned parties and that, I have used this program and this effect in my language work for purposes of "serious" study. As the rate of the voice is not altered, you can change the number and see at what point people can't understand something. By this, you can test the aural skills of a person learning a language. By the way, you can also do the opposite by changing the -d X option to -h X. Instead of skipping frames, mpg123 will play the same frame X number of times. Remember, these options do not produce the "slow-mo" or "Chipmunk" effects. It just slows down the speed of playback.

As we mentioned before, you can also "reverse engineer" the MP3 file back to a *.wav format. Remember, before you try this at home, the *.wav format is at least 5 times bigger, so make sure you've got plenty of hard disk space.

mpg123 -w Mozart_nightmusic.wav Mozart_nightmusic.mp3

You can also use the different options like -d or -h combined with the -k and -n to produce weird *.wav sound effects files. Your imagination is the limit. If you do want to do techno-multimedia things with mpg123, you can use the -v option to get complete information about the track your playing.

Well, after all that is said and done about MP3, I must confess that I don't like working with MP3s as much as I like working with the new, free (as in beer and source code) Ogg Vorbis format.

Recording Sound in Linux

Now that we have our sound card working, it's time to check out some of the options that we have for playing sound. If you're following the course in order of the lessons, we haven't begun to talk in depth about the use of the X-window system in Linux, so the tools for playing and recording sound here will be used from the command line.

I'd also like to add an editorial comment, if I may. I use a window manager but the programs I listen to CDs, MP3s etc. are command line applications. I am not implying that there aren't some fine programs for playing and recording sound. There certainly is some nice stuff out there. The programs I use (which we'll talk about here) are great applications that work just as well as their graphic counterparts but in many ways are more easily configurable, at least for me. Besides, we're talking about sound, so I just have to set the CD or playlist and listen. I really don't have to see anything.

Recording Sound

Due to Microsoft's monopoly on operating systems (yes, they have been convicted of this in a court of law), the most popular format for sound recording is is their *.wav format. When you make a recording of yourself or someone else speaking or you "rip" a track from a CD for later conversion to mp3 or ogg (we'll talk about this new and open format later), you're probably going to use the *.wav format. If you simply want to record yourself saying something using Linux, all you need is a microphone and and recording tool that gives you a file in this format. For this lesson, we'll use 'wavrec'.

'wavrec' is easy to use. It's easy because the default recording settings for this applications are all acceptable for getting a quality recording (if you've got a fairly good microphone). You just have to type some simple commands and you're all set.

Here's an example:

Let's say I want to record a note to myself that says the following: "Note to self: make sure you respond to Dave's email about SuSE'. I would just type the following"

wavrec dave_note.wav

make sure the microphone is on (you'd be surprised how many times I forget to turn it on!) and start talking. The default recording time for 'wavrec' is 10 seconds. That means, if you don't specify a recording time on the command line (I didn't) you'll get a 10 second long sound file. My sentence above, "Note to self ..... bla bla bla" lasts about 8 seconds. Of course, the duration of the sound file depends on whether you're talking a normal rate. If you auction cattle in Iowa, then you probably don't need 10 seconds to say that sentence, so you should modify the time for the file, like this:

wavrec -t 3 dave_note.wav

The -t option refers to seconds, so you should type the number of seconds after. Here, even 3 seconds might be pushing it for a cattle auctioneer. Just remember to give yourself enough time for what you want to say, in seconds. If you want to recite Abraham Lincoln's Gettysburg Address, then you would first multiply 60 and 2 to get 120 seconds. Why this figure? Because Lincoln is reported to have taken only 2 minutes to give this famous speech. If you would like to record Cuban leader Fidel Castro's speeches, then I would advise getting a huge hard drive. He once made a speech that lasted 7 hours.

You can add all kinds of options to wavrec. I use this tool all the time to record short sentences for use in computer assisted language learning. Here are the values I use:

wavrec -S -t 5 -s 44100 a_sentence.wav

Let's explain these options. The first one, -S, means stereo. If you look at the man page for 'wavrec' (type: man wavrec), it says that stereo is the default. Nevertheless, I have noticed that mono is in fact the default. That is to say, if you use 'wavrec' with no options, you get mono not stereo sound. It would seem there is an error in the man page. After the -S, we have the -t option for seconds (we explained before) then we have the -s option which is the sampling rate in Hz. I chose 44100 because this is a good high-quality sound which is necessary for my language teaching endeavors. It's important not to confuse the -S (capital letter) with the -s (lower case). -s takes a value in Hz while -S has no value. I have purposely put the -t option in between them to avoid confusion. There you have it. Issuing this short command and then changing the file name, I get a lot of work done because my sentences seldom last more than 5 seconds and these values are fine for my work.

Now, you must be asking the question: "I've made a *.wav file, now, how do I hear it?" The answer is easy: With 'wavrec' 's companion program, 'wavplay'. Here's how:

wavplay a_sentence.wav

This will play the sentence we recorded above. That's all there is to it. I should also point out that the same options in 'wavrec' are available for 'wavplay' if you want to add some effects to playback. For example, if you take our first wav file, dave_notes.wav, and play it like this:

wavplay -s 44100 dave_notes.wav

you'll find it's doubly fast. That's because our note about Dave was recorded at the default 22050 hz, so if you do the math, you see that what we've done is double it's sample rate . You might want to do this:

wavplay my_favorite_song.wav

then sing a line of your favorite song. Play it back to your friends using the -s 44100 option and have them rolling on the floor with your Alvin and the Chipmunks impressions. I have actually entertained my 2 year old son for hours with this.

Using the same logic, if you take our a_sentence.wav and play it like this:

wavplay -s 22050 a_sentence.wav

you've cut the sample rate in half and so you get a really cool impression of the creatures that take over people's bodies in Star Trek's original series episode 'The Lights of Zetar'.

I know what you're probably thinking. I need to be productive. I don't want to record Chipmunk sounds and sci-fi weirdness. Well, then. Here's a good way to use these tools, plus a couple of other command line tools to read reminders to yourself in the morning, or whenever you'd like. First, create a subdirectory in your own directory /home/[you]/

mkdir reminders

then go into reminders (type: cd reminders). Now, Let's create a sort of introductory wav file that's always going to be there. I'll explain why we need that in a bit.

wavrec -t 3 0intro.wav

Say something like "Your reminders" or "Reminders for you". Three seconds should be enough for that. You may have noticed that the name begins with zero. That is simple because for our reminder system, we invoke 'wavplay *' with the asterisk to play every file in that directory. By naming it '0intro.wav', that assures that it will be played first with our system.

Now record some reminders. I recommend using a YEAR-MONTH-DAY format plus some meaningful word for naming the wav files. For example, type:

wavrec -t 5 2001-10-24_trash.wav
and say: "Remember to take out the trash". I suppose 5 seconds should be enough to say this. Try recording a few more reminders for different things, like "call cousin Jack" and "remember to pay back gambling debts to bookie". When you've got a few wav files in there you should play them to see that they've come out all right (you don't need to do this every time - we're just practicing)
wavplay *

You'll see that the 0intro.wav file gets played first. If everything sounds good to you, then we're ready for the next step which is to play our files automatically at a given hour.

One of my favorite applications in Linux is called 'cron'. This is a pretty powerful tool that is used primarily by system administrators to automate their tasks and duties. It's powerful because it can schedule something to be run automatically at any time, whether that be once every three minutes, every hour, once a day or every Thursday. It can even be used to run a job that you do only in January. But just because it's powerful, it doesn't mean it's complicated to use. For our purposes, it's very simple to configure 'cron' to play our reminders. First, we have to edit a file that is called 'crontab' and add our instructions. There is a system-wide crontab file for root's exclusive use, but there is also one available to every user to run command line apps that he or she is authorized to use. To add a job to be done, just type:

crontab -e

Then we add the following line to our crontab file (-e is for edit)

30   7   *    *    *  /usr/X11R6/bin/wavplay $HOME/reminders/*.wav

The crontab edit procedure uses your default command line editor which is probably 'vi', so if you don't remember our little tour of 'vi', just press 'ESC + i' before you add this line.

Let's explain how a crontab file works. The file is read by the program 'cron' and it carries out the instructions in it. In our example, our wav files get played at the 30th minute of the 7th hour, that is to say 7:30 in the morning. This is because the crontab file must start with the minute [0-59] you want something done, followed by the hour [0-23] the day of the month [1-31], the month of the year [1-12] and the day of the week [0-7] (where 0 and 7 are both Sunday). I have left the last three as asterisk. This tells 'cron' that these values don't matter. That is to say, cron should play our *.wav files every day of the month, every month of the year, 7 days a week.

The next step as you can see is to tell cron to run 'wavplay' and play the files in your home directory. We use the symbol $HOME for that. Also notice how I have put the exact path to where wavplay is. To see if your system differs, then type:

which wavplay

to show you where the program is. Then adjust accordingly. I used this exact path because, it would seem on my system, the master crontab file (found in /etc/crontab ) doesn't recognize that path automatically. I am assuming that this is for security reasons, so I didn't go in and change the path. Some things are probably best left alone, so no harm done if you just put in the exact path in the crontab file.

If you want to test it, just give it a time within a couple of minutes or so. That is, if it's 3:30 in the afternoon, you might want to first edit your crontab like this:

32   15   *    *    *  /usr/X11R6/bin/wavplay $HOME/reminders/*.wav

that will play the reminders at 3:32 PM, to show you that it works. Just make sure you're not playing anything else, like MP3s, because you won't hear them. That's the rationale for my 7:30 AM start time. It's a good hour for me - when I am just getting to work and I'm probably not listening to heavy metal at that hour of the morning. Actually, I never listen to heavy metal.

Now, when you've finished hearing them, you can delete them (if you want) That's where the rationale behind the YEAR-MONTH-DAY.wav comes in. You just delete the daily ones by typing, for example rm 2001-09-28*

That keeps the 0intro.wav file in there. I mentioned before that I was going to explain why it's necessary to have it there. 'Cron' will mail you when there is an error, so if you had no reminders for a given day, you would at least have one file in the /reminders directory. That way, 'cron' doesn't have to mail you an error message because the program 'wavplay' didn't find any *.wav files.

By deleting the unnecessary reminders, you've got some free disk space. Speaking of that, if free disk space is something that worries you, in the next part of the lesson we'll talk about those famous (and controversial) files that take up less space - MP3s - and how to make them under Linux. We'll also talk about the new free audio format comparable in sound and space to MP3 - Ogg Vorbis.

Getting Linux to make sounds

Getting Linux to make sounds

The hills are alive....

If you're like me, the first thing that interests you in setting up your computer is making it play sounds, particularly music. When I installed Slackware so many years ago (1997 seems like an eternity for Linux) I think I was more interested in making my sound card work than making the modem work to get connected. Music has always been pretty important in my life long before the World Wide Web even existed, so that was pretty logical.

Sound Cards

When I bought my first sound card in December of 1992, it came in a big box that Creative Labs sold me and it was a Sound Blaster. In that big box there was a bunch of stuff - software (for Windows 3.1), a CD-ROM drive (with an insert-able cartridge that my 2 year old just managed to break after all these years!) and some Midi gadget which never interested me and is still in the same box in my attic. I had good luck with that sound card (I still do because it still works). Due to this, I have always bought Sound Blaster cards. These cards have usually configured fairly easily under Linux. I was once bought a machine that did not have a Sound Blaster brand card in it and I was not able to get it configured under Linux. I honestly don't remember the name of the card and I promptly paid a little bit more money and exchanged that one for a real Sound Blaster and quickly got it running under Linux.

Sound Blaster uses the Alsa drivers to make sound come out of your Linux machine. These people have made my life much richer as I can listen to lovely music as I write this lesson of the beginner's course. There are a lot of other supported cards. My eternal gratitude to the people working on the Alsa Driver project. You might want to have a look at their list. And see if your sound card is on their list. The nasty hardware manufacturers who do *not* share their information (and therefore, their cards do *not* work) are listed in red.

If you use the SoundBlaster card, you may also want to check out Creative Lab's page

Configuration tools

Before I go into the tools to use to get the sound card working, it's important to point out that the Linux kernel needs to be configured to use a sound card. If your kernel doesn't have a clue about what to do with a one, there is precious little tools like sndconfig can do to help you. Luckily, every install I have done in the past year and a half or so of a major Linux distribution has come with a kernel that has sound support in it by default. If you're installing "Joe's Home-brew Linux" distribution (where you must compile your own kernel), then you might be beyond this beginner's Linux course and you probably already know how to make the kernel you want. But if you are a true beginner (that's who this course is for) then you're probably going to get a "made for sound" kernel. The latest versions of Red Hat, SuSE, Mandrake and Debian that I have installed are all sound enabled from the beginning, depending on, of course, whether or not the hardware is mainstream enough to be detected on install. I wrote in a review of Mandrake 7.2 in the Spring of this year (2001) about how it didn't detect my very mainstream Sound Blaster 16 card. The good thing is that Mandrake 7.2 is very much a thing of the past. They're on version 8.1 at the time of this writing and on that same machine, I did a "clean" install (I did not update - I removed 7.2 and installed 8.0 new) and it found and configured my Sound Blaster 16 card without the slightest problem. If the distribution you have installed (or are planning to install) is up-to-date, you should not have a problem.

It is also important to know what type of sound card it is in terms of the slots that it uses on your mother board in your computer. On my machines, the motherboard (that big thing inside a PC that you plug all the cards into) or mainboard as it is also known, will accept ISA Plug and Play cards (bigger slots) and PCI cards (smaller slots). I'm not a USB user, so I won't feign expertise here and give USB guidelines. If you have an ISA PnP card (I have two) you also have to have the ISA PnP tools installed as well as a kernel that can use ISA Plug and Play (also known as plug and pray)

As I mentioned, most major distributions will configure the sound card during the installation process. If this is not the case, you may use to any of the following tools, depending on your distribution.

  • sndconfig I mentioned this one above. It is a tool for Red Hat and distributions based on Red Hat (Mandrake, KRUD, for example). It is text based (runs it a terminal) and has always done a good job for me. It will play a sound bit of Linus Torvalds pronouncing the word "Linux"
  • YAST This is SuSE's "Swiss Army Knife" of configuration tools. Their latest version 2 is graphical. Again, there was no problem detecting my sound cards with YAST. It plays a little melody that's also the KDE default startup sound. You can adjust the default volume as well. It warns you not to set it too high, just in case you're wearing headphones and you blow your eardrums out!!
  • HardDrake Mandrake uses this graphical tool to configure hardware, including sound cards. Using the GUI, you can select the sound card and then push the button that says "launch configuration tool". I suspect that what it is doing is launching sndconfig - which, as I mentioned, is also available for Mandrake.
  • alsaconf If you're using Debian, this is the package you need to set up sound. The alsa-base package is also required.

You should now have a pretty good idea of setting up a sound card with a major Linux distribution. Strange hardware, old versions of Linux (your cousin lent you the SuSE 5.3 disks) and obscure distributions (Zingblatter's Ultra Linux 1.4) are beyond the scope of this course, so if you're one of those out there who pine for the sweets sounds of Mozart flowing from your PC, you can take a look at the HOW-TO's on the subject.You can also go to your favorite search engine (mine is Google ) and enter Linux sound card setup and you have access to the zillions of bytes of information on the topic.

Let's go on now to all of the available programs to play all of that sound and music, from the Beatles to Hans and his Swiss Alpine Yodelers.

ISP Information for Linux Systems

Getting in touch with your ISP

There are a lot of tools out there to assist you in establishing a connection with your ISP so you can get out there on the Internet. Most will do the job quite nicely. I have found one in particular that is the easiest of all to use. Not surprisingly that it is called eznet. It was written by Richard Hipp and it makes setting up your Internet connection absolutely trivial. For Red Hat and RPM based distributions there is a RPM package compiled by Kent Robotti and available through RPMfind.net. There is also a "tarball" available at Ibiblio's website If you're feeling adventurous, you might want to go to Dr. Hipp's website and download the C source code and compile it, which is another option.

Basically, the program asks you a series of questions about your ISP, information which this company should have given you and about where your modem is located, (what we covered in the previous section). There is a possibility to handle several different ISPs (at one point, I had 3 different ISPs configured). Once you've answered the questions and you have your connection setup, connection is nothing more than typing one command in a terminal:

eznet up 0

The program starts counting ISPs with the number 0, so that's your first ISP. Just substitute for 1, 2 etc. for other connections you may want to set up.

Other options

If you use YAST in SuSE Linux you can set up your connection using WvDial. I must confess that earlier versions of this program were not entirely successful in setting up my connection. Euphemistically speaking, they couldn't do it. This program has been greatly improved and your probability of success along with it.

If you've picked out your windows manager already and it happens to be KDE, you're in luck because there is a program called KPPP which will set up a connection for you fairly painlessly. The only problem I seemed to have with this was is known as the "negotiation" of the connection with my ISP. There are two protocols known as PAP and CHAP. If you run into this problem, it just might be a question of trying one or the other and sticking with the one that works. With KPPP, you can also tune or tweak your connection speed to get better results from your hardware.

User of Red Hat have a very powerful and simple to use graphic tool with RP3. This is standard issue on all versions of Red Hat since 6.2

For the technically curious

As you'll notice, the program I mentioned for KDE is called KPPP. The K stands for KDE but what does the PPP stand for? It stands for Point-to-Point Protocol. This protocol enables two computers to connect across a network. The protocol basically provides the means for the two computers to first, identify themselves and then ask whether the computers can read the data each other sends. In your /sbin/ directory, you'll find the point-to-point protocol daemon, or pppd which is a program that provides for that communication between computers.

What you essentially do when you set up your Internet connection is to make sure that pppd knows how to communicate the right information. If the two computers either can't authenticate themselves to each other (ie- realize that they have "permission" to communicate) or the type of data their sending is incompatible or both, then the connection fails. What eznet, kppp, RP3 and other similar programs do are to create the necessary