[Contact Us]
| Home | About | Blog |
 

Linux Learnings

Amazon UK
See Amazon USA below)

Amazon USA

 

by R.M. Schneider
Last Update: 15 Nov 2009

This page collects and published Linux Learnings™ ... things about Linux that we've learned and are sharing with others.  The focus of these articles will be on use of Linux, from Red Hat, at home for computing enthusiasts.

What is Linux

When I first wrote this, I felt the need to explain what Linux is.  I really don't think that is as necessary anymore.  You probably already know, but we'll say it anyway:  Linux is a free Unix-like operating system. The "kernel" (the heart of the operating system) was developed and is still maintained by Linus Torvalds--then a student in Finland, and now a famous person living and working in Silicon Valley USA.   Surrounding the "kernel" are applications and a complete system environment. 

The latter is provided primarily by the GNU project fun by the Free Software Foundation, led by Richard M. Stallman.   Another major component of Linux software is the X Consortium which developed X Window (not Window s !) System and the XFree86 project that ported that system to Intel CPU's and associated peripheral hardware.

Personal comment.  Mr. Stallman is known by his initials "RMS".  The author of this webpage is also known by his initials "rms".  I always close my email and on-line postings with my initials "rms".  There has been a few occasions when people in the Linux community has taken exception to me trying to impersonate Mr. Stallman.  This is not true.  Given my age, I've been--have been using--the moniker "rms" far longer than Mr. Stallman and I intend to keep using it. 

Home Network

This section explains what you might want to do with a Linux in a home network.   The prerequisites are:

  • LAN cards (recommend ethernet) installed and running on all machines, connected via standard ethernet wires and connected to a hub.  You can buy ethernet cards for in the US for $20-50 each, ethernet hub for about $50-100, and the cables are also inexpensive the actual cost depends on the length.  (Some people are starting to use wireless networks in the home which avoid the need for unsightly exposed wires, or the cost of hiding the wires in the walls).  100 mbs is recommend.  It's on our "to-do" list to upgrade to 100 mbs.
  • TCP/IP network protocol running on the Windows workstations.  There probably is no reason to run NETBEUI (which is installed by default on your Microsoft Windows workstation).

At some point, we'll write an article here about how to connect all this together and make it run.  But that article has already been done before by many other people.   In fact, in the coming months and year or so you are likely to see many more articles on this subject in newspapers, magazines, and on television because this home networking market is expected by many (us included) to start exploding.  Meantime, start at Technocopia web site at http://www.technocopia.com/homenetwork.html where there will certainly be information and guidance, and links to other web sites.   Also see Moshe Bar's article published on Jerry Pournelle's web site.

Samba

Samba is software product, open-source and free to use, which is an implementation of the "Server Message Block" (SMB) protocol.  It was first developed 1991 by Andrew Tridgell in Australia.  SMB is used in the networking of Microsoft Windows and NT; hence, by running Samba on a Linux machine enables machines running these Microsoft products to share files and other services.  Samba will give you opportunity to:

  • Replace a Windows NT file and print server with a server running Linux and Samba.   From the end-user's perspective, there is no difference.  From the perspective of cost there is no comparison since both Linux and Samba are free to use without licensing costs.
  • Provide users "home" directories existing on a file server.
  • Provide access to networked printers from Unix, Linux, and Windows workstations.
  • Unix and Linux machines to access files on NT machines.

See O'Reilly's book "Using Samba", available for free download at http://www.oreilly.com/catalog/samba/chapter/book/indexpdf.html.

Gateway to Internet

You can configure your Linux box to act as a gateway, with firewall using IPTABLES, to the internet.  This means that in a home network, this single box can have a dial-up PPP connection to your Internet Service Provider (ISP), and all machines on your home network can use that single location.  At 56k modem speeds, surely more than one home user will be able to use access the Internet simultaneously.

wpe3.jpg (15695 bytes)

