Why You Want to Include an FAQ In Your Site

4:53 PM Posted by whandie

Congratulations! You've got a brand new site and it's doing pretty well. You check your statistics every day and the hits and page views keep climbing, your links are all in order and everything looks very good. On top of that, your guestbook is filling with great comments and you're getting a few emails now and then with praise and perhaps a question or two.

Now is a good time to sit back and examine the subject (or subjects) of your site. What is the theme? What are you trying to accomplish? Then once you've got your site visualized, start to think about it from the perspective of a new visitor. Put yourself in their shoes, and assume you know nothing. What questions would you have? Write down these questions or type them into a document as you think of them.

What you are creating is a list of frequently asked questions (commonly abbreviated as FAQ). These are questions that your visitors may have about your site, the subject or theme, or even about you. Just about any question is valid, as long as it is helpful to your visitors.

Let's create an example of, say, a web site about model railroading. Now, what questions would you have if you surfed to that site? You might want to know "what is it?", "when did it start?", "how much does it cost?", "why does this site exist?" and "who is the webmaster?".

That last question is more important than it seems at first glance, as putting a face behind a web site increases it's credibility and makes it more likely that your visitors will (a) return, (b) tell their friends, and (c) purchase something (if your site is commercial). Some web guru's will tell you never to include information the webmaster - these people simply do not understand human nature. In general, people will trust another person far more easily than they will trust a web site or a machine.

Once you've got your list of questions, go ahead and create one or more web pages (create as many as you like). Add the questions to the pages, along with the answers. If you feel like linking to articles within your site go ahead. I would avoid including external links at this point, as you want to get people interested in your site, not someone else's.

Remember to keep your answers short and to the point. You are not trying to duplicate your web site. Your goal is to give your visitors some quick answers to their questions to get them more interested in looking around further.

As you are adding your questions and answers, you will most likely come up with additional questions. By all means, add those to your frequently asked questions as well.

Some webmasters like to include a form at the bottom of their questions to allow people to submit additional one's if desired. This is a great idea, as it is an easy way to improve your web site's interactivity - which is usually very good for getting people to return later.

I would not recommend, however, doing what I've seen some webmasters do - automate this function. I guess the idea is to get your visitors involved in answering the questions. In this case, the FAQ becomes more or less a moderated message board.

I prefer just to receive my visitors questions in an email, which I can then either answer directly or add to the FAQ when I get the chance.

FAQ's are great for answering simple questions that your visitors may have before they send you an email. It is important to remember to include a link to the FAQ in a prominent place on every single page of your website - you want people looking at them when they have questions.

In summary, FAQ's tend to pull visitors into your site and make them feel better about it, which means they are more likely to return for more again and again.

Source: http://www.internettipsandsecrets.com/article-077.asp

Windows XP Safe and Secure?

4:52 PM Posted by whandie

Microsoft has come under fire lately because of their habit of releasing software which has serious flaws, most especially problems with security. Unfortunately the criticism is justified and verges on the criminal: flaws (implementation bugs as well as just plain silly design decisions) have resulted in literally tens of billions of dollars in damage and losses worldwide.

Don't believe me? Think of all of the viruses that have devastated not hundreds, not thousands, not even millions, but tens of millions of systems. All of these viruses are allowed to "breed" (spread) because of one of the silliest, misguided, downright stupidest decisions ever made by a major corporation. This was the addition of email scripting - without that incredibly powerful and almost totally unused (and many would argue not necessary) feature viruses could not spread in a matter of days or even hours. Since when does anyone need to script their email program anyway? I've never heard of a single person or corporation using this feature legitimately.

On top of this kind of issue (and there are several others), Microsoft's products tend to have blatant bugs - problems in programs which should have been caught by adequate design, testing and quality assurance. The most famous of these is probably the series of bugs that led to Nimda and Code Red. Again, millions of systems were damaged and countless millions of man hours were wasted in efforts to eradicate these issues.

The firestorm that landed on Microsoft as a direct result of these and other problems and issues was fantastic to behold. Naturally Microsoft responded, trying desperately to reduce the impact on their business. They claimed the problems were with administrators who did not apply patches, with people reporting problems too early (thus giving hackers information before fixes were complete) and any number of other problems. It seemed that everyone except for Microsoft was doing the wrong thing - of course, the mighty Microsoft could do no wrong.

In spite of what the left side of their face was saying, Microsoft did introduce some changes. They announced a new security service to help keep systems locked down and system administrators happy. Automatic security patch downloads were added to Windows XP and, I'm sure, dozens of other changes happened.

With the release of Windows XP, Microsoft was adamant that they had tested it from top to bottom. The software giant even claimed it had written a special program to check for the nastiest kind of software problem - buffer overflows. You see, a buffer overflow is one of the most common ways for a hacker to break the security of a system. It does this by writing some code beyond the end of where it is supposed to write it. The code is then executed in privileged mode to give the hacker entrance to the system.

Well, a short time ago Microsoft released a patch to Windows XP to fix exactly this problem. It seems there is a buffer overflow problem in the UPnP service. What the heck is UPnP, you ask? That's a good question.

UPnP is a special plug-and-play service. What is plug-and-play? Well, when you install a new device on Windows XP it automatically detects it and configures it for you. Plug-and-play is a very nice feature, and it works very well in Windows XP.

On the other hand, UPnP is a special kind of plug-and-play. This looks for printers and other devices added on the network (wired and wireless). It's actually a pretty cool idea. Now, when someone adds a printer to the network you must configure it on each and every workstation. With UPnP the configuration is totally automatic.

However, UPnP is very, very new and there is almost no real support for it with any devices. So UPnP is more or less not used, and it is certainly not needed by home computer users. By shipping Windows XP with the product Microsoft was solving the classic "which came first, the chicken or the egg" problem. They had to send out support for these devices in order to convince vendors to start providing them.

But Microsoft made one big mistake - when you install Windows XP, this unused service is turned on! What that means is everyone who has ever installed Windows XP is running this service.

And the service has a bug - a huge bug, the kind of bug that if it hit your windshield would smash the car and cause it to explode in flames, killing all of the passengers and the driver.

The problem is very bad, and Microsoft has released a patch to fix it. But the story gets even more interesting.

