February 04 2011

The Top Ten Concepts for Linux Beginners – Number 8, Programming Language Support

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , , , , ,

Damn Small Linux can be an ideal platform for supporting a wide range of programming languages. You can even program directly from the command line via a programming shell such as Bash. Major programming languages used in this environment include C, C++, and Java. If you are developing for the Internet you may want to use PHP, a web programming language and MySQL, a language for database system development. All these programming languages are also available in the Windows environment. So the question arises, why would you want to program under Linux rather than under Windows?

Many web developers and Internet service providers feel that Linux provides a more stable web site environment than does Windows. The most widely used web server, Apache, is available under both these operating systems but its new features, security enhancements, and bug fixes always are made available first on the Open Source (LAMP) version. And then they filter down to the Windows version. At the time of this writing the Windows version of Apache has problems with its cryptographic functions.

While programming languages are essentially the same across these two operating systems, their libraries are quite different. Basically, when you write complicated programs you want to make use of as much prewritten software as possible to reduce your programming and debugging effort. One example is handling the graphical user interface. As programmers often say, why reinvent the wheel? Linux provides a wider choice of libraries and graphical user interface toolkits.

When you program in Linux it is often fairly easy to port your programs to the Windows environment. Unfortunately, the inverse is rarely true. Of course as Linux systems become more popular, you will find more and more Windows-based programming systems that enable you to convert your programs to run under Linux. To do so makes clear economic sense.

Program conversion tools may be fairly difficult to develop. For example, executing programs must access the actual computer hardware. As you may imagine Linux and Windows programs access hardware quite differently. The modules that manage hardware access are called drivers. Linux drivers tend to be of higher quality than Windows drivers.

These two operating systems differ substantially in the way they manage programs during their execution. In other articles we discussed Linux’s increased security compared to Windows. We conclude this article by repeating a point that we have often made; you can run Damn Small Linux and its associated applications on very reduced hardware. You can do Linux, PHP, and MySQL development on old computers, ones that may have seemed ready for the garbage heap. In contrast many Windows competitors such as SQL Server Developer Edition require substantially more powerful computers, the kind of computers that people purchase for one or a few thousand dollars. When your programs will be used by dozens of people simultaneously, you will need powerful hardware. Don’t forget the operating system; can you guess which one we recommend? Our next subject is the graphical user interface.

October 24 2010

The Top Ten Reasons for Learning Linux, Number 6, Linux and Php

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , ,

In this article we examine some programming languages used to build dynamic websites that interact with databases. These server-based languages are a major step up from traditional web page development languages such as HTML which run on the client computers. The Open Source product is PHP (which stands for Hypertext Preprocessor). The Microsoft competitors are ASP (Active Server Pages) and ASP.NET (Active Server Pages in the Microsoft .NET environment.) ASP.NET is more expensive, more complicated, and more powerful than its sibling. For simplicity’s sake we refer to Microsoft’s offerings as ASP.

As you know PHP is free. ASP is also free but to run it you may need Microsoft’s IIS (Internet Information Server) which is not free. Uploading, downloading files, encrypting passwords, and sending emails from web pages will probably cost you much more money with ASP than with PHP. As discussed in our previous article (Reason 5 Linux, Apache, and MySQL) LAMP’s database management system is either free or quite inexpensive when used with massive databases. In contrast Microsoft’s SQL Server is pricey. I should let you know that my Internet Service Provider usually charges for MySQL accessibility. When available SQL Server access will you cost more. We have been through the monetary issues before. Let’s compare some other aspects of these two web programming languages.

Perhaps not surprisingly ASP resembles Microsoft’s popular Visual Basic programming language. PHP is based on the C++ programming language, a much more professional solution than Visual Basic. For technical reasons PHP programs tend to run faster than their ASP counterparts, even if the latter requires more powerful hardware. Because it is open source, PHP has access to a wider range of individuals who increase its functionality. PHP talks to a wide range of databases, but focuses on MySQL databases. In contrast ASP works best with SQL Server. While you can mix and match you are usually best off to combine components on the same side of the LAMP/Microsoft fence. After all, they were built to work together.