This is useful for people living in the UK where it is normal that you pay for your phone call to the ISP by the second.  Two more people on the Internet at the same time is definitely 1/2 the cost or less of those two people doing it separately on their own dial-up connection.

  • At some point, we'll write here how to do this.  This also is documented in many places.  Simplistically, on the Linux server set it up to dial-out on demand.  This is done in the /etc/ppp/conf file by adding the DEMAND command.
  • Set all the Windows and Linux machines on the network to use the Linux server as the "gateway".  Point to the this gateway machine's IP address.

Whenever any machine on the home network wants to reach an internet site, it will connect to the gateway.  The gateway  will determine if it's connected to the internet or not.  If yes, then the page will be served.  If no, then the gateway will dial-up the designed ISP, and then serve the page.

You can also configure the Linux gateway to act as a caching DNS server.  This is also documented fully in the HOWTO file included in your Linux distribution, so it's not a priority to re-document that here.  We just want to let you know of the possibility.   A caching DNS server will let your Linux box translate DNS Names into IP addresses.   This is normally done by a DNS server at your ISP, but by doing it on your own machine and use the cache of server names/addresses, you reduce the load on the dial-up line and speed up internet access response time.

Wireless Access

To avoid having to string LAN wires through the house, or to enable wireless access to the network from your laptop, you use a Wireless network.  With components now easily available, it's pretty simple to accomplish.

See Configuring the Linksys BEFW11S3 Wireless Access Point Router with 4-Port Switch to see how we did it with a device from Linksys.   See See Configuring a Linksys WPC11 with RedHat 8.0. for how we made the wireless PCI card work in a Linux laptop.

Home Internet Security

At minimum, do the following before you connect your machine to the Internet:

  1. Subscribe to the security mailing list for your distribution.
  2. Forward mail from root to you real ID so that you will not miss mail.
  3. Unless the machine is a mail server, configure the mail daemon to listen only on the loopback interface or not listen at all.
  4. Comment out unneeded services in /etc/inetd.conf
  5. Remove unused software, especially daemons.  Your firewall or external server doesn't need portmap
  6. Apply any security updates to the remaining softtware on your system.
  7. Setup ntpd and ntpdate so that times listed on the logs will be correct.
  8. Copy your SSH public key into .ssh/authorized_keys in your home directory so that you never need to send your password over the Internet.  Configure sshd to refused passworded or root logins and accept protocol version 2.
  9. Run nestat and nmap to make sure that no unnecessary services are running.  If you have services that are supposed to run on one interface but not another, nmap from both to check your configuration.
  10. Reboot and checket itmes 7 and 9 came back correctly and that you can still login.

From:  Linux Journal News Notes, 5 June 2002

Using Linux

This section will talk about using Linux for useful things. Clearly, what seem useful to one person may be considered frivolous to others; but, we'll write about these ideas anyway.

File Serving

With Samba running on your home network, you can setup individual "home" folders for all users. This folder would exist in the Linux server, and be the single place where the user's important, personal files are kept.  Access can be setup to control access to these files.

You can also put files which are used for 

System Backups

The Linux server should probably be kept running at all times.  This not only is better for the hardware--computers prefer to be kept running instead of starting-up/shutting-down all the time since there is less wear and tear on the electrical and mechanical components--but it also provides the opportunity for automatically running backups at scheduled times.

The Linux command "cron" is a daemon which sits in the background awaiting to launch scheduled jobs .  The schedule is entered in the so-called "crontab".

You can schedule backup jobs in "crontab" to backup (copy, tar to compressed files, or whatever you want) files from the Linux machine onto another hard disk, another networked machine, onto a Zip drive, onto a writable CD, onto a tape ... whateverWe typically run a full backup of all machines to another machine on the network, and then every month or so take a backup to a CD of the important data files.

With this approach, backups are taken automatically and continuously without you have to remember.  The backups are secure since they are copied onto another machine.   The probability of loosing two hard disks on two or more machines simultaneously is almost nil.  If you wish even more security, copy the backup files onto Zip drives, CD-ROM, or tape.

For high security, you can use the gpg program to encrypt the backup files.  See the recent article on this at O'Reilly.