The National Infrastructure Protection Center released an advisory stating that everyone who is not using this service should disable it. This is an incredible statement from this agency. What they are implying is the UPnP service problem directly puts the United States computer infrastructure at risk (that's what this agency protects)! That's a big thing for them to be saying.

What are they afraid of? That hackers and perhaps hostile governments can use the bug to their advantage. You see, special programs called Zombies can be installed on Windows XP machines with this problem, and Zombies can be used to launch distributed denial of service attacks on computers throughout the world.

In fact, I'll bet you heard about the denial of service attack performed by the Code Red worm recently against the Whitehouse (the attack failed, if you remember). That's exactly what this agency is afraid of and what they are trying to prevent.

So the next time you are thinking about giving all of your credit card data to a site which uses Microsoft Passport, think about this article. Do you want to trust all of your confidential data to a company which cannot keep it secure? Just think about it, read some more, and make the rational decision.

For more information, check out the following articles.

Microsoft Security Bulletin MS01-059 http://www.microsoft.com/technet/treeview/default.asp?url= /technet/security/bulletin/MS01-059.asp

eEye Digital Security http://www.eeye.com/html/Research/Advisories/AD20011220.aspl

NIPC ADVISORY 01-030.2 Universal Plug and Play Vulnerabilities http://www.nipc.gov/warnings/advisories/2001/01-030-2.asp

Source: http://www.internettipsandsecrets.com/article-287.asp

Writing For The Web: More Places To Get Ideas

4:51 PM Posted by whandie

There are many places all over the place to get article ideas. Part 1 of this series explored some of the locations on the internet. This part goes into some of the places you can find ideas outside of the web.

Libraries - Believe it or not, libraries still exist and are going string. In fact, there are dozens of libraries in just about every major cities, and most towns have at least one. Even the town where I grew up, Lake Arrowhead, California, had a small public library.

Libraries are great places to get ideas for articles. I like to just visit and wander up and down the isles, looking at titles, occasionally opening a book and flipping through the pages. It's rare that I don't walk away with at least one or two ideas which turn directly into articles.

Botanical Gardens - A few miles from my house is one of the best places on the planet - the Huntington Library. This is an awesome collection of art museums and displays which is not equaled anywhere in the world (at least in my humble opinion). One of the things that makes this magical place even more enjoyable is the surrounding botanical gardens.

The library gardens are divided up into different habitats, duplicating most of the major environments of the planet. I've spent many enjoyable hours wandering through the place, just looking at the plants and environments, getting dozens and dozens of article ideas.

Something about the gardens relaxes my mind and causes the thinking process to become calmer and more organized. Ideas just seem to float up to the surface, waiting for me to just pluck them up and convert them into articles.

Museums - Of course, museums are excellent places to get article ideas. I have the pleasure of living just a few miles from a number of excellent museums including La Brea tar pits (dinosaur and extinct animal articles), the Air And Space Museum (obvious), Museum of Science and Industry (technology articles), the Natural History Museum (thousands of article ideas just waiting to be found) and art museums galore.

I like to visit with a pad of paper and just wander up and down the corridors, just looking at things. Ideas pop into my head and I write them down. Quite a few of these become articles (and a few stories).

Magazines - I skim over a dozen magazines every single day, looking for anything interesting. Sometimes I'll stop and read and article, but mostly I am looking for ideas for articles of my own.

I must stop here for a moment and discuss copyrights for a moment. The concept I present in these articles is how to find ideas for articles, not to copy or paraphrase other people's works. Anyone can do that, and by the way, it is illegal to "borrow" another person's work.

It is perfectly fine, however, to read an article and get an idea or two for your own. What I like to do is read an article or book and jot down a few ideas. I then let it lie for a few days, come back to it and write my own, completely original article.

For example, I read an article about raising children, and for some reason thought about how to protect plants from small kids. What a great idea for a story. So I wrote it down, and one day I'll write an article about it.

So that's the secret. Just wander around looking at things. It doesn't matter where and it doesn't matter what you look at. Your mind will start working, and before long an idea will percolate to the surface. This may be followed by another and another.

A short disclaimer. If you are not used to this kind of creative process, please understand that it can be pretty frightening. Especially to some of the students produced by our modern education system, who have been conditioned to not have original thoughts anymore. Don't worry, that strange feeling you get when you visit a museum or a library is just your brain cells waking up from the long hibernation that began when you entered Kindergarten. It's not dangerous and once you get used to the feelings they can be quite intoxicating. Just sit back and enjoy the ride.

Source: http://www.internettipsandsecrets.com/article-122.asp

Writing For The Web: Where To Get Article Ideas

4:50 PM Posted by whandie

A friend and I were talking the other day about writing. He liked to write, but even so his biggest problem was finding things to write about. My friend was astounded at the volume of writing that I do - at least one article and something as many as six, per day. Where do I get all of the ideas from?

I, in turn, was astonished myself. Why on earth would anyone have any trouble finding things to write about? In fact, my main problem has been I have so much to write about that I often find myself locked in a silent battle over which subject should be put on paper first.

People find it even more amazing when I tell them I try very hard to only write about positive events and provide helpful articles. Only rarely will you find any of my writings containing criticism, complaints or, worst of all, whining. Occasionally I will write an article which recommends against purchasing a product, seeing a movie, reading a book or visiting a web site, but these are the exception.

The world is a huge, amazing, wondrous place. Things are going on around us all of the time. There is so much good to see and do all over the planet, so very many wonderful things going on all over the place, that it's easy to find something to communicate about if only you open your eyes and look.

One of my passions is the internet. I've written over 1,000 articles about all aspects of this massive communication medium. Much of this is taken from my 23 years of experience in the computer field, and the rest is from research, reading and, most of all, questions from other people.

Although much of my writing is about the internet, I also find time to communicate about many other subjects as well. These include relationships (marriage and romance), raising children, building a career, handling office politics, current events, hobbies and history. I have yet to find a subject which I don't have something useful to contribute to other people.

How do I find so much to write about? Let me tell you some of the ways:

Many of my article ideas some from real life - For example, I have a long and happy marriage, so I like to write articles which help people with their relationships. I've also worked hard most of my life, as have most people, building a career, which is another area where I enjoy passing along tips to help others.

Question and answer sites - Sites like askme.com and askjeeves.com are perfect places to visit once in a while looking for ideas for articles. I visit and just scan the questions (and there are thousands of them), looking for anything which looks interesting. When I find something, I write an article.

Newsgroups - There are over 70,000 newsgroups. Most of these are worthless, but several thousand of them contain useful information and varied conversations. Lurk in any active newsgroup for a while and you should find something worthwhile to write about.

Yahoo and DMOZ - Visit any big directory site and you will find thousands of subjects to explore.

Egroups and Topica - There are thousands of email discussion lists available at these two sites. Sign up for a few and get articles ideas from them.

There are many other places to look for article ideas all over the internet. I tend to avoid looking at things like ezines, ebooks and web sites for article ideas. Why? Because when I look for article ideas I am not looking for answers.

What I tend to look for is questions. What kind of questions are people asking? Is there a question which begs some further analysis and a little more explanation than a simple sentence? It does not matter if someone else has already answered, as my primary purpose is not to provide raw information.

My primary purpose is to help people understand. You can find out raw information from any number of books or encyclopedias, but finding out how to clean up the clutter in your bedroom, well, that takes something different. That requires the experience and knowledge passed from someone who has had to go through the experience of cleaning many times, so many times that it has become easy.

Interestingly, I've found that television is not as worthwhile as one would expect for article ideas. Excluding a few reviews, I've found television to be a vast wasteland, void of anything but the most trivial or violent concepts in our society. The exceptions are, of course, channels such as Nova, History channel and Discovery.

So the next time you are trying to figure out something to write about for your own ezine, web site or ebook, just check out a newsgroup, elist or directory on a subject which you find interesting. Sooner or later, you will get an idea and you can start writing.

Source: http://www.internettipsandsecrets.com/article-121.asp

Yahoo Reluctantly Takes A Stand

4:49 PM Posted by whandie

A fact that many journalists miss is that communicating something gives that thing power. If you communicate something enough it will gain a life all of it's own.

An example is the Rodney King Riots in Los Angeles a few years ago (I was stuck in the middle of these). A fight broke out on a street corner, and before long it had spread all the city, eventually requiring the governor to call out the National Guard to restore the peace.

What really happened here? In my opinion, we had a crisis which was created by the news. If the fight had not been covered live on television in the manner under which it had been reported, there may not have been any riots at all. Certainly they would not have spread as quickly and lasted as long...

Another great example is your average terrorist or hijacker. These people and groups are actually quite weak (otherwise they would fight in the open instead of in the shadows) and need media attention in order to survive and spread.

Following this line of reasoning, the reporter who prints a story and justifies it by saying, "I only report the news", is misguided at best, and evil at worst. He is not just reporting the news ... he is granting power to whatever he is reporting on and he must use that power wisely.

That's why I was very happy when Yahoo (however reluctantly) announced it will "no longer allow items that are associated with groups which promote or glorify hatred and violence, to be listed on any of Yahoo's commerce properties."

Freedom of speech advocates are up in arms over this (of course) as Yahoo was strongly pressured by the French government. However, this is a victory for thinking and peaceful people everywhere. There is no need in our society to grant power to hate groups and violence mongers. And there certainly is no need to give them an outlet for their wares.

With the right of Freedom of Speech comes a grave responsibility ... the freedom to choose NOT to speak. Sometimes what you don't say (and what you don't allow to be said) can be far more powerful than what you say. Of course, governments have no business telling the people that they govern (or the media) what they can and cannot say ... it is up to the people to decide what they do not want to say.

Source: http://www.internettipsandsecrets.com/article-009.asp

You Can Do Better Than Banner Exchanges

4:48 PM Posted by whandie

They look so tempting, don't they? The promotional materials sound great: get 2 impressions for every three you show, get one impression per impression, get ten thousand free impressions when you sign up! Sometimes they are real fancy, with different size graphics, pop-up windows and the new fad, pop-behind windows. There is even one service (and probably many more) that will pop-up a full page of ads (which they nicely allow you to add a couple of banners to) behind your site!

Of course we are talking about banner exchanges. The concept here is simple. Create a banner and submit it to the banner exchange. They will show your banner on other sites, and in return you will display other people's banners on your site.

There is usually a ratio of their impressions to your impressions. This means for every 2 or 3 times you display a banner from the exchange another site will show your banner a specified number of times. A common ratio is 3:2, which means every three times you show a banner, your's will be displayed twice.

So what's the problem? Well, I've personally experimented with many different banner exchanges, including some of the more exotic versions, and I have yet to run across one that actually produces any meaningful traffic. By that I mean the number of hits generated by the exchange did not increase by a detectable amount.

You see, a couple of years ago when the internet was much younger and more innocent, banners were all the rage. Everything seemed new and fresh, and it was not uncommon for as many as 5% of the people who viewed a banner ad to click it (this is known as click-thru).