Despite Microsoft’s unbelievable clout, PHP is the most popular web programming language. Some reasons for its success are speed, increased security, and ease of programming. Once again in my opinion, whenever there is a real contest Microsoft comes up short. An ever-increasing number of computer specialists agree with me.

Maybe you are not interested in learning three or four products. (Who can blame you?) What you really would like to get the most out of an old computer that’s collecting dust in the basement. Here Linux really wallops Windows as seen in our next article.

Once upon a time Levi Reiss wrote ten computer and Internet books either alone or with a co-author. Now he has moved on to building websites, including global wine (www.theworldwidewine.com), Italian wine, Italian travel, and health and nutritional aspects of wine. He has taught various and sundry computer courses including Linux and Windows operating systems at an Ontario French-language community college for decades. His new website http://www.linux4windows.com will get you to run Linux even on that outdated Windows computer in your basement but first you must remove the dust bunnies.

Incoming search terms for the article:

September 23 2010

The Top Ten Concepts for Beginning Linux Users – Number 4, Permissions and Groups

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , ,

The easiest way for you to learn Linux permissions is to study an example. The ls -l command generates a list of contents, such as files along with their permissions. Let’s take a look at the default values for a file called Filename. We are adding spaces to make the output more legible.

- rw- r– r– other information about the file Filename

The initial – signifies that this is a file (not a directory). The next three characters refer to the file permissions for the file owner, in many cases the person who created the file. The values rw- signify that the owner has read and write (modify) permission but not execute permission. Had these values been r-x the owner would be allowed to read and execute the file (program) but could not modify it. The second set of values r– signify that the members of the group associated with this file have read but not write or execute permission. The third set of values once again r– signify that other users have read but not write or execute permission.

Permissions are often handled numerically. The r has a value of 4, the w has a value of 2, and the x has a value of 1. In all cases the lack of permission has the value 0. So rw- has the value 6 and r– has the value 4. In the above example the permissions may be expressed as 644. The full set of permissions for everyone is expressed as 777 (not usually a good idea).

Note that the root user’s permissions aren’t listed. This shouldn’t be surprising because root has essentially complete permissions. But even root doesn’t have execute permissions for a file it creates. This permission must be added in a separate step. Why? This two-step procedure has important security implications. Let’s say that an individual, perhaps root, has received an email that contains a virus-infested executable program. The program cannot be executed without the explicit permission of root or the recipient. If the user doesn’t know what to do the virus won’t be launched.

Linux defines permissions for directories that are similar to but not exactly the same as the file permissions. A read permission on a directory means that its contents may be listed. For directories write permission means that the user can modify its contents by adding, deleting, or renaming files. An execute permission on a directory means that it may be accessed, in other words made the current working directory.

Permissions may be changed via the chmod command. For example chmod 770 Junque which gives read, write, and execute permissions to the file owner and members of the ownership group but no permissions to anyone else. Many people prefer not to use these numbers. The symbolic mode uses letters and the plus and minus signs to change permissions.

The following command removes the write permission from the user (owner) of the Perm file chmod u-w Perm. To add the execute permission for others, those people who do not belong to the group that owns the file, apply the command chmod o+x Perm. This command only makes sense if the Perm file is executable. Furthermore, often the file owner and his or her group are granted more permissions that the others. Linux doesn’t check to see that your command really makes sense. Do you think that Windows is more intelligent in this respect?

The chown command is used to change the ownership of a file or a directory. The chgrp command is used to change the group ownership of files and directories. These commands might be used when a project passes from the development to the testing stage. Needless to say only the system administrator can execute these commands.

Of course there are additional aspects of Linux permissions and groups but we have covered the basics. The next article in this series discusses inodes, a topic that is sorely missing from the Windows bag of tricks.