Printer Sharing

With Samba running on your home network, you can connect printers to the Linux server, and all other users on the home network can print to the shared printer.  This reduces the number of printers you have to buy.

Current Server and Desktop Applications

The following lists the important server and desktop applications that we use routinely. I publish this list to meet requests to provide "pointers" to Linux "newbies".

Web Browser. The candidates have been Netscape, KDE's Konqueror, and Mozilla. The choice is Mozilla, but Konqueror is also used often because it transparently will access web, local file systems, etc. Mozilla is the choice simply because the pages are easier to read due to fonts they use.  Additionally Mozilla offers integrated email, news, and HTML editor.

Email and News. We have tried and used KMail, Mozilla's email client, Netscape's email client, Pine (character based), Sypheed, and maybe a few others. Mozilla 01.3 is the current choice due to integration with the browser and viewing of email in HTML format (which is unfortunately becoming more ubiquitous).  KMail is also used.  Mozilla and KMail are pointing to the same local mail directory.

Writing and Word Processing. Here the jury is still out. Word for Windows 2.0 is still our favourite writing tool, but that went away a long time ago.  Win Win4Lin, we are using Microsoft Word 97 successfully on top of Windows 98 on top of Linux.  At the same time AbiWord 1.0 looks terrific (reminds us of Word for Windows 2.0) and Open Office 1.0 has made significant improvements over its Star Office predecessor.

Graphics. The Gimp. See more on The GIMP at http://www.gimp.org/.

Palm Synchronisation. We use a Palm Vx as a PIM (personal information manager), and do not rely on any desktop applications. This simplifies managing personal information and eliminates synchronisation complexity. See Palm and Linux.