Now you are lucky is a banner produces a click-thru rate of .5%, and rates of less than .1% are increasingly common. What's happened? People are just plain tired of banners. Thus, as a method to promote a web site banners are simply not useful anymore. (The exception is professionally designed, precisely targeted, perfectly tested banner campaigns).

In addition, banners take away space from your web site viewing area. This is especially true of the higher ratio programs, as they often require the banner to be placed on the top of your home page. This not only takes away from your web site viewable area, it's takes it from the most premium area - the top of the home page.

Even if you do place the banners at the bottom of the page you are still reducing the load time. Banners tend to load slowly anyway because of their site, and it often seems as if the servers running the exchanges are slower than most. Thus, adding one or two banners at the bottom of your page could cause it to load very slowly.

On top of all of this, you generally do not have very much control over which banners display on your site. Some programs do allow you to specify categories or exclude certain types of sites, but that is just about as far as you can go. Most exchanges do manually check each banner to be sure it is suitable, but you are basically giving up control of a part of your web site to someone you do not know and who may not have the same taste as you.

Even worse are the pop-up window variations on banner exchanges. The windows which pop-up in front of a web page are truly obnoxious and should, in my opinion, never be used. I don't know about you, but I really hate it when the first thing that I see when I surf to a web site is a pop-up ad!

There are several kinds of pop-up windows. Your standard window will pop up when you enter the site. An exit window (also known as an exit console) will display when you leave the page (and the smarter ones display when you leave the site, not the page).

Another variation is to have the window jump behind everything else (I refer to these a "pop behind" windows). The theory here is you (the viewer) will eventually have to look at the window, at the very least to close it. I've also seen these windows immediately minimize to the tool bar, and recently I noticed that these are starting to include timers. By this I mean the window minimizes, then periodically a small window pops up to give you an advertisement. This could occur long after you have left the site.