Over the years Levi Reiss has authored or co-authored ten books on computers and the Internet. As you can tell from his wine websites including www.theitalianwineconnection.com he is quite a fan of fine wine, but always in moderation. He teaches various and sundry computer courses including Linux and Windows operating systems at an Ontario French-language community college. Visit his new website http://www.linux4windows.com teaching you how to download and run Damn Small Linux even on that outdated Windows computer which has been gathering dust in the basement.

September 22 2010

The Top Ten Concepts for Linux Beginners – Number 5, Inodes

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , ,

Linux functionality is often found, albeit in a different form in Windows. Inodes, the subject of this article, are an exception to this rule. Because of their practicality, Windows now includes an imitation of this functionality. But if you want to take full advantage of this somewhat complicated concept, you’ll have to go to Linux or Unix.

So what are inodes and why would anyone want to use them? Inodes are the internal description of a file. As we will see below, the specific inode contents for a given file are different in memory and on disk. But the key to the inode is that a single file may have different names. Why would anybody want to do that? One very important reason is that a user may access a shared file by an intuitive name. Accounting department users could give a certain file an accounting-style name, while users from the marketing department could access this same file by a name that makes sense to them. This functionality alone makes inodes worth while.

Furthermore, let’s say that by accident the “accounting” file was deleted. Accounting users could still access that file if they knew the “marketing” name. Remember, we are talking about one single file that has different names. People don’t have to know about these complications to be able to access the file. The extra processing is carried out behind the scenes.

Now let’s examine inodes more closely. The inode on disk contains the following information: file owner identifier, file type, file access permissions, file access information, number of links, list of data addresses, and file size. The file owner identifier specifies the file owner and the group owner as discussed in our article on permissions and groups. The file type indicates whether we are talking about a regular file, a directory, or something else. The file access permissions denote the permissions, also discussed in a previous article. A given file may have different permissions for different users, for example accounting users may have permission to read and modify the file while marketing users only have permission to read it.

File access information specifies when the file was last accessed, last modified, and when the associated inode was last modified. The number of links indicates the number of names that the file has. In our example, the file has two links. If either accounting or marketing delete the file (assuming that they have such permission) the number of links is reduced to 1. But the file is still there and the number of links could be increased.

The inode on disk provides a list of data addresses; the single file may be scattered across the disk. The final value is the size of the file in bytes.

The inode in memory contains all of the above information plus additional information, for example, whether the file is available for processing (someone else may be using it) and whether someone is waiting to process the file. Remember, several people may be using Unix or Linux simultaneously. If there were no file usage control two different people in accounting could pay a bill at the same time. Windows doesn’t have this problem; it’s not a multi-user system.

The ln command is used to create a link to a given file. For example, ln acct1 mark1 links the mark1 file to the acct1 file; it makes the name mark1 available for the acct1 file. It’s the same file, but with a new name. The ls ‘i command provides information about the file including the number of links (the number of names for the file.)

The next article in this series discusses the Linux kernel and processes.

Over the years Levi Reiss has authored or co-authored ten books on computers and the Internet. As you can tell from his wine websites including www.theitalianwineconnection.com he is quite a fan of fine wine, but always in moderation. He teaches various and sundry computer courses including Linux and Windows operating systems at an Ontario French-language community college. Visit his new website http://www.linux4windows.com teaching you how to download and run Damn Small Linux even on that outdated Windows computer which has been gathering dust in the basement.

September 14 2010

Top Ten Reasons to Learn Damn Small Linux – Number 2, Lots of Free Applications

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Just to set the record straight, we must tell you that Microsoft Windows comes with plenty of free applications. The most widely used freebie is Internet Explorer. To find most of the others go to Start, All Programs, Accessories, and start clicking. Why don’t you take a look right now? Outside of Internet Explorer how many free Windows applications do you actually use? When you feel like word processing do you fire up Notepad, Word Pad, or Microsoft Word? Guess which two of these word processors are free.