Workstation and Server Admininstration. Webmin (available from http://www.webmin.com/webmin is a web-based interface for system adminstration. Using a browser, you can setup user accounts, Apache, DSN, Samba file sharing, Cron jobs, etc. Webmin is highly recommended. You still have to have basic understanding of Linux, but with that basic understanding all your administration tasks become simpler.

Web Site Publishing.  Sitecopy is setup to automatically synchronize the pre-production copy of the web site with the production-copy at the ISP.  See http://www.lyra.org/sitecopy .

Tips and Tricks

Screen Shots.  PrntScrn and Alt-PrntScrn does not work as it does in Microsoft Windows.  Use the programs: xwd, The Gimp, ImageMagick (import), KSnapshot, Slapshot!, or Screen-Shooter

Printing man Files.   Produce quality printouts of man files, 4 pages per sheet of paper using "typeset-quality" fonts with the the man, mpage, and lpr commands:

man -t [command] | mpage | lpr

where the environment variable MPAGE="-4 -bA4 -m100t40lr20b" is defined in your profile

Another nice way is to use Konqueror.   Type "man:[command]" in the Location and it will display the list of man pages available for you to pick.  

Command Line to Send a File Attachment.  The mail command does not send attachments.  However, you can use the mutt mail program

mutt -x -s "Subject here" -a attachment.file email@address.com < body.text

where "Subject Here" goes into the email subject, attachment.file is the name of the file to be sent as an attachment, email@address.com is the name of the addressee, and body.txt is a file containing the body of the message you want to send.

Other tips:

Acrobat 5 with Red Hat 8.0

Acrobat 5 (available for Linux from www.adobe.com) doesn't work with Red Hat 8.0 "out of the box".  Set LANG=C before running Acrobat.  I am not sure what this does.  The result is this is to set the LANG environment variable to en_GB.UTF-8 on my computer. It works.   I'm sure it has something to do with fonts, character sets and all that ... something which I have never taken the time to learn and undersatnd.  See the first CD of the Red Hat distribution for the file RELEASE-NOTES.

Installing Linux

Installing Linux is normally a one-time event.  Despite this, when you read about Linux distribution comparisons in the press, all you tend to see is critiques about that distribution's installation features.  Today's major Linux distributions install as fast, or faster, than Microsoft with greater flexibility.  That flexibility comes at the cost that the user needs to know just a little bit more about the details of their computer than they do with Microsoft Windows.  Read the instructions that come with your distribution.  A few suggestions follow:

  • Make a list of all the peripherals and components in your machine.  If you already are running Microsoft windows, then right click on "My Computer", click the "Device Manager" tab, and click the "Print" button.

  • If you have a spare PC with no critical programs or data on it, try out your first Linux installation there first.

  • Have a floppy disk available.  During the install process, Linux will prompt you to create a "rescue" disk.

Failure to Install on Toshiba 1135 Laptop

This article talks about experiences with failure to make Red Hat 9 work on a Toshiba 1135.

References and Links

Books

Books are probably the best source for learning, in our opinion.  Typically (but not always!), authors spend a lot of time figuring out what to explain and how to explain it.  Writing is hard work.  Readers can benefit directly from that hard work by reading the book. 

Linux in a Nutshell
Heckman, Jessica Perry, O'Reilly, ISBN 1-56592-167-4.  Paper copy of all the commands.
Running Linux, 3rd Edition
Welsh, Matt, Matthias Kalle Dalheimer, Lar Kaufman, O'Reilly, ISBN 1-56592-469X.  As the title suggests, focuses on running Linux.  This book is currently in it's 3rd release, and hence it has a track record and history.
Learning Red Hat Linux
McCarty, Bill, O'Reilly, ISBN 1-56592-627-7.  Good for first time users to get the your system up, running, and in-use.  Will quickly want to use Welsh's book.
Teach Yourself Samba
Carter, Gerald and Richard Sharpe , SAMS, ISBN 0-672-31609-9.   Explains how to setup and run Samba.  We've not yet read the O'Reilly book on Samba, but had we seen it before buying this book by Cater and Sharpe, we would have bought it instead.  (Sorry to Mssrs. Carter and Sharpe--we have respected every O'Reilly book we've read and used.

Web Sites

There are so many web sites out there.  And so many of them provide information about Linux and related topics.  The following is only the ones that we know about and use at some remember-able frequency.

Linux Documentation Project
http://linuxdoc.org .  Publishes contributions from Linux users worldwide.
LinuxCare
http://linuxcare.com .  Vast site of forums and knowledge bases about Linux.
LinuxNewbie
http://linuxnewbie.org .  Focused on the new user.
Linux.Org
http://www.linux.org
Linux World Magazine
A US-based Linux magazine.  The web site is updated frequently with interesting articles and columnists.   http://www.linuxworld.com/
Linux Journal Magazine
A US-based Linux magazine.  The magazine is terrific, but the web site is not updated as frequently as others.  http://noframes.linuxjournal.com/
Freshmeat
Source of Linux programs.  http://www.freshmeat.net
Linux Magazine
A US-based Linux magazine.  The magazine is terrific, but the web site is not updated as frequently as others. http://www.linux-mag.com/
O'Reilly Linux
Associated with the publisher, O'Reilly.  Updated a few times each month with good columists.  http://www.oreillynet.com/linux/
Linux Focus
Based in the Netherlands.  Good technical information.  http://www.linuxfocus.org/English/
Installing Linux for a Family Network, by Moshe Bar
Published on Jerry Pournelle's web site.  Moshe Bar is a systems engineer and administrator in Israel, managing some large UNIX establishments.   Introduction to how it's done.
Freshmeat
http://freshmeat.net.  Get Linux software here.
Tucows Linux
http://linux.tucows.com.  Get Linux software here.
LinuxApps
http://www.linuxapps.com.   Get Linux software here.
Red Hat
http://www.redhat.com.  Get Linux here (if you want to use Red Hat). Download for free, or order a CD.  We use Red Hat.
Linux Emporium
http://www.linuxemporium.co.uk/ . Buy CD's with Linux (any distribution).  Very inexpensive.  Saves downloading and copying to CD's.
NetFilter
http://www.netfilter.org/documentation/index.html#HOWTO.  Numerous "howto's for networking, firewalls, etc.

R.M. Schneider