The most obnoxious, horrible banner exchange program combined the worst of all of these features. If you signed up your site for this program you would get a web page which includes a couple of dozen banners of all sizes. You will then get to add your own banners to the exchange to be displayed randomly on other pages for other sites. The idea here was to cause a pop-behind window to display with all of these ads. The program offered an incredible (sarcasm intended) 10:1 ratio (meaning you display the window 10 times and you get one display on someone else's site). This is truly one of the most loathsome derivations of banners and pop-up windows that I have ever witnessed.

The final kicker is not only will you receive little or no extra traffic from these banner exchange programs - you will most likely loose far more traffic than you gain. First, by presenting a pop-up window or banner you are giving someone an opportunity to leave your site. Second, by including banners and increasing your load times you are improving the odds that someone will simply surf along somewhere else.

So the question that begs to be answered is "are banner programs useful". And the answer is a resounding "no". You've got far better tools at your disposal to promote your site.

Source: http://www.internettipsandsecrets.com/article-045.asp

Your Own Name Servers

4:47 PM Posted by whandie

I've gotten downright tired of moving my site again and again. It seems there are no competent hosting companies anywhere on the planet. I don't ask for much. In addition to the usual features for a paid web host, I just want my site to be up and relatively quick. Downtime should be measured in hours per year, and at it's slowest the site should respond in less than half a second.

So far I haven't found a single hosting company that even comes close. I've tried about a dozen different firms, and they've all come up short. In fact, the most important rule of any web host is violated on a regular basis time and again. The sites are down and very slow. Virtually anything else can be tolerated, except for downtime.

Finally I sat back one day and thought long and hard about my options. I was getting very frustrated with my current hosting company because the server was timing out on occasion, causing my sites to become unavailable for a few minutes here and a few minutes there.

I started looking for hosts and saw a word that caught my eye. The word was "dedicated". Now that was a thought - a whole machine all to myself. There was some appeal to that thought, but the price was too high, or at least I thought so at the time.

Looking closer into the concept, I found a dedicated hosting service that was actually reasonably priced. For a couple of hundred dollars a month I had a web and mail server all to myself. Yes, I know that sounds high when compared to a shared hosting service, but remember this included an incredible amount of bandwidth, lots of disk space and plenty of power.

I paid for the first month and soon discovered the server had it's own name server software. This meant I no longer had to deal with an ISP for name server services.

What's so good about that? Well, as an example, some time ago I wanted to install Bigmailbox on a site. This would have allowed my visitors to have a mailbox named "theirname@renaissancefaire.org". I thought this would be a pretty cool service to offer my visitors.

The ISP would not make the change necessary to install this feature. The change requires about 1 minute, yet they would not do it. Not even for a charge. With access to my own name server I could have made this change myself. It's very simple really. Just a one line modification.

Another thing I wanted to do on occasion is create subdomains. For example, wallpaper.renaissancefaire.org. This would allow me to create sites within sites in a logical, easy to remember format.

Most of my previous ISPs would not allow me to make these changes. One of them wanted to charge $10 per change. Ten dollars for a one minute modification. Now I can do this kind of thing myself, as often as I want.

Another change that I've wanted to make also involved subdomains, but with a twist. I wanted to create a subdomain of search.renaissancefaire.org which called up a search engine on everyone.net. My old ISPs would not make this change - not one of them. Yet it was a simple one line entry in the nameserver. Now I can make these changes myself.

But a problem soon introduced itself. You see, the name server is actually entered into the domain definition at the domain registrar. This more or less informs the internet where to find your site, email server, subdomains and so on.

Registrars require at least two name servers. My site only had one. I could have defined two by asking my dedicated hosting company for another IP address, but this had a problem. The reason for requiring two name servers is redundancy. If both IP addresses are on the same machine, then that redundancy does not exist.

I needed another name server somewhere else on the internet. A little searching and I found one.

http://soa.granitecanyon.com/

This is a free service which allows people with exactly the same problem that I was facing to create their own name server entries. You simply enter the domain name, your email address and the raw DNS server table for the domain. These DNS server tables are a little tricky to set up, but the service provides excellent documentation and will not allow an invalid entry to be set up.

So what do you do? You create your entries at this service, then modify your domain at the registrar to use them (wait a couple of days after defining them, however).

I believe you can use this service even if you host your site on a normal shared host (and possibly even a free host). You would need to set up your site normally and get the ISP to set up their name servers as appropriate. Once that was done, you could go to granitecanyon.com and define your own name server entries, then proceed to the registrar a couple of days later to use those entries. Theoretically this should work fine.

What is the bottom line? If you are using a dedicated host or you want to gain some measure of control over your name servers, you can now do so. This will enable you to do what you need without paying high costs or begging your ISP for a favor.

Source: http://www.internettipsandsecrets.com/article-265.asp

Disk Partitioning

6:46 PM Posted by whandie

How do I know what size to make my disk partitions?

This is one of the more often asked questions I hear. Usually the answer is "It depends", so here is my experience with partitioning Linux boxes for various applications over the last few years.

First of all it helps to know exactly what the file systems are all used for and where stuff goes. A good reference for this sort of thing is in the Linux Documentation Project's "System Administrator's Guide" or SAG. You can find a good bit of info on the file system here

Alternatively, if you have a copy of "A Practical Guide to Linux", then check out page 74.

Here is a brief rundown...

/       Root file system. Should just contain /bin, /sbin, /dev,
/root,
/lib, and /etc.
/usr Programmes and source code.
/var Variable data, such as spools, man pages, news and mail
queues, database data.
/boot Boot kernels.
/home User data and "stuff".
/tmp Temporary file locations

The / file system will never need to be more than 100Meg. Make it that.

The /usr file system will vary depending on how big your initial installation is and how much extra software you download. For a RedHat 6.2 minimal install you'll be needing about 250 to 300 Meg (typical server), and for a full install you need around 1.5 Gig (typical workstation). Other distributions will need more or less, but this is a good guide. Any extra software you download may also go in this file system, so if you are planning installing an office suite or a cad package, be aware it that it may go in here.

If you are installing software to build from a tar ball or installing software that isn't part of a vendor's distribution, like an RPM or a DEB is, you will probably want to install it in the /usr/local file system. This file system is usually left untouched by the installation or upgrade process of a linux distribution and is ideal for installing third party software. If you plan on doing a lot of this, a separate partition is a great idea, because if you want to do a re-install rather than an upgrade, you can simply tell your distribution not to format the /usr/local file system when installing and you will leave your third party software in tact. The format of the /usr/local file system is almost identical to the / file system. Handy huh?

/usr/local/bin and /usr/local/sbin are also the correct place to put any scripts you may write after you have your system up and running. This is preferable to placing them in /usr/bin and /usr/sbin or even /bin and /sbin, as these should really be static and left the way the distribution intended them. It also makes backing up a system much easier if all your locally created scripts are in one convenient place.

The /var file system is the most varying file system, hence its name. The function of the machine will determine how much you need. For a vanilla system, I recommend 400 Meg. This is usually sufficient for a workstation. If you are building a proxy server, you will need a separate partition, but preferably a separate disk, for /var/spool/squid. The same goes for a mail server, except the file systems of interest are /var/spool/mqueue and /var/spool/mail. The size of /var/spool/mail will depend on how much storage you want for user's mailboxes, and the size /var/spool/mqueue will depend on how much mail 'in transit' you wish to spool. Mail server's acting as a secondary MX might need a lot here.

There are other smaller directories in /var/spool that are of interest, so I would recommend a /var/spool of 300 to 500 Meg for any server application in conjunction with the /var of 400 Meg. For a workstation you may be able to use the 400Meg /var partition to house your /var/spool as well, but it may pay to enlarge it a bit.

/var/log, as the name suggests, is the final resting place for logs. Once again the size of this will depend on the function of the system, but as a general rule it is highly recommended that you have a separate /var/log to your /var partition, regardless of the machine's function. This way any stray system logs that fill up will have no effect on your system other than stopping logging. This goes for both servers and workstations alike. If you are running a heavily loaded proxy, mail or web server, you will need heaps and heaps of disk space here. Fully loaded proxy servers in peering arrangements can easily generate hundreds of thousands of bytes of log files an hour. The same goes for mail servers. The mail can come in and go out very quickly on a fast link, but the log files stay around. You also don't want a slash-dotted web site to fill up your logging directory, so careful thought here will pay off in the future.

The /var file system is also often used for the storage of database data. /var/db or /var/lib is the file system that is used, and you will need to keep this big enough to hold your data. Often a separate fast SCSI disk or RAID will make your database much faster. IO is often the biggest bottleneck in database systems, and an IDE drive in /var/db or /var/lib wont help.

The /boot directory is probably the most useful file system, and often the most forgotten. Having your kernels on a separate partition will make rescuing a system that has crashed a whole lot easier. This means that booting the system and recovering the partitions can be attacked as two separate tasks. Having a small /boot in a primary partition is also the best cure for the famous "I just installed linux and now all I get is 'LI'" LILO installation problems. LILO still has issues with hard drive space above 1024 cylinders. A small 20 Meg /boot partition as the first primary partition on the system will alleviate this. Some distributions, such as RedHat, are smart enough to assign automatically the first primary partition to /boot for just this reason.

/home is where you hang your hat. It is also where you "keep your stuff". Files you download, projects, mail, documents, mp3's, everything. This is the equivalent of Windows' "My Documents", "C:/download", the desktop, etc. Even if the system is only used by you at your desk, and no-one else, you should still have your own home directory in the /home file system. Don't be tempted to add partitions to the root file system such as /scripts, /downloads, etc. You are breaking stuff when you do that. Linux is still a true multiuser operating system, even if you are the only person using it. Try to keep this in mind when building a partition table. This all starts to make sense when you stop logging in as root, and start logging in as a regular user. It never ceases to amaze me how many people run X as root. *sigh*.

Many distributions nowadays are geared towards easy and quick upgrades and everything has it's place. If you keep you stuff in /home/yourname and no-where else, you can be sure that when your next upgrade of linux comes, you can just chuck in the CD and hit "upgrade" and your Metallica mp3's will still be there when your system comes back on-line.

/home is also where the storage file system for a file server should go. The same is true for web server pages, and ftp server data. Obviously if you are building a web server, have a separate /home/httpd file system on a nice fast SCSI disk. Same with /home/ftp.

Sometimes it's a great idea to have a separate /tmp directory, because temporary files can get out of control. Having /tmp on the same partition as the root file system can cause problems if you scan a 60 Meg picture into a graphics manipulation programme and it decides to store it in /tmp.

The only other partition of major interest is the swap partition. It is often a good idea to place this in the physical middle of the drive. Then the heads have less far to travel to swap out data when the system gets loaded. Alternatively you can just throw more memory at the problem.

Now I'll give you a few 'real life' examples of servers that I maintain. The names have been changed to protect the innocent.

Here is my bog standard workstation. It runs X. It may get used for some server functions in the future, so there is lot's of space ready. I even have a big block of space hanging of /mnt/tmp, and one day I'm sure I'll think of a use for it.

[alex@workstation alex]$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda13 85530 34264 46850 42% /
/dev/hda1 101089 6802 89068 7% /boot
/dev/hda6 1517920 154616 1286196 11% /home
/dev/hda12 2150420 20 2041160 0% /mnt/tmp
/dev/hda10 248895 27 236018 0% /tmp
/dev/hda5 2016016 1292380 621224 68% /usr
/dev/hda7 758936 37592 682792 5% /var
/dev/hda9 497829 657 471470 0% /var/log
/dev/hda8 758936 292 720092 0% /var/spool

This next beast is a mail server. Note the use of separate drives for critical server file systems.

[alex@mail alex]$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda12 79941 39339 36474 52% /
/dev/sda1 21011 5463 14463 27% /boot
/dev/sda11 701636 43332 622664 7% /home
/dev/sda9 202031 13 191587 0% /tmp
/dev/sda5 1210800 456856 692436 40% /usr
/dev/sda7 496695 7069 463981 2% /var
/dev/sda6 1009724 197880 760552 21% /var/log
/dev/sda8 496695 982 470068 0% /var/spool
/dev/sdb1 4382932 766640 3393648 18% /var/spool/mail

Here is a proxy server. Mix of SCSI and IDE.

[root@proxy /root]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda11 101485 28799 67446 30% /
/dev/hda1 23393 2647 19538 12% /boot
/dev/hda7 199085 2101 186704 1% /home
/dev/hda8 81954 985 76737 1% /tmp
/dev/hda5 809556 170444 597988 22% /usr
/dev/hda6 199085 4243 184562 2% /var
/dev/hda10 1611224 10408 1518968 1% /var/log
/dev/sda1 17654736 354220 16403692 2% /var/spool/squid

When partitioning a machine for use, it is often a bad idea to install everything into a single / partition. Even if you don't need separate partitions, the practice you get from partitioning disks and learning how much space each partition needs in a given situation will be invaluable when someone asks you to build a server for them. Spend a few minutes before installation considering the functions of the machine you are building and this will yield a useful and efficient partition table. The more often you do it the more of a feel you will get for how much space your distribution needs for different tasks. Now that you have the above information there is no excuse for poor partitioning, and you can help make the world a safer place for data!

Next time you see...

[lame@nothought /]$ df
Fileystem 1k-blocks Used Available Use% Mounted on
/dev/hda1 17654736 1354220 15403692 8% /

...you can do something about it!

IP Masquerading

6:45 PM Posted by whandie

What is IP masquerading and when is it of use?

IP masquerading is a process where one computer acts as an IP gateway for a network. All computers on the network send their IP packets through the gateway, which replaces the source IP address with its own address and then forwards it to the internet. Perhaps the source IP port number is also replaced with another port number, although that is less interesting. All hosts on the internet see the packet as originating from the gateway.

Any host on the Internet which wishes to send a packet back, ie in reply, must necessarily address that packet to the gateway. Remember that the gateway is the only host seen on the internet. The gateway rewrites the destination address, replacing its own address with the IP address of the machine which is being masqueraded, and forwards that packet on to the local network for delivery.

This procedure sounds simple, and it is. It provides an effective means by which you can provide second class internet connections for a complete LAN using only one (internet) IP address. Note the essential phrase, ``second class internet connections''.

IP masquerading cannot provide full internet connections to the hosts which hide behind it. The reason for this is that any connection can be established outwards, that is a hidden host can connect to any service which is "advertised" on the internet, but no connection can be established inwards. No host which is hidden behind the gateway will ever receive a connection for a port which it listens to. This precludes hidden hosts from offering services such as Telnet, file transfer, www, mail, news and so on.

The reason why no inward connection will ever be established is that the process of listening on a port produces no packet. When a program listens it does not annouce that it is listening, it just listens. When a host wishes to connect to a service it has no way of knowing if that connection can possibly succeed; it simply sends a connection packet to the destination IP address. If there no host at that destination address, the host trying to connect eventually times out and reports the connection failed. If there is a host at that destination address, but it is not listening at that port, the destination host returns a connection refused message and the host trying to connect immediately reports the connection failed.

Remember that the only IP address visible on the internet, with respect to a masqueraded LAN, is the gateway's address. Any inbound connection must be addressed to the gateway's address. With no prior communication between the hidden host and the gateway, there is nothing to indicate (to the gateway) how to rewrite the destination address for local delivery.

The conclusion of all of this is that if your program works by listening at an address (I suspect ICQ does this) so that other hosts on the internet can connect to you, that program will be of no use to you if your connection is through a masquerading gateway.

Command Pipelines

6:45 PM Posted by whandie

Pipes are easy. The Unix shells provide mechanisms which you can use them to allow you to generate remarkably sophisticated `programs' out of simple components. We call that a pipeline. A pipeline is composed of a data generator, a series of filters, and a data consumer. Often that final stage is as simple as displaying the final output on stdout, and sometimes the first stage is as simple as reading from stdin. I think all shells use the "|" character to separate each stage of a pipeline. So:
data-generator | filter | ... | filter | data-consumer

Each stage of the pipeline runs in parallel, within the limits which the system permits. Hey, look closely, because that last phrase is important. Are you on a uni-processor system because if you are, then obviously only one process runs at a time, although that point is simply nitpicking. But pipes are buffers capable of holding only finite data. A process can write into a pipe until that pipe is full. When the pipe is full the process writing into it blocks until some of the data already in the pipe has been read. Similarly, a process can read from a pipe until that pipe is empty. When it's empty the reading process is blocked until some more data has been written into the pipe.

An interesting effect of pipes, which is not immediately obvious, is that `record boundaries' can be lost in a pipe. What I mean: If a program reads from the terminal using buffered stream libraries, it will be given data one line at a time. Likewise if it writes to the terminal using buffered stream libraries the data will be displayed one line at a time. But if a program writes into a pipe that data will be sent to the pipe one stream buffer at a time; that's about 1K of data. So if your data generator `emits' a line of data (using the buffered stream library) to a pipe, the data might actually NOT be written immediately, but maybe held in an internal buffer (internal the data generator) until there's enough data to make it worth sending.

Similarly, the program reading from a pipe might get a partial line from the read. That can cause unintentional effects. Suppose, for example, that the end of your pipeline is reading a list of files and directories to delete, and supposing the buffer is five characters long. If you write "/user/john" into the pipe, what comes out could be "/user" and "/john". Curious, yes?

This buffering effect of the stream libraries might sound like a bad thing but it actually gives you performance benefits most of the time. If you are writing a program which uses them you should consider how buffering will affect your program in a pipeline, but other than that I wouldn't be upset about it. As I said: It's a good thing.

If you are constructing a pipeline (as all true Unix users do every day) you should remember the buffering effect which the stream libraries and which pipes both introduce. If your pipeline starts with something which reads lines from standard input and then writes variations of those lines to standard output, remember that the second stage of the pipeline might not receive any input until you have typed a few lines; and then it might receive all of those lines in one go! Here's an example of what I mean for you to try:
awk '{$2="SURPRISE"; for (i=0; i<100; i++) print }' | grep -n SURPRISE

Finding The Right Manual Page

6:44 PM Posted by whandie

Preliminary
Suppose you want to find a command that relates to foobie bletch, but you have no idea what that command might be. The manual (`man') pages can be searched in two ways: search one line description; and search complete page.
Search one line description

Each man page has a brief, one line description. For example, the brief description for the man manual page is `man - format and display the on-line manual pages'. You can search the brief description for all pages using the command man -k. Include one (or more) keywords that would appear in the description, and all matching pages are found. For example, if you want to find all commands that might let you search for a pattern, type man -k pattern. You will get the following output like this:
awk(1) - GNU awk pattern scanning and processing language
grep(1), egrep(1), fgrep(1) - print lines matching a pattern
lptest(1) - generate lineprinter ripple pattern
zipgrep(1) - search files in a ZIP archive for lines matching a pattern

Searching the complete man page
It might be the keywords that you wish to read about do not appear in any of the brief descriptions. You can still find an appropriate man page. You can search complete man pages using the grep command.

The man pages are stored in just a few groups of directories. Most are stored in directories within /usr/man. Your machine could have other places, in addition to this, for example many sites also have man pages in /usr/X11R6/man and /usr/local/man.

Suppose you want to find out about zombie processes. man -k is not helpful, so try:
$ grep -l -i zombie /usr/man/*/*

This produces:
/usr/man/man1/perlfunc.1
/usr/man/man1/perlipc.1
/usr/man/man1/ps.1
/usr/man/man1/screen.1
/usr/man/man1/top.1
/usr/man/man2/kill.2
/usr/man/man2/wait.2
/usr/man/man2/wait4.2
/usr/man/man5/proc.5
/usr/man/man8/fsck.minix.8

You will quickly discover that perlfunc, perlipc, ps, screen and top are unhelpful. You will equally quickly discover that kill, wait and wait4 all are useful.

Superblocks

6:43 PM Posted by whandie

Some disk blocks are quite boring. Some are marginally interesting. A very few are just super. :-)

The original Unix filesystem was composed of four sections: Boot blocks, which contain the secondary stage bootstrap loader; a super block, which I will describe in a minute; the i-node table, which contains i-nodes, and i-nodes are the complete file except for the data; and data plus indirect blocks.

I-nodes are, as I said, are the complete file except for the data. That is, they describe who owns the file, when it was last accessed and modified, what the permissions are for the file, and the list of blocks which contain the data. Side note: Unix files don't have names. They have (i-node) numbers. Directories are files which contain a number of filename, i-node number pairs; called links.

Data blocks contain the file data. Since i-nodes are of fixed size, obviously there is an upper limit to the number of data blocks which can be listed in the inode. When an inode can no longer contain the list of data blocks, that list is moved to an indirect block, and the i-node is converted to contain a list of indirect blocks. When the inode can no longer contain a list of indirect blocks, the list is moved to a double-indirect block and the inode then contains a list of double-indirect blocks. I notice (/usr/include/linux/sysv_fs.h) that ``traditional'' filesystems now allow triple-indirect blocks, which just goes to show that even tradition is hard to keep up with.

The super block describes the size of the inode-table and the size of the total file system. It also contains a list of some recently freed data blocks, which is used to quickly find a free block when you want to allocate a new one. Similarly there is a (partial) list of free inodes.

I made the point that files don't have names, they have numbers, and that directories provide a map between names and numbers. So how do you find the root of a filesystem? The answer is that it is inode number two. Inode 1 contains a list of bad blocks on the disk.

One of the less desirable features of the traditional filesystem is that it has only one superblock, and if you lose that you are really stuffed. Look: You wouldn't even know where the inode table ended and the data table started. As a remedy to that, when the BSD Fast File System was designed, it was given backup copies of the superblock. So if you lost the main superblock you could mount using one of the backup copies (but you had to know where it was (but it's not to hard to find it)).

Now don't you agree that from a filesystem perspective, data blocks are only marginally interesting, but that first block is just super? ;-)

Zombies

6:42 PM Posted by whandie

What are these zombie processes that show up in ps? I kill them but they don't go away!

Zombies are dead processes. You cannot kill the dead. All processes eventually die, and when they do they become zombies. They consume almost no resources, which is to be expected because they are dead! The reason for zombies is so the zombie's parent (process) can retrieve the zombie's exit status and resource usage statistics. The parent signals the operating system that it no longer needs the zombie by using one of the wait() system calls.

When a process dies, its child processes all become children of process number 1, which is the init process. Init is ``always'' waiting for children to die, so that they don't remain as zombies.

If you have zombie processes it means those zombies have not been waited for by their parent (look at PPID displayed by ps -l). You have three choices: Fix the parent process (make it wait); kill the parent; or live with it. Remember that living with it is not so hard because zombies take up little more than one extra line in the output of ps.

IO Redirection

6:41 PM Posted by whandie

UNIX had the concept of IO redirection long before DOS copied and bastardised the concept. The UNIX IO redirection concept is fundamental to many of the things that you can do with UNIX, and it is quite a well-developed idea, so we will explore this concept here.

Why do I mention UNIX at all? Well, Linux is a UNIX operating system!

Under UNIX, all programs that run are given three open files when they are started by a shell:

0.

Standard in, or STDIN.

This is where input comes from, and it normally points at your terminal device.

To find out what device is your terminal, use the tty(1) command. Note, the (1) after command names in UNIX refers to the section of the man pages that the documentation for the command exists in.

You can arrange to run any command and pass it input from a file in the following way:

$ some-command < /path/to/some/file

Note, the '$' is your prompt. Note also, you can always specify a complete path name for a file.

For example:

$ grep -i Fred < /etc/passwd

Would search for the string 'fred' in /etc/passwd, regardless of the case of the characters.

But wait a minute, you object, I always use:

$ grep -i Fred /etc/passwd

This is true, but you can also pass the file in on STDIN, and you will get different results if you do. Can you see what the difference is?

1.

Standard out, or STDOUT.

This is where the normal output from a program goes. It normally points at your terminal as well, but you can redirect it.

You can redirect output in the following way:

$ some-program > /path/to/some/file

For example:

$ grep -i Fred /etc/passwd > /tmp/results
2.

Standard error, or STDERR.

This is where error output from your program goes. This normally points at your terminal as well, but you can redirect it.

Why have different output places for standard out and standard error?

Well, as you will see when you come to writing shell scripts, you often do not want error messages cluttering up the normal output from a program.

You will forgive me for starting the above list at 0, I am sure, when you learn that each of these IO 'channels' are represented by small numbers, called file descripters (FDs), that have exactly those numbers. That is, STDIN is FD 0, while STDOUT is FD 1, and STDERR is FD 2.

When the shell runs a program for you, it opens STDIN as FD 0, STDOUT as FD 1, and STDERR as FD 2, and then runs the program (technically, it almost always does a fork(2) and then an exec(3) or one of the exec?? calls). If you have redirected one of STDIN, STDOUT or STDERR, your shell opens that file as the appropriate FD before running the program.

Now, what does this all have to do with you, I hear you ask?

Well, there are lots of neat things you can do, but some things to watch out for as well.

A lot of inexperienced UNIX users assume that they can redirect a file into a program and use the same name for redirecting the output:

$ some-program <> mega-important-data-file

They become very upset after doing the above, especially if that mega-important data file has never been backed up anywhere. Why is this?

The shell opens the mega-important-data-file for reading and associates it with FD 0 (or STDIN), and then opens it for writing, but truncates it to zero length, and associates it with FD 1 (or STDOUT) as well.

So, if you want to do something like the above, use a different file name for the output file. Oh, you should also back up files as well :-).

Now, there are lots of redirection symbols that you can use, and here are some of them:

< file means open a file for reading and associate with STDIN.
<< token Means use the current input stream as STDIN for the program until token is seen. We will ignore this one until we get to scripting.
> file means open a file for writing and truncate it and associate it with STDOUT.
>> file means open a file for writing and seek to the end and associate it with STDOUT. This is how you append to a file using a redirect.
n>&m means redirect FD n to the same places as FD m. Eg, 2>&1 means send STDERR to the same place that STDOUT is going to.

OK, here are some tricks that you might want to use in various places.

If you are gathering evidence for a bug report, you might want to redirect the output from a series of programs to a text file (never mind that you can use the script command to do the same :-). So you might do the following:

$ some-buggy-program > important-evidence.txt
$ echo '---------MARKER-------' >> important-evidence.txt
$ some-buggy-program some-params >> important-evidence.txt

The second and subsequent lines append the output from the commands issues to the evidence file rather than overwriting them. Try the following:

$ echo This is a line of text > /tmp/file.txt
$ echo This is another line > /tmp/file.txt

What do you get?

Now try:

$ echo This is a line of text > /tmp/file.txt
$ echo This is another line >> /tmp/file.txt

What do you get this time?

OK, for the last few tricks here. Sometimes you want to append STDOUT and STDERR to a file. How do you do it?

$ some-command >> /tmp/log.log 2>&1

The 2>&1 says make STDERR point to the same places as STDOUT. Since STDOUT is open already, and the shell has done a seek to the end, STDERR will also be appended to STDOUT.

If you want to append a line to a file, you can echo the line you want with a redirect, rather than firing up an editor:

$ echo Some text >> /path/to/some/file

It turns out that you can cause the shell to redirect to other file descriptors as well, and if you look in the configure scripts that come with many UNIX software packages, you will see examples of this.

Why is redirecting so important? Well, it is used in many shell scripts, it is a simple and conventient mechanism to sending output to any file without the programmer having to add code for handling command line instructions, and it is the UNIX way of doing things :-).

It is also the same as piping, where you redirect output to, or input from, a pipe device. The pipe device has a process living on the other side, but we will look at this later.

Command line tricks

6:38 PM Posted by whandie

Introduction
I have seen a lot of people who are new to Linux who are aware of the poor scripting tools and command line tools that Windows has; these same people bring the same attitudes to Linux.
Command Line Tricks

The default shell under Linux, bash (the Bourne Again Shell, an old UNIX joke), has a number of very useful facilities.

command and file name completion.
You do not have to slavishly type in the whole of a command's name or the whole of a file's name if it is an argument to a command. bash can complete these things for you if what you have already typed in is unambiguous.

Try for example: mor
That is hit the tab key after tying in 'mor'

Under most circumstances, bash will complete it to 'more ' for you, and wait for you to type in a file name.

Next, try: mo
In this case, nothing happens, except that bash may beep at you. Here, what you have typed is ambiguous, so bash can't complete it.

To see what commands are available, hit the tab key twice in succession. bash will display all the possibilities, and you can usually enter one or two more characters and hit tab again, and bash will complete the command for you.

The same is true for file names as arguments.
bash is a veritable programming language that has variables, programming statements and so forth.

The DOS command prompt is crap by comparison.
Let us say that you are downloading a file, something that many of us do frequently, I think. You want to do something else after the download is finished, and you want to watch it in a window while you do other things in other windows.

Instead of manually entering an 'ls -al ' in a window every now and then, here is an approach that will automatically show you how far the download has got every minute.
while [ 1 ]
do
ls -al ; sleep 60
done

What this does is loop forever (while [ 1 ] says while true do etc)

Then do an 'ls -al' of the file. You will have to specify the file name and path. Then the semicolon allows me to put two commands on the one line.

Then we sleep for 60 seconds, and then complete the loop.
Try it with other commands. You can use it with
ps -ax | grep
to check that a process is still running and so on ...
When you are finished, use ^C (That is control-C) to kill the loop.

Then recall the command (with the up-arrow key) and see what bash has recorded it as. See all those extra semicolons there? That is how you enter the above loop all on the one line ...

Of course, if you want to get a file and then do something after, you could use wget to get the file and simply enter another command after a semicolon of something like that.

Next posting, someone will explain STDIN, STDOUT, and STDERR, along with talking about what is going on with piping commands together. Then we will get to bash variables, and more complex loops.

About File Permissions

6:37 PM Posted by whandie

Preliminary
Each file in Linux inherits a set of properties. One vital set of properties is the file's permissions. Permissions determine what any particular user (or group of users) is able to do that file. File permissions help prevent unwanted deletion and safeguard your data. In order to use Linux's file permissions, you need to understand Linux's categories of users and groups.
Categories of Users

You are asked to enter a login name and password when you first log into Linux. When we talk of a user, we refer to the account issuing commands to the operating system at the time and not to the actual person operating the computer. As soon as Linux authenticates your login name and password you "become" that user and operate using that user account.

Users belong to one or more groups. (The SuperUser allocates Users to particular groups.) Each user has a default group.

Linux organises users into three broad categories (the values in brackets are Linux's accepted abbreviations):
  1. user (u) The owner of the file. A user who creates a file automatically owns it. Only the owner and the SuperUser (alias root) can change the permissions of a file.
  2. group (g) The group of a file. One group of users is given special access to a file. This is determined by the file owner.
  3. others (o) All other users on the system. In other words, every account except the file's owner, or users in the file's group.

File access attributes
Each file has a set of attributes specifying what the user in each category (user, group, others) can do with the file. Here are the three types of access available in Linux:
1. read (r) This category of users can display, but not necessarily alter, the file.
2. write (w) This category of users can alter the file (but not necessarily read it.)
3. execute (x) This category of user can execute (i.e. run) the file.

Displaying file permissions
You can display a file's permissions by executing the ls -l command. Here is a sample output:
lloy0076@localhost bin2dec]$ ls -l
total 23
-rw-r----- 1 lloy0076 root 286 Aug 28 02:17 b2d.lex
-rwxr-xr-x 1 lloy0076 root 20390 Aug 28 02:17 b2d
-rw-r--r-- 1 lloy0076 root 49 Aug 27 22:08 Makefile

You can see the file permissions in the left-most column. The first character is usually a `-' or `d'. This actually refers to the type of the file, and does not refer to the file permissions; a `-' indicates the file is a "normal" file, and a `d' indicates the it is a directory. Other letters indicate files with special meanings to Linux. The next nine characters refer to file permissions.

The first three (of the nine permission characters) shows what access to the file is permitted for the owner; the next three shows the permissions for anyone in the file's group; and the last three are for those classified as other. A letter (r, w or x) indicates that the permission for that particular user, group or other is set, and a `-' indicates that the permission is not available.

Schematically you could represent it like this:
- rwx rwx rwx
type user group other

[-rwxrwxrwx]
The b2d.lex file is owned by the user lloy0076, who can read and write it; anyone in the root group can read the file; and nobody else is permitted any access at all. The b2d file is also owned by lloy0076, who has read, write and execute permission on it. Anyone in the "root" group has read and execute permissions for the file; and so does everyone else.
Changing file permissions
chmod

To change permissions use the command chmod from the command-line. You must be the owner of the file (or you must be the SuperUser.) Take care when changing a file's permissions and be especially careful when you are working with any system files.

The basic format for chmod is:
* chmod [OPTION]... MODE... FILE...

FILE is a file or directory, which will have its permissions set. MODE is the permissions being set on the [FILE].

You can use a number of OPTIONs with chmod. Two useful ones are:
* -v chmod produces verbose output; useful to see exactly what chmod is doing
* -R chmod will descend (recursively) into all subdirectories, changing all file permissions contained within. This means that it will iterate through all the files in all the specified FILE's subdirectories (if it has any) changing them at it goes. This option should be used with care.

You use the `+', '-' or '=' action symbols to add, subtract or set file permissions. Here is how you do it:
  1. Specify the category of users with the abbreviations for the categories (u, g or o). A special category ,'a', also exists which means all users. You can add these together like ug, which means the user and the group
  2. Specify an appropriate action symbol ('+', '-' or '=')
  3. Specify a file access attribute (r, w, or x). As with the specification for users, you can add these together like rw, which means read and write permissions
Here are two examples of how to use chmod on a file called `test'; for our purposes we will assume that `test' has absolutely no access permited at the start:
  1. chmod ug+rx test This gives read and execute permissions to the user and group, the permissions are now -r-xr-x---
  2. chmod a-x test This removes execute permissions from all users, after these two steps, the permissions are -r--r-----
  3. chmod u=x test This sets execute permission, and removes all others, for the owner. After these three steps the permissions are ---xr-----
An easy way to determine what the mode string, ug+rx for example, means is by actually saying it fully out loud. This example would be user; group; add; read permissions; execute permission. Although it is terrible English, it should be plain what this particular mode is trying to achieve.
Conclusion

info chmod and man chmod are both good reference points for chmod. Whilst chmod also understands another way of specifying modes - the octal method - I find it easier to explain this method to new Linux Users. The octal method is adequately explained in the man pages for chmod.

Accessing Removable Media

6:33 PM Posted by whandie

Floppy Disks

There are two completely different ways to access a floppy disk:

1. By mounting it.
Run 'mount -t msdos /dev/fd0 /mnt/floppy' (but check that the directory /mnt/floppy exists first).
After mounting it, the disk is accessible through the directory /mnt/floppy and the usual unix commands will work in that directory (eg. cat, cp, rm, mv). This will work for other disk formats too (eg. Linux ext2, minix, etc if you use '-t ext2' instead of '-t msdos').
After you finish working with the disk (BEFORE ejecting it) you MUST unmount it with 'umount /mnt/floppy'. Note that you cannot unmount a disk if it is in use (that even includes being cd'ed into the mounted directory).

You can (by default) only mount/unmount a disk if you are root. If you want to be able to do this as any user, you need to add a line such as this to the file /etc/fstab:
/dev/fd0 /mnt/floppy msdos noauto,user,exec 0 0
After adding that line, any user can mount or unmount the floppy by typing 'mount /mnt/floppy' and 'umount /mnt/floppy' respectively.

Note:
  • To access the 'B:' drive, use /dev/fd1 instead of /dev/fd0
  • The choice of /mnt/floppy is only a convention; you can pick a different directory if you prefer. The only requirement is that the directory must exist and not be in use.
  • For further information, see mount(8) and fstab(5) (ie. type 'man mount' or 'man fstab').
2. By using the 'mtools' set of programs.
Without mounting a disk, you can manipulate an MSDOS disk by using commands such as:
mdir a:
mcopy file a:
mcopy a:file
mdel a:file

Note:
  • To perform the above commands, the user needs to have the permissions to access the floppy device /dev/fd0. To give everyone on the system read and write permissions to the floppy disk, type the command: 'chmod 666 /dev/fd0' when logged in as root.
  • For further information, see mtools(1) (ie. type 'man mtools').
CDROMs
Presuming that your kernel already supports your CDROM drive, using a CDROM drive is essentially the same as mounting and accessing a floppy drive (so read and understand that section first), with the following differences:
  1. CDROMs use the iso9660 filesystem type instead of msdos.
  2. The customary directory for mounting a CDROM is /mnt/cdrom.
  3. A different device name to /dev/fd0 will be used. Some of the more common device names are:
* /dev/scd0 (SCSI CDROM drive)
* /dev/hda, /dev/hdb, /dev/hdc, etc (IDE CDROM drive)
* /dev/sbpcd (Old SoundBlaster/Panasonic CDROM interface type)

The kernel will display the device name of the CDROM drive when it boots up. To see those messages again, type 'dmesg'.

There may be a link from /dev/cdrom to the real device name. For these purposes, use the real device name.

CDROMs are read-only, so the 'ro' option should be supplied to the 'mount' command.

As an example, here is how to mount a CDROM in a SCSI CDROM drive:
mount -t iso9660 -o ro /dev/scd0 /mnt/cdrom

To allow any user to mount/unmount CDROMs, the line to place in /etc/fstab would be:
/dev/scd0 /mnt/cdrom iso9660 noauto,user,exec,ro 0 0
With the above line added, users can type 'mount /mnt/cdrom/' or 'umount /mnt/cdrom' to mount/umount the CDROM

For further information, see:
* /usr/src/linux/Documentation/cdrom/
* The CDROM HOWTO

Linux Tips Linux, Clocks, and Time

5:53 PM Posted by whandie

Introduction
This document explains how to set your computer's clock from Linux, how to set your timezone, and other stuff related to Linux and how it does its time-keeping.

Your computer has two timepieces; a battery-backed one that is always running (the ``hardware'', ``BIOS'', or ``CMOS'' clock), and another that is maintained by the operating system currently running on your computer (the ``system'' clock). The hardware clock is generally only used to set the system clock when your operating system boots, and then from that point until you reboot or turn off your system, the system clock is the one used to keep track of time.

On Linux systems, you have a choice of keeping the hardware clock in UTC/GMT time or local time. The preferred option is to keep it in UTC because then daylight savings can be automatically accounted for. The only disadvantage with keeping the hardware clock in UTC is that if you dual boot with an operating system (such as DOS) that expects the hardware clock to be set to local time, the time will always be wrong in that operating system.
Setting your timezone

The timezone under Linux is set by a symbolic link from /etc/localtime[1] to a file in the /usr/share/zoneinfo[2] directory that corresponds with what timezone you are in. For example, since I'm in South Australia, /etc/localtime is a symlink to /usr/share/zoneinfo/Australia/South. To set this link, type:

ln -sf ../usr/share/zoneinfo/your/zone /etc/localtime

Replace your/zone with something like Australia/NSW or Australia/Perth. Have a look in the directories under /usr/share/zoneinfo to see what timezones are available.
[1] This assumes that /usr/share/zoneinfo is linked to /etc/localtime as it is under Red Hat Linux.
[2] On older systems, you'll find that /usr/lib/zoneinfo is used instead of /usr/share/zoneinfo. See also the later section ``The time in some applications is wrong''.
Setting UTC or local time

When Linux boots, one of the initialisation scripts will run the /sbin/hwclock program to copy the current hardware clock time to the system clock. hwclock will assume the hardware clock is set to local time unless it is run with the --utc switch. Rather than editing the startup script, under Red Hat Linux you should edit the /etc/sysconfig/clock file and change the ``UTC'' line to either ``UTC=true'' or ``UTC=false'' as appropriate.

Setting the system clock
To set the system clock under Linux, use the date command. As an example, to set the current time and date to July 31, 11:16pm, type ``date 07312316'' (note that the time is given in 24 hour notation). If you wanted to change the year as well, you could type ``date 073123161998''. To set the seconds as well, type ``date 07312316.30'' or ``date 073123161998.30''. To see what Linux thinks the current local time is, run date with no arguments.
Setting the hardware clock

To set the hardware clock, my favourite way is to set the system clock first, and then set the hardware clock to the current system clock by typing ``/sbin/hwclock --systohc'' (or ``/sbin/hwclock --systohc --utc'' if you are keeping the hardware clock in UTC). To see what the hardware clock is currently set to, run hwclock with no arguments. If the hardware clock is in UTC and you want to see the local equivalent, type ``/sbin/hwclock --utc''
The time in some applications is wrong

If some applications (such as date) display the correct time, but others don't, and you are running Red Hat Linux 5.0 or 5.1, you most likely have run into a bug caused by a move of the timezone information from /usr/lib/zoneinfo to /usr/share/zoneinfo. The fix is to create a symbolic link from /usr/lib/zoneinfo to /usr/share/zoneinfo: ``ln -s ../share/zoneinfo /usr/lib/zoneinfo''.
Summary
* /etc/sysconfig/clock sets whether the hardware clock is stored as UTC or local time.
* Symlink /etc/localtime to /usr/share/zoneinfo/... to set your timezone.
* Run ``date MMDDhhmm'' to set the current system date/time.
* Type ``/sbin/hwclock --systohc [--utc]'' to set the hardware clock.

Other interesting notes
The Linux kernel always stores and calculates time as the number of seconds since midnight of the 1st of January 1970 UTC regardless of whether your hardware clock is stored as UTC or not. Conversions to your local time are done at run-time. One neat thing about this is that if someone is using your computer from a different timezone, they can set the TZ environment variable and all dates and times will appear correct for their timezone.

If the number of seconds since the 1st of January 1970 UTC is stored as an signed 32-bit integer (as it is on your Linux/Intel system), your clock will stop working sometime on the year 2038. Linux has no inherent Y2K problem, but it does have a year 2038 problem. Hopefully we'll all be running Linux on 64-bit systems by then. 64-bit integers will keep our clocks running quite well until aproximately the year 292271-million.
Other programs worth looking at
* rdate - get the current time from a remote machine; can be used to set the system time.
* xntpd - like rdate, but it's extremely accurate and you need a permanent 'net connection. xntpd runs continuously and accounts for things like network delay and clock drift, but there's also a program (ntpdate) included that just sets the current time like rdate does.

Further information
* date(1)
* hwclock(8)
* /usr/doc/HOWTO/mini/Clock

Need help finding help topics? Bookmark them

8:57 AM Posted by whandie

Are you having trouble finding a help topic or page that you were reading sometime ago?

Next time you find a help topic that's important to you, try bookmarking it:
  • Open the help file and go to the page that you want to bookmark.
  • Select "Bookmark | Define..." from the main menu.
  • Optionally type in a new bookmark name.
  • Click on "OK"
Now you can retrieve a list of your help bookmarks by selecting "Bookmark" from the main menu of the particular help file.

To share this: BlinkBits | BlinkList | Blogmarks | Co.mments | Connotea | Del.icio.us | Digg | Facebook | FrankIt | Furl | Ma.gnolia | Newsvine | Reddit | Yahoo

Applicable Keywords : Windows NT, Windows NT 3.x, Windows NT 4.x, Windows, Windows 95

How to create a larger and scrollable DOS box

8:55 AM Posted by whandie

If you use Windows' "DOS box" (also called "Command Prompt") frequently, you may wish to have a window that has more than 25 to 50 lines. Even if your display isn't large enough to show more lines, you can still have a DOS box that can have much more virtual lines, so that you can scroll up to view the results of a long operation, for example.
  • Open a DOS box as usual (for example, select "Programs | DOS box / Command Prompt" from the "Start menu"
  • Right click on its title bar and select "Properties..."
  • Change to the Layout tab
  • Change the Height parameter under Screen Buffer Size group to the number of virtual lines you'd like to have in your DOS box.
  • Click "OK"
  • Select a way to save the recent changes, if you get a "Apply Properties to Shortcut" or similar prompt.
Now you can run command line programs that output more than the number of lines you're able to see at once. Simply scroll up to see the output or history you missed.

How to export the Outlook address book

8:55 AM Posted by whandie

Looking for a way to export your Outlook Address Book to another program? Outlook 97 and Outlook 98 doesn't come with a built-in method to export the address book, but if you have Outlook Express 4.x here's an indirect method:
  • Run Outlook Express 4.x (if you don't already have it, install Explorer 4.x full version)
  • Select "File | Import | Address Book..." from the main menu
  • Select "Microsoft Exchange Personal Address Book"
  • Click "Import" and click "Close" once the importing is completed

    To export the address book:
  • Select "File | Export | Address Book..." from the main menu
  • Select "Text File (Comma Separated Values)"
  • Click "Export"
  • Type a file name in the "Save exported file as" input box.
    For example type, "C:\MYADRBOK.CSV"
  • Click "Next"
  • Optionally select the fields you wish to export and click "Finish"
  • Click "Close" once the exporting is completed
You're now ready to import the newly exported Outlook address book (C:\MYADRBOK.CSV file for example) into the program you were trying to export to. CSV (comma separated values) text files are supported by almost all programs with the ability to import information from external programs. Refer to the documentation for further instructions.

How to edit or remove program sounds

8:54 AM Posted by whandie

Are there certain system or program sounds that you want to get rid of or replace with your preferred sounds? For example, if you frequently start and exit certain programs with "welcome sounds," you may want to disable such sounds to create a more silent environment.
  • Go to the Control Panel ("Start | Settings | Control Panel" menu item)
  • Double click on Sounds icon
  • Scroll through the list of event sounds and select the program and the related event that you want to modify
  • Use controls at the bottom to disable (set sound name to "None") or select a different sound
  • Click "OK" and close the Control Panel before testing the event sound

Copying data from DOS / console mode program screens

8:53 AM Posted by whandie

If you're still using DOS or console mode (also refereed to as character mode) programs that doesn't provide a way to export data, you maybe looking for a way to capture what's displayed on such programs. Try this:
  • Start a DOS box or a Command Prompt (DOS box) inside Windows.
    "Start | Programs | Command Prompt / DOS"
  • Run the character mode program that you want to import data from, and go to the screen with the data you want to capture.
  • Right click the title bar of the DOS box
  • Select "Edit | Mark"
  • Click and drag the mouse until you select the data area that you want to copy. Press ENTER when you've finished selecting.
  • Switch to the Windows program that you want to import the just copied data to, and select its paste function.

How to view bootup check disk results

8:53 AM Posted by whandie

Did you miss the chance to view bootup chkdsk results when your computer rebooted?

Whether your computer rebooted with an error while you're away or you scheduled an automated check disk upon bootup, you might not get enough time to examine bootup chkdsk results. The good news is that Windows NT will save this information in the Events Log.
  • Open Event Viewer
    Windows NT 4.x:
    Select "Start | Programs | Administrative Tools | Event Viewer" from the Start Menu.
  • Select "Log | Application" from the main menu.
  • Scroll through the events until you see an event with "Autochk" as the "Source".
  • Double click on the selected event to view the results of previous bootup check disk operations.

Batch downloading multiple web pages and other files without using a browser

8:51 AM Posted by whandie

Looking for a way to download multiple web pages, images or other files from web sites without using a browser?

For example, you may want to do this if the program you're downloading has many parts or if you have a set of frequently updated files that needs to be download every so often. Rather than using a browser to manually start downloading each file, you could call a command line utility that can download individual web files within a batch file.

First, download and install URL2File Windows Application, which is the program we'll be using in this example (URL2File Windows Application is a product of Chami.com). URL2File can retrieve and save the content of a given World Wide Web URL to a local file. So, to retrieve the web page at http://www.chami.com/tips/ and save it to a local file named tips.htm, run the following command from a Windows Command Prompt/DOS Box:
URL2File http://www.chami.com/tips/ tips.htm
Note the format of the above command: URL2File followed by the web page/file address and the name of the file that you want to save the content as.

The next step is to create a batch file that can call URL2File for each file you need to download. A Windows batch file is a text file with a list of commands, usually with the .BAT extension.

Let's assume that there are three files named file1.zip, file2.zip and file3.zip at http://www.chami.com/tips/ that you need to download. To create a batch file to download above files:
  • Open Windows Notepad
  • Enter following three commands into the blank notepad (one command per file to be downloaded):
    URL2File http://www.chami.com/tips/file1.zip file1.zip
    URL2File http://www.chami.com/tips/file2.zip file2.zip
    URL2File http://www.chami.com/tips/file3.zip file3.zip
  • Save the notepad file with a name of your choice followed by .BAT ("download.bat" for example)
Now run "download.bat" from your Windows Command Prompt/DOS Box by typing:
download
and hitting ENTER. The newly created batch file will call URL2File three times for each of the three files and sequentially download them for you. To download other files, simply modify the batch file and run it again.