Equipping an office with the standard Windows applications is an expensive activity. Some Microsoft applications make you purchase the software itself and then pay additional licensing fees when you connect your Microsoft client computer to a Microsoft server computer.

Damn Small Linux applications are free. Some of them are included with the initial download while others have to be downloaded and installed subsequently. There are several reasons for this seemingly intricate procedure. Not everybody wants to use the same applications. Furthermore, the very strict selection of the applications in its base package helps the Damn Small Linux distribution to respect the hard to believe 50 Megabyte limit. Once you have installed Damn Small Linux you can download Open Source (free) versions of Office and run them under Linux. Please note that you can download and run these programs under Microsoft Windows as well.

All work and no play makes Jack a dull boy. Well Jack doesn’t have to worry if he’s running Damn Small Linux. It comes with lots of free games. Somehow we have the impresssion that you will not need any tutorials to get the games running.

Some Linux applications are not only free but are actually superior when compared to the corresponding Windows applications. For example, have you ever heard of an e-mail client called Sylpheed? This application is part of the basic Damn Small Linux distribution. It has several advantages over those extremely popular (perhaps we should say unpopular) Microsoft e-mail offerings, Outlook and Outlook Express. Sylpheed handles spam much better than do its Windows counterparts. And Sypheed allows you to process threads of e-mail messages. For example, you correspond with several people about wholesale wine purchases. Sypheed makes it easy to process those messages while ignoring unrelated ones.

Since we’re talking about email, what about it’s cousin the Internet? That will be the subject of our next article in this series.

Once upon a time Levi Reiss wrote ten computer and Internet books either alone or with a co-author. Now he has moved on to building websites, including global wine (www.theworldwidewine.com), Italian wine, Italian travel, and health and nutritional aspects of wine. He has taught various and sundry computer courses including Linux and Windows operating systems at an Ontario French-language community college for decades. His new website http://www.linux4windows.com will get you to run Linux even on that outdated Windows computer in your basement but first you must remove the dust bunnies.

September 12 2010

The Top Ten Concepts for Beginners to Linux – Number 3, Users

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , , ,

Unlike Windows, Linux users must have an account. This account is accorded permissions such as reading and writing files and executing programs. Accounts are combined into groups to simplify their management. Users who are members of a given group may be assigned additional permissions that smooth the process of accessing common files. Let’s take a closer look at how Linux handles these users. A future article examines permissions and groups.

Linux provides two categories of users, ordinary users essentially restricted to working with files of their own creation, and the superuser, or root, who administers the system and is allowed to do almost anything. The real situation is of course somewhat more complex. For example, ordinary users may be accorded restricted access to additional files deemed to be of interest to everyone. The superuser can assign some privileges to deputies reducing an otherwise crushing workload.

The root user is the only one authorized to run the adduser or the more complicated useradd command. If you have downloaded Damn Small Linux you can test these commands on your Windows computer. In response to the adduser command Linux requests the user name, the password, and then a few optional fields that may be skipped. An organization with many users has or should have a policy for composing user names.

The password is a key element in protecting the computer’s security. We could easily write an article discussing the password and password selection. Remember that Linux distinguishes between lower-case and upper-case letters. If you’re new to computing you may try working with easily remembered passwords at first. But protecting your account and account information depends on your unguessable passwords.

When Linux creates your account it also creates a directory whose name is easy to remember. If your account name is lucy then your working directory is /home/lucy . I’m leaving it up to you to find out the location of lucy’s working directory for Windows systems.

Damn Small Linux shares an interesting feature with many other Linux systems. The system administrator can provide new users with copies of some directories and folders by placing them in the /etc/skel directory before launching the adduser command.

How is the system administrator supposed to handle creating dozens, hundreds, or even thousands of new users, for example at the beginning of the semester? He or she won’t have the time to undertake this backbreaking task. And there is no way that the root password should be revealed to the employee who is assigned this task. The answer is simple: write a program to create these new accounts. This program can even spiff up the account creation interface and perhaps grab some necessary information from sources such as the student registration file.

Of course we don’t want to create users without the possibility of removing them. The live process is fairly complicated and includes removing the user’s password from the /etc/passwd directory, removing all files from the user directory, and other activities such as making backups of essential information. The next article discusses the related concepts of permissions and groups.

Levi Reiss has authored or co-authored ten books on computers and the Internet. He loves the occasional glass of wine as exemplified by his wine websites including www.theworldwidewine.com. He teaches Linux and Windows operating systems plus other computer courses at an Ontario French-language community college. Visit his new website http://www.linux4windows.com which enables you to download and run Damn Small Linux on even outdated Windows computers.

Incoming search terms for the article:

August 28 2010

Top Ten Concepts for Linux Beginners – Number 2, Directories

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , , ,

Linux people like to claim that directories are really just another type of file. This statement can be misleading. We saw in a previous article that you create a file using a file editor. We will see later in this article how to create a directory.

So just what is a Linux directory? A directory is a collection that may include one or more directories, one or more files, or in fact be empty. You may think of a directory as a computerized file folder or loose-leaf notebook that contains dividers (themselves directories) and pages (files.) Just like a notebook page may not contain a divider, a Linux file may not contain a directory.

Up to now our comments about Linux directories hold for Windows directories as well. Now let’s take a look at some differences between these two systems. First come the naming conventions. Linux always distinguishes between lower-case and upper-case characters in directory names. Microsoft Windows does not. For example, Linux treats pay12june and Pay12june are as two different directories, as different as the directories pay12june and heighho. These directory names were used as file names in the previous article. While Linux does have some reserved directory and file names, in general one cannot tell by the name whether it is a file name or a directory name. So be careful. Linux helps you out here ‘ the ls command that lists the contents of a given directory usually displays files and directories in different colors.

Directories are hierarchical. They resemble a tree or a family tree. But unlike a tree (or Microsoft Windows) Linux has only one root. The root, designated as / lies at the top, rather than at the bottom, of the hierarchy. Right underneath the root directory you will find several subdirectories. For example, the /home directory is a child of / the root directory. The number and names of the first-level subdirectories vary from one version of Linux to another. For example, some Linux distributions include a /root directory while others do not. The /root directory (or subdirectory, both terms are used) is a child of /, the actual root directory.

The /home directory is an important directory. It is divided into subdirectories, one for each user. We like to work with Damn Small Linux, a free version of Linux that runs on the Windows desktop and requires only 50 Megabytes of disk space. Damn Small Linux automatically creates a user called dsl whose home directory is /home/dsl ; a working area essentially reserved for this user. All Linux versions subdivide the /home directory into user subdirectories according to this simple naming convention.

Linux provides several commands to process directories. For example, the mkdir command creates a directory. The rmdir command removes a directory, but in the simplest case only when it is empty. The cd command changes the working directory, the directory in which you are positioned. The pwd (print working directory) command displays (not prints) the working directory. Beginners should run this command often to reduce errors. For example, if you, the dsl user, think that you are positioned in the /home/dsl directory but in fact are positioned in the / directory you won’t be able save your files with a simple command. Why? Because you lack the requisite permission, the subject of our next article.

Levi Reiss has written ten computer and Internet books either alone or with a co-author. The books are over, at least for the time being, replaced by a multitude of websites, including global wine, Italian wine, Italian travel, and health and nutritional aspects of wine (www.wineinyourdiet.com). He has taught various and sundry computer courses including Linux and Windows operating systems at an Ontario French-language community college for decades. His new website http://www.linux4windows.com teaches you how to download and run Damn Small Linux even on that outdated Windows computer which you have been meaning to throw out.

Incoming search terms for the article: