Linux Articles

Friday, June 30, 2006

System Administration: One Step toward the BIND

By Tom Adelstein on Tue, 2006-06-27 14:41.

DNS is mostly a directory service. Millions of people and computers use one or more directories every day. Currently, so many directories exist in our world that they have become almost transparent to casual observers. You could say it's a directory kind of world out there and http://www.linuxjournal.com/user/801140remains a big part of it for people who use the Internet regardless of the device.

In the old days, people often referred to directories as databases and technically they were right. Directories and databases share many characteristics such as the storing of information and the ability to rapidly search through that data. Think of how many times you use your cell phone as a database for personal contacts. In fact, your cell uses its address book as a directory to rapidly find and dial people's telephone numbers.

Directories also differ from databases because people tend to read the contents of a directory far more than they write to it. Directories don't require support for transactions, indexes, triggers and storing of binary objects. Directories provide information people and programs need to perform some activity and directories provide the information quickly.

You might wonder why system administrators have to know the inner workings of DNS. It's a directory, right? People have stored the information in the directory and computers use that information like a phone book. After all, when I bought my domain name, I provided all that contact information and so on. Souldn't that information already exist in my top-level domain server (TLD).

Don't forget, you provided the names of two or more domain name servers. One of those servers will act of the primary directory people will use to look up your domain. The others will act as backup DNS servers. When you specified those servers, you took on the responsibility of creating entries in the Domain Name System for your domain(s).

DNS directories differ from others in the way they're managed. Once someone gets the rights to a domain, a registrar submits the domain name to a TLD server. The registrar also submits the names and IP addresses of the DNS servers that will contain information about the newly registered domain.

Once the submission becomes part of the TLD collection then a system administrator must take over and manage the IP addresses and their respective common names. We call the DNS directory distributed because you have to manage your part of it independently.

As the administrator you're supposed to make sure your servers stay on-line so people can find your web sites. It means you have to correctly map a web site name to its correct IP address using standard DNS protocols.

Web-Enabling Applications?

Aside from security, stability, and accuracy, putting DNS into your infrastructure provides other benefits. It allows you more scalability. This becomes important if you own and operate several active domains or internal authentication services. In short, it's valuable to control your own DNS in today's business environment, instead of having somebody else doing it.

Many companies have web-enabled their core business applications and must maintain their own DNS servers. Businesses do not normally replace working applications. They consider it too costly to upgrade and/or migrate legacy systems. An old saying applies here, "if it ain't broke - don't fix it".

Even so, businesses understand they must keep up with new technologies or lose customers to competitors. It creates a dilemma. If you run a business you have to weigh the costs of upgrading your business applications against the cost of losing business.

So, an industry emerged to help businesses keep their existing legacy applications while modernizing them at the same time. This concept began with a couple of small start-ups in Silicon Valley and grew quickly. The idea worked so well that the major ERP vendors bought out those small start-ups.

Now, companies like SAP and Oracle have web enabled legacy systems. They do this by adding web front-ends while using web-based back-ends to connect disparate systems together. DNS becomes an integral part of web-enabling since such systems need directory servers that can communicate with one another.

DNS also holds a prominent place with the emergence of web services and an executable Internet where people can use applications such as those offered by Google, Yahoo and others. Resolving IP addresses quickly and dependably becomes critical to the success of these products outside on the Internet and inside enterprises.

DNS directories also help manage Local and Wide Area networks. With this requirement DNS configuration and management has become one of the more valuable system administration skill sets to have.

Terminology

As you begin to learn DNS jargon, you will find it unintuitive. In many ways, the jargon feels like a foreign language. It won't make a lot of sense until you work with it for some period of time.

Linux distribution offers the well-known package called BIND to perform DNS functions. Alternatives to BIND exist such as the djbdns suite. Still, many people agree that system administrators should start with BIND because it runs almost all the DNS servers in the world. We won't offer a history lesson on BIND because the subject will put readers to sleep.

Still, we need to address one historical concern. Some people continue to use an antiquated or deprecated release of BIND - version 4. In this series, we'll use the newer releases of BIND 8 and 9. We won't cover BIND 4.

If you work on a system with DNS configuration files that look different from the syntax shown in this series, it's probably because the system uses BIND 4. Like we said above, businesses don't usually replace working systems. It may require a catastrophe to get someone to upgrade to BIND 8 or 9. Because of the potential for security exploits in BIND 4, you should strongly suggest to any user of a BIND 4 system to upgrade.

Name Servers Hosting Other Domains


Think of DNS like you would a telephone directory. If you want to find John and Jane Doe in the phone book, the phone company publishes that information. But if you want to find janedoe.com; a system administrator has to come forward with the name and number and make it part of the distributed DNS directory.

How do admins do this? They create their listing in what DNS aficionados call zone files.

A zone holds the information for a domain or using our phone book analogy for a household. You might have fifteen kids living in the house and you could reach each one of them at the same address and phone number when they're at home. Similarly, you might have fifteen servers and they all live in the same data center.

Part of BIND's versatility allows you to manage multiple zones on one server. To illustrate this, let's say that you administer a server that hosts five different web sites, each with a completely different domain name. Suppose one is red-domain.org, while the others are red-kid.com, red-sister.org and so on. All the owners of the web sites ask you to manage their DNS records.

Each web site is in a different domain. So you have to write a zone file for each web site. In the registrars' databases, your server will be listed as the name server for those domain names.

So, server1.red-domain.org is listed as the guy you contact to find the other kids in the house, like red-kid.com, red-sister.org and the others.

Let's say that someone out there is looking for one of the kids and they call you. You have so many kids and now they each have a cell phone and you forget their numbers. So, you have this listing of your own. It's a directory and you look in it to find which kid is living in the house now and has a cell.

You look in your directory and discover who is there today. You call that little directory /etc/named.conf, which is the name of BIND's configuration file. In a sense, /etc/named.conf is your directory listing of zone files. It provides you with information about the location of each zone on your system. We'll talk about that in the next article.

A Little Something About BIND

Linux distributions typcially use BIND as their default name server. BIND comes with three components. The first is the service or daemon that runs the answering side of DNS. It answers the door when the bell rings. On your system, you'll find the doorbell answerer under the daemon called named (pronounced name-dee).

We call the second item in the BIND bundle the resolver library. The resolver works like a negotiator without an accent. It goes out and looks up the name of a web site and then finds the IP number so you can find the right computer out there in the Internet jungle.

Some folks think of a resolver as a client inside BIND. The resolver code makes queries of DNS servers in an attempt to translate a name to an IP address. You will find that this piece of BIND uses its own little directory called resolv.conf .

Here's the kicker; you also get to configure resolv.conf . Unlike the server, the client is no single program, instead it's a library that the other kids like the web browser or email client can read to resolve a name.

The third part of BIND provides tools like dig command for testing DNS. Go to your console and type dig yahoo.com and see what happens. Later, we'll discuss dig and the other guys in this tool kit.

For now, I just want to get you familiar with some concepts like zones and the idea of configuration files in the /etc/bind directory. Next time, we'll install Bind9 on a Debian system, put it in a chrooted environment and set up a zone to manage. Until then, have some good old July 4th fun.

DNS: The Bind Leading the Bind

By Tom Adelstein
on Wed, 2006-06-14 16:20.

Hiding beneath the surface of your web browser, email and instant messaging lies a phone book for computers on the Internet. We call it Domain Name System or DNS. It looks up the names of other computers and calls them to chat, shake hands or whatever PCs do with their own kind.

Aside from hiding beneath hundreds of millions of people's awareness, some people know that DNS seems to like Linux. In fact, they're sort of made for each other. You can get Linux for free and the software for DNS comes packaged with Linux distributions and it's also free.

Almost universally DNS servers run Berkeley Internet Name Domain or BIND. Any one wanting their own web site and/or domain needs two domain servers. That's just one of the rules of the game. Obviously, the requirement for two servers made Linux the choice of ISPs and system administrators because it saves people money.

So What

If you want to work as a Linux sysadmin and travel that career path, then you'll need to learn DNS. That's where the other shoe drops. Keep reading.

The big directory runs in a distributed mode and it wants the owner of a domain to provide it's own directory listings. Basically, you have to write your part of the DNS system because the rest of the Internet depends on you doing that.

A slight catch exists. The Internet Engineering Task Force (IETF) established our current DNS protocols long before the enormous growth of the Internet. No one really knew if it would scale.

Funny as it may seem, DNS worked even under the tremendous stress placed on it as the Internet grew exponentially. The Domain Name System simply grew as the Internet grew. And while the current system remains a bit archaic, it works and it works well.

It just requires a set of skills popular well over two decades ago. The standards of DNS did not have a chance to adjust their technical underpinnings while the great Internet adoption took place. The protocols came into existence in 1985. Oh, did I mention that those protocols lack something we call intuitive.

Do I Have To?

Simple answer: yes. Linux system administrators have to learn DNS. Even if you off-load your DNS to a service provider, you'll likely wind up getting all or part of it back. The Internet continues to change and the demands requiring the resolution of friendly names like domain.org to an IP address has become mission critical.

Let's look at the reality in the market. Businesses, especially big ones, hate to change their systems. Forget the noise people make about migrating or upgrading this or that. Big orgs hate it.

But, Big orgs also have to keep current or they'll get bloodied by nimbler businesses using new standards and protocols. Just so those angry Big orgs can keep their legacy applications in use by let's say 100,000 employees on terminals or PCs, a new industry emerged. We call it the web-enablement segment.

Along comes application servers like JBoss and WebSphere and suddenly disparate silos of servers start speaking to each other. Then we have front-end applications speaking to their supply chain while customers and vendors come into the enterprise.

The rest of the world doesn't even know that another layer of applications surrounds those legacy apps and data repositories. It reminds me of the convergence of public libraries. One on side of the Ethernet lies the library's old database. On the other side lies a LAMP application talking to other servers as if they all had the same MySQL database engines full of book titles, authors and subjects.

How does all this work? Oh, it works because a twenty year old directory with a billion entries almost instantly looks up a name, translates it to a number and let's those babies chat, shake hands and do whatever PCs and their kind do.

It's Archaic and Unintuitive?

You can take that to the data center or is it the server bank? Yes, it's old and cranky and doesn't like GUI front-ends. It wants you to write everything by hand on the command line.

Every time you make a change, it wants you to restart it. It says it doesn't want any more of a certain kind of record and then the people at Apache make their server do something cool and you have to put those deprecated record types back into the configuration files.

Guess what else. It's installed base is so big, it won't start migrating and upgrading anytime soon. Like those Big orgs that hate to change - you can add the Internet DNS system to that angry bunch.

Should I Buy a Book?

You can buy a book or take Ambien CR. Either way, you get plenty of sleep. Reading the book might cause irritable neck syndrome.

So, poke around the Internet and look for readable tutorials and howtos. Or wait and catch the rest of this series as we head into the underground caverns of resolver libraries, zone files, hints and local zones to mention a few.

Until then, enjoy.

-------------------------------

Tuesday, June 27, 2006

Lenovo backpedals on Linux

Jun. 06, 2006

Last week, the world's #3 computer vendor, Lenovo, was saying "We will not have models available for Linux, and we do not have custom order, either. What you see is what you get. And at this point, it's Windows."

Whoops!

Now, Lenovo is going back as fast as it can on its "no Linux here" stance.

In an interview with John Spooner of eWEEK, Godin Marc, vice president of marketing for notebooks at Lenovo said, "Lenovo's Linux strategy has not changed … compared to what the IBM Linux-related strategy, related to the PC environment, was."

In fact, Marc insisted, "We're about to reinforce that strategy and go beyond what IBM [Personal Computer Division] or Lenovo, until now, was doing in terms of its commitments to the Linux community … and to our business partners who want to use Linux."

That doesn't mean you can get Linux pre-loaded -- unless you're an enterprise sized company. But, what it does mean is that Lenovo will be offering more technical support for users running particular versions of Linux on ThinkPads and ThinkCentre desktops, In particular, Lenovo has been working with Novell on support for its latest version of SUSE Linux.

Don't be surprised if, sometime soon, when you order a couple of hundred ThinkPads or ThinkCentre desktops, SUSE Linux Enterprise Desktop 10 is one of your choices.

The company is also seeking third-party Linux certification for its Lenovo 3000 PC line. While it has no plans to offer Linux on this line, it would be more than happy to have some of its resellers offer a selection of certified Linuxes on the 3000s.

In short, Lenovo has returned to IBM's old pro-Linux position, but with a little more support for Linux. I, for one, find it interesting that they're encouraging resellers to offer Linux on its SMB (small-to-medium businesses) 3000 line.

It will be interesting to see how Lenovo's born-again Linux conversion works out. Still, for now, it's good to see the company back in the Linux flock.


-- Steven J. Vaughan-Nichols

Apache servers gone

Jun. 08, 2006

At first glance, Netcraft's June 2006 Web server survey looks like bad news for Apache. And, since the vast majority of all instances of Apache run on Linux, bad news for Linux in one of its strongholds: Internet servers. A closer look, though, reveals a different story.

First, the bare, unadorned facts: the number of hostnames on Windows servers grew by 4.5 million. This gave Microsoft a 29.7 percent market share. That's a gain of 4.25 percent for the month. Apache had a decline of 429 thousand hostnames. That was a drop of 3.5 percent.

Still, that leaves Apache, and thus Linux, with the lion's share of Web servers: 61.25 percent.

If you take a look at the last three months, though, Windows IIS (Internet Information Server) numbers have taken a tremendous jump. Apache's lead over Microsoft, which stood at 48.2 percent in March, has been narrowed to 31.5 percent, a shift of 16.7 percent in just three months.

What happened? It's not like there's been some horrible security problem discovered with Apache, or Microsoft has dumped the price of IIS to zero dollars and zero cents.

Well, actually the last reason does have something to do with it. Most of Microsoft's gain, and Apache's loss, came from Go Daddy, a popular, cheap Web site hosting company, moving 1.6 million parked hostnames from Apache to IIS

A parked hostname is one that doesn't actually have a site. It's nothing but a place holder site, while the domain owner hopes that someday, somehow, someone will pay them big money for the domain name.

Still, as Netcraft notes, "While those parked domains were a major factor in Microsoft's gains, Windows also saw solid growth in active sites, hostnames that contain content and likely to represent developed web sites."

That's because in addition to Go Daddy, six other major hosting companies reduced their use of Linux by 40 thousand sites or more. This included the major UK provider PIPEX Communications PLC; Lycos Inc., better known as a Web portal; and New Orleans-based Zipa LLC.

Why? In a NewsForge interview with Go Daddy group president and COO Warren Adelman in April, Adelman said, "This was for one particular part of our infrastructure for parked domains. ... It was just one piece of infrastructure."

"Certainly Linux running Apache is an integral part of what we do here at Go Daddy," Adelman continued. Adelman declined to answer NewsForge reporter Jay Lyman's question about whether one reason why Go Daddy had moved its parked domains to IIS was because Microsoft has offered them a sweetheart deal on the Microsoft Web server.

Maybe I'm just a wee-bit suspicious, but it strikes me as likely that Microsoft did offer at least some of the Web-hosting companies an inexpensive "upgrade" to Server 2003 and IIS. For a small loss in the sale, Microsoft would gain some much needed PR for its Web server line.

After all, after being number two and never, ever coming close to catching up, I could see how Microsoft would want to manufacture some good news for Server 2003 and IIS at the expense of Linux and Apache.

However, after considering those millions of idle parked domains, this move strikes me as more pathetic than convincing.


-- Steven J. Vaughan-Nichols

Book covers setting up using and hacking Ubuntu

Ubuntu Hacks, a new volume from O'Reilly Media ($29.99), explains the phenomenon of Ubuntu's popularity, expounds on its use, and offers easy-to-understand "hacks" -- that is, how to tweak it to do exactly what you want.


Don't be put off by the title. While "hacking" has a bad reputation in the press today, the term originally referred to solving difficult problems or devising a creative ways to get something done.

O'Reilly's Hacks series -- of which Ubuntu Hacks is the latest -- is an attempt to reclaim the word, document the good ways people are hacking, and pass the hacker ethic of creative participation on to the uninitiated, the publisher said.

Co-authors Jonathan Oxer, Kyle Rankin, and Bill Childers detail exactly 100 "hacks" you can use to set up a printer, tweak the GNOME or KDE desktops, rip and encode DVDs, connect multiple displays, or post a blog. If those don't interest you, perhaps some of the 96 other good bits of advice will.

The book is organized in 10 chapters:

Chapter 1 -- Getting Started
Chapter 2 -- The Linux Desktop
Chapter 3 -- Multimedia
Chapter 4 -- Mobile Ubuntu
Chapter 5 -- X11
Chapter 6 -- Package Management
Chapter 7 -- Security
Chapter 8 -- Administration
Chapter 9 -- Virtualization and Emulation
Chapter 10 -- Small Office/Home Office Server

Topics covered range from simple tasks such as test driving Ubuntu on your hardware using the live CD, installing and configuring a permanent install on your hard drive, and using typical applications; to installing and configuring file, web, email, proxy, dhcp, and domain name servers; to advanced system hacks and tweaks.

You can view the entire table of contents, read an overview and early reviews, and see some sample chapters here.

Summary:

Title -- Ubuntu Hacks
Authors -- Bill Childers, Jonathan Oxer, Kyle Rankin
Publisher -- O'Reilly
Publication date -- June 2006
ISBN -- 0-596-52720-9

Linux-based enterprise firewall available free

Aug. 18, 2005

Trustix announced that the latest version (v4.6) of its Linux-based Enterprise Firewall will be available at no charge for one year, with full payment due thereafter if the user chooses to continue using it. The software provides a user-friendly "drag and drop" graphical user interface, instead of the command-line approach of many Linux firewalls.

XSentry enables administrators to visually configure firewall policies, "demilitarized zones," and virtual private networks (VPNs) by simply clicking and dragging connections between servers. The underlying rules generated by the program are then fully optimized before being deployed. This approach reduces the administrator mistakes that often plague other firewalls, Trustix said.

Key improvements in v4.6 are said to include:

* Enhanced Multi-Platform GUI Interface
* DHCP Server and Relay support
* Enhanced monitoring and alerts
* Advanced logging
* Advanced high availability capabilities


The Enterprise Firewall 4.6 is available on the Trustix community website.

Enterprise Windows-to-Linux migration tool goes gold

Aug. 17, 2005

Resolvo Systems has announced the release of its MoveOver Enterprise desktop migration tool. Similar to its standard software, which the company released to the open source community last April, this new edition is a wizard-driven tool for Windows-to-Linux desktop migration on an enterprise scale.

MoveOver automates the migration process, allowing users to move their files, settings, and emails from Windows to Linux desktop within six steps, according to the Singapore-based company. It also supports installation of a pre-configured Linux operating system to each desktop.

MoveOver Enterprise remotely manages large-scale desktop migration over multiple network types (LAN, WAN, VPN, or wireless) through a Web-based console. This allows a single IT staff person to perform migration for tens -- or even hundreds -- of desktops concurrently, Resolvo said. The console monitors the status of migration for each desktop and provides management reports for the entire migration process. Through secure communications between the migration server and desktops, a seamless migration for an enterprise can be achieved, the company said.

To enhance privacy, users' data is encrypted and stored securely during the course of migration, Resolvo said. Pricing information is available by contacting the company.

Tracking bittorrent downloads

Jun. 23, 2006

So, you want to get your Linux distribution or open-source program into as many hands as possible without spending a ton of money on servers or bandwidth. What's the answer? Most people already know the solution: BitTorrent.

Bittorrent currently is the most popular peer-to-peer, file-sharing network protocol around, and there are Bittorrent clients available for almost every operating system that anyone runs, these days.

Best of all, from your point of view, people are getting your distribution without you having to worry about the bandwidth costs.

There's only one little problem: you really don't have a clue how many people are actually downloading your distribution, nor who they are. To do that, you need a tracker.

A tracker doesn't -- no matter what the U.S. government, Sweden, and the MPAA may claim about Pirate Bay -- store any files. All a tracker does, is note the status of any given file. For example, a tracker can tell you how many people have successfully downloaded the file, how many are still sharing -- aka "seeding" -- the file, and so on.

Now, you could create your own tracker. The bandwidth requirements for a tracker are nothing like those of a traditional ftp site.

One popular open-source solution to this is the LAMP (Linux, Apache, MySQL, PHP) program,
PHPBTTracker+. You can also run this with an Apache server, to start your Bittorented application on its way to users.

If you don't want to bother with installing your own, LinuxTracker.org will be more than happy to track how many people have downloaded your Linux distribution.

There are other free sites, as well, that will help you to track just how popular your software really is. However, so many of these sites tend to go up and down like jack-rabbits on speed, that I can't recommend any of them.

Still, between LinuxTracker.org and PHPBTTracker+, I think you'll find most of your tracking needs covered.


-- Steven J. Vaughan-Nichols

SCO: the Linux company

Jun. 26, 2006

If there's anyone left who doesn't get that SCO -- eternal enemy of LinuxTM -- started out doing its best to combine Unix and Linux and was still giving Linux away under the GPL after it started its Linux law-suits, they should read some of Groklaw's recent stories.

In one tale, Groklaw editor Pamela Jones reprints a Caldera 2001 press release that comes right out and says the merged SCO and Caldera had been, "Over the last seven months" ... working "to jointly develop and deploy integrated products and solutions that allow us to unify UNIX with Linux to provide this alternative platform."

None of that comes as any surprise to me. I followed the merger of SCO and Caldera like a hawk, and Caldera had always intended since day one to merge the best features of Linux and Unix together.

There was nothing that could be misunderstood about this. In an interview with Ransom Love, Caldera's CEO, in February 2001, he told me that "Caldera will make UnixWare binary-compatible with Linux, allowing UnixWare customers to run Linux applications. On the flip side, Caldera Linux will gain UnixWare's best enterprise and database management features. These include large file system support, asynchronous input/output (I/O), the UnixWare API, extended developer kit, and multipath I/0."

There you go, folks. It's in black and white.

Love and other executives went on to say that partners should expect a new product-branding strategy. Specifically, Caldera's platforms would be branded by functionality (database server, Web server, etc.) instead of by operating system. The partner push would involve cross-selling and cross-development between the UnixWare and Linux communities.

After Love was forced out of Caldera -- by then renamed SCO -- he again told me in an interview in 2003 that: "When we acquired SCO and Unix, our intention was to see how Unix could expand and extend Linux. In a lot of technologies, Linux was going in slightly different ways, but we thought Unix was the natural companion to it.

"We took the Linux code that was available and learned to cleanly match it with the Unix APIs. The idea was to adopt Linux APIs and mechanisms to function on top of a scalable Unix code designed for SMP [symmetric multiprocessing]. At the time, Linux was moving to clustering to make Linux more scalable. We wanted to combine Unix's improved symmetric multiprocessing with Linux so that it would have both excellent clustering and SMP," he continued.

"Indeed, at first we wanted to open-source all of Unix's code, but we quickly found that even though we owned it, it was, and still is, full of other companies' copyrights," Love added.

In a series of recent stories, Jones pointed out that you could still download GPLed Linux from SCO in June 2003 and February 2004 -- almost a year after SCO sued IBM.

I bring all this up again, because I've recently run into some people who think that because SCO has been continuing to push for so long on this case there must be some fire behind its Linux smoke.

There's not.

Why, then, is SCO continuing to bang its head against the wall? Well, there's always that one-in-a-million shot that compulsive gamblers shoot for. And, last but never least, there are companies like Microsoft that wish Linux ill and have supported SCO financially.

Coincidence? I don't think so.


-- Steven J. Vaughan-Nichols

Friday, June 23, 2006

Ten tips for new Ubuntu users

Wednesday June 21, 2006 (02:01 PM GMT)

By: Joe 'Zonker' Brockmeier

Ubuntu has become the most popular Linux distribution for new Linux users. It's easy to install, easy to use, and usually "just works." But moving to a different operating system can be confusing, no matter how well-designed it is. Here's a list of tips that might save you some time while you're getting used to Ubuntu.

1. Getting multimedia to work

The default Ubuntu install contains free software only, which means that it doesn't support some popular multimedia formats straight out of the box. This is inconvenient, but the Ubuntu folks have good reasons for not shipping with support for MP3, DVDs, and so forth -- including that software could cause them some legal headaches, or incur some serious fees.

Fortunately, as a user, you don't need to worry about fees (though some of the packages may not be legal due to patent restrictions or restrictions on circumventing copy protection, depending on where you live). The Ubuntu wiki has a page on restricted formats that explains how to get the packages you need. However, if you run Ubuntu on AMD64 or PowerPC hardware, you'll still be out in the cold for some of the packages, since some multimedia formats depend on proprietary software that's not available for those hardware platforms.

2. Changing the defaults

Ubuntu comes with a number of defaults that may or may not be to your liking. For example, the default editor is set to Nano, which isn't optimal if you're used to Vim.

The easy way to change this is to use the update-alternatives program, which maintains the symbolic links under /etc/alternatives that determine the default programs for FTP, system editor, rsh, Telnet, window manager, and so forth. Look under the /etc/alternatives directory to see what programs are managed.

To change the default editor, run sudo update-alternatives --config editor. You'll see a dialog like this:

There are 3 alternatives which provide `editor'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/vim
2 /bin/ed
*+ 3 /bin/nano

Press enter to keep the default[*], or type selection number:

Just type 1 to switch to Vim. Note that on my system, I don't have Emacs or many other editors installed; if I did, the utility would offer the other editors as choices.

3. How to install packages

Most of the application software you'll want to add to your system will be available through the Ubuntu repositories using Synaptic, Adept, or another package management tool. What if you want to install something like Opera that is available as a package for Ubuntu, but isn't in the repositories?

In that case, download the application's Debian package (.deb) and right-click on the file. At the top of the context menu, you should see an option to open the package with the GDebi package installer. GDebi will provide a description of the package, what files are included, and other details about the package. The package installer also has a Install Package button; just click that and it will install the package. Note that the package installer also checks to verify whether it can install the package -- if it has dependencies that can't be satisfied, GDebi will give an error and refuse to install it.

If you prefer to install packages at the command line, just use sudo dpkg -i packagename.deb.

4. Sudo and gksudo

If you've used Linux for any amount of time, you might be used to running programs as root directly whenever you need to install packages, modify your system's configuration, and so on. Ubuntu employs a different model, however. The Ubuntu installer doesn't set up a root user -- a root account still exists, but it's set with a random password. Users are meant to do administration tasks using sudo and gksudo.

You probably already know how to use sudo -- just run sudo commandname . But what about running GUI apps that you want to run as root (or another user)? Simple -- use gksudo instead of sudo. For instance, if you'd like to run Ethereal as root, just pop open a run dialog box (Alt-F2) and use gksudo ethereal.

By the way, if you really must do work as root, you can use sudo su -, which will log you in as root. If you really, really want to have a root password that you know, so that you can log in as root directly (i.e., without using sudo), then run passwd when logged in as root, and set the password to whatever you want. I'd recommend using the pwgen package to create a secure password not only for root but for all your user accounts.

5. Add users to sudo

When you set up Ubuntu, it automatically adds the first user to the sudo group, allowing that user to make changes as the super user (root) by typing in their password. However, it doesn't automatically add additional users to the sudo group. If you want to give someone else superuser privileges on your shared system, you'll have to give them sudo access.

To add new users to sudo, the easiest way is to use the usermod command. Run sudo usermod -G admin username . That's all there is to it. However, if the user is already a member of other groups, you'll want to add the -a option, like so: sudo usermod -a -G admin username .

If you prefer the GUI way of doing things, go to System -> Administration -> Users and Groups. Select the user you want to add to sudo, and click Properties. Under the User privileges tab, check the box that says "Executing system administration tasks" and you'll be all set.

6. Adding a new desktop

Many users aren't sure what packages to add in order to run KDE or Xfce window managers on a stock Ubuntu system -- or what packages to add to run GNOME on Kubuntu or Xubuntu. You could add all of the necessary packages one at a time, but there's a much easier way to go about it.

To install all of the packages that come with one of the flavors of Ubuntu, such as Kubuntu, run apt-get install kubuntu-desktop (or edubuntu-desktop, xubuntu-desktop, or xubuntu-desktop).

If the GUI is more your style, the *desktop packages can be installed using Adept, Synaptic, or another package manager.

7. How to reconfigure X.org

Most of the time, X.org -- that's the software that drives your video card and provides the foundation for the GUI, whether you're running GNOME, KDE, Xfce, or another window manager -- "just works" when you install Ubuntu. In fact, I'd wager that most Ubuntu users never even have to think about their video settings.

But, sometimes you need to reconfigure X.org because Ubuntu hasn't detected your video card and monitor properly, or maybe you've just purchased a shiny new video card and need to get it working with Ubuntu. Whatever the reason, it's good to know how to reconfigure X without having to edit your /etc/X11/xorg.conf by hand.

To run through the configuration, use dpkg-reconfigure xserver-xorg at the console or in a terminal window. Then you'll have a chance to specify your monitor and video card, the resolutions and color depths you want to run the server at, and so forth.

Since every setup is different, it's hard to give concrete advice for configuring X, but it's generally OK to accept the configuration defaults. Also, you'll be given a choice between Advanced, Medium, and Simple methods for giving your monitor's specifications. As a rule, it's probably best to go with Simple unless you really know what you're doing, or the Simple method doesn't work for you.

8. Log in automagically

By default, when you boot up the computer, Ubuntu will give you a login screen before you get to your X session. From a security perspective, this is a good idea, particularly in multi-user environments or in any situation where other people have physical access to your computer. Still, many users are used to just being logged in automatically, and don't want to fuss with logging in each time they reboot their desktop.

To set this in Ubuntu, go to System -> Administration -> Login Window. You'll need to provide your password, then you'll get the Login Window Preferences window with five tabs. Choose the Security tab and click Enable Automatic Login. If you have more than one regular user, make sure to specify which user should be logged in automatically.

Again, and I can't stress this enough, this is only a good idea for home computers where only one person has access to the computer. I don't recommend this for work computers or laptop/notebook computers, when someone else might have access to the machine.

9. Compiling from source

Ubuntu's package repository is huge, particularly when you factor in packages in the Universe and Multiverse repositories. However, many users find themselves needing to install packages from source, either because they want to use a newer package than is available in the repository, or they want to try something that's not in the Ubuntu repository at all.

If you want to install packages from source, you can use a few shortcuts to make life easier. First, you'll probably want to get the build-essential meta-package if you haven't installed any developer tools. Run sudo apt-get install build-essential; it will grab GCC, the Linux kernel headers, GNU Make, and some other packages that you'll probably need.

Next, if you're going to compile a package such as Gaim because a new version is out, you might be able to satisfy the new version's dependencies with the old version's dependencies. To do this, grab the package's build dependencies with sudo apt-get build-dep packagename . That will grab all of the development packages you need to build the package that's currently available in Ubuntu, and will probably satisfy dependencies for the new version you're compiling.

Finally, don't make install when you compile from source -- use CheckInstall instead. CheckInstall will create a Debian package and install it for you, so you can remove or upgrade the software more easily later on.

Grab CheckInstall with apt-get install checkinstall. After you've run ./configure ; make, just run sudo checkinstall and answer a few simple questions. Note that if you compile packages on AMD64, CheckInstall will select X86_64 as the architecture rather than amd64 -- which will cause the package install to fail, since Ubuntu expects amd64 as the architecture rather than X86_64.

By the way, the packages created by CheckInstall also make it easier to deploy the same package on several machines, if you happen to have several systems running Ubuntu. See Joe Barr's excellent CLI Magic feature on CheckInstall too.

10. A new kernel

Ubuntu will install a 386 kernel for x86 machines, which probably isn't what you'd want if you've got a Pentium II or better CPU. The 386 kernel is compiled to work with just about any x86 CPU, but extensions that appear in later CPUs can give your system a boost, if they're taken advantage of. To replace the kernel, open Synaptic or Adept and search for linux-image. You'll see several choices. Pick the one that best suits your CPU -- probably the linux-image-686 package for Pentium II and later CPUs, and linux-image-k7 for later AMD processors. Note that if you're using the AMD64 line (or Intel's x86-64 CPUs) you should be using the amd64 images.

Of course, once you install the new kernel, you'll need to reboot. Another benefit to the 686 kernels is that they have SMP support, which is a bonus for multi-core and Intel HyperThread CPUs.

If none of the tips cover questions that you have about Ubuntu, try checking out the Ubuntu wiki, forums, and mailing lists. As a rule, the Ubuntu users are a helpful lot, and you'll usually be able to find someone who's run into the same situation that you have questions about.

Getting started with Ubuntu

Jun. 21, 2006

The title says it all.

But, let me make it perfectly clear. This is for new Ubuntu users, not new Linux users.

That said, I found it useful myself. For example, after I recently installed Dapper Dan, the newest Ubuntu, I forgot entirely about updating the kernel. Ubuntu, like most Linuxes, defaults to using the lowest common denominator kernel.

So, on an x86 system, the default Linux kernel will work with any x386 or higher system. Of course, by doing this, it also won't take any advantage of the newer chips' speed-enhancing features.

Once reminded of this, I went out and grabbed a copy of the latest 686 kernel, and now Ubuntu is running much faster on my Pentium IV Ubuntu desktop system.

Who says you can't re-teach an old dog an old trick?


-- Steven J. Vaughan-Nichols

Getting at NTFS drives from Linux

Jun. 06, 2006

We've all been there. There's a file on a Windows NTFS drive and there seems to be no way on God's Earth to get to it directly from your Linux system. Paragon Software Group has an answer: its latest release of NTFS for Linux 5.0.

I haven't had a chance to kick the tires of this model, but the last version impressed both myself and PC Mag Labs.

NTFS for Linux comes in two versions. The first, the Personal Edition, includes a bootable recovery CD with Paragon's own NTFS for Linux driver built in. When booting from this CD, the user can access NTFS and Linux volumes with complete read and write access. In addition, they can change configuration files, add drivers, and even move important documents to any removable media or network share.

The Professional Edition includes that functionality, and also enables you to check on file system integrity, create NTFS volumes, perform many NTFS file system related tasks, and copy (backup/restore) files/directories between NTFS and Linux-supported file systems.

Serious network managers will also be pleased to find out that it includes the Paragon Logical Disk Manager driver. This special driver lets you mount all Microsoft Dynamic Volumes (simple, spanned, striped, mirrored, and RAID5) under Linux. That is no easy trick.

Most users, however, will find themselves reaching for the bootable recovery CD. While there are other ways to get to NTFS disks from Linux, for ease of use and speed, the last version of NTFS for Linux was the program to beat, and I'm sure this one improves on those areas.

The key to all this is Paragon's NTFS driver. Unfortunately, it's proprietary software. You can download a trial version of the Personal Edition to see if it works for you. If it does, you'll probably want to buy the full version for $19.95. I think it's worth the money, to a PC repair tech.

The Professional Edition, at $149.95, isn't for most people. However, if I were in charge of repairing or maintaining a serious hybrid network of, say, more than 50 Linux and Windows systems, I'd be writing up a requisition document for it. It's one of those programs that when you need it, you really need it.


-- Steven J. Vaughan-Nichols

The Linux engine in Cars

Jun. 21, 2006

Ever wonder how Lightning McQueen and friends looked so good in the movie Cars? A lot of that spit and polish came from the Pixar Animation Studio's Linux workstations and servers.

Even on high-end Linux systems, though, each frame of the animated movie took about 8-hours to render. Much of that CPU time was consumed by ray tracing.

Ray tracing models light's path in a frame, so that it looks like you're seeing a real object lit up by the appropriate light sources. That doesn't sound too hard. Pixar has been doing that basic kind of thing since its early hopping lamp short films.

What's new about Cars is the level of lighting and color detail that Pixar brought to its four-wheeled cast. Earlier films, such as the The Incredibles, took only a fraction of the time to render even though they were produced with older technology.

To do this, Pixar uses three of its own proprietary software packages, which run on Linux.

These are: Marionette, an animation software system for articulating, animating and lighting; Ringmaster, a production management software system for scheduling, coordinating, and tracking of a computer animation project; and RenderMan, a rendering software system for producting high quality photo-realistic images.

RenderMan, the most well-known of these programs, is also a standard interface for modeling programs and rendering programs capable of producing photorealistic quality images.

Thus, while Pixar has its own versions of RenderMan, there are other RenderMan-compliant renderers. Some of these, such as Pixie, are open-source. Almost all of them run on Linux.

Marionette, however, is all Pixar's and no one else's. It's used by Pixar for articulating, animating, and lighting its computer animations. Thus, it's the primary software tool for animators and technical directors at Pixar. Marionette, which runs on Linux, Solaris, and IRIX OS-powered workstations, has been designed and optimized for character articulation and animation.

Unfortunately, if you don't work at Pixar, you're not going to be able to use it. Or even see it in operation, for that matter, since Pixar is a closed studio.

Finally, Ringmaster is a production management and distributed rendering system for scheduling, coordinating and tracking animation projects. Ringmaster co-ordinates each frame's rendering on an array of Linux processors.

These clustered systems, which do nothing but render 24-hours a day, are known as a RenderFarm.

Open-source users will be disappointed to know that there are no signs that Pixar, now being bought out by Disney, will be open-sourcing any of its products.

Still, it is good to know that when the world's leading computer animation company needs to produce computer graphics, it turns to Linux for its operating system of choice.


-- Steven J. Vaughan-Nichols

Wednesday, June 21, 2006

Hackers are Not Crackers

First written: 30-June-2000
Updated: 6-Nov-2000
Copyright © 2000 by Philip S Tellis

My name is Philip Tellis and I love playing with computers. I have written this small primer on hackers and hacking meant to inform people of the correct terminology to be used. Much more information is available at the references mentioned in this article.

The Internet in India is growing rapidly and with it, several new business models, entertainment avenues and educational opportunities. The Internet has also exposed us to security risks that come with connecting to a large network.

The media has always latched on to stories of so-called `hackers' breaking into computer systems and wreaking havoc. This article is a sincere attempt to set the record straight as far as the terminology and process of `hacking' is concerned.

The hacker culture as it is known, actually started way back in the 1950's when computers were huge and bulky, and programming them meant connecting wires to electrodes. Although they didn't call themselves hackers then, that pretty much explains what a hacker is.

The new hacker's dictionary defines a hacker as:

hacker n.

1. A person who enjoys exploring the details of programmable systems and how to stretch their capabilities, as opposed to most users, who prefer to learn only the minimum necessary.
2. One who programs enthusiastically (even obsessively) or who enjoys programming rather than just theorizing about programming.
3. A person capable of appreciating hack value.
4. A person who is good at programming quickly.
5. An expert at a particular program, or one who frequently does work using it or on it; as in `a Unix hacker'. (Definitions 1 through 5 are correlated, and people who fit them congregate.)
6. An expert or enthusiast of any kind. One might be an astronomy hacker, for example.
7. One who enjoys the intellectual challenge of creatively overcoming or circumventing limitations.

This term seems to have been first adopted as a badge in the 1960s by the hacker culture surrounding the `Tech Model Railroad Club' (TMRC) and the MIT AI Lab. It was probably used in a sense close to this by teenage radio hams and electronics tinkerers in the mid-1950s.

All computer systems that we use today are based on research done by early hackers. Much of this research was done out of love for the subject, with no personal gain other than fame amongst the community. Hackers built the internet. Hackers built and maintain usenet. All internet related business today owes its origin to hackers.

The hacker community is a 'meritocracy based in ability'. Membership must be earned. One does not call oneself a hacker until other hackers recognise one as such. There is a certain ego satisfaction to be had in identifying yourself as a hacker.

Some of the more famous hackers of lore are Steve Jobs and Steve Wozniak - the founders of Apple Computer, Bill Gates - more of a hacker during his teens than later, Linus Torvalds - the guy behind linux, Richard Stallman - founder of GNU, Larry Wall - author of Perl, Bill Joy and James Gosling from Sun Microsystems, Dennis Ritchie and Ken Thompson from AT&T, Bjarne Stroustroup - author of C++. Many of these hackers have reached demigod status in the community and are still active hacks.

Around 1980 or so, a new breed of computer fed kids came up. With easy access to the internet in the US and Europe, they soon realised that they could easily break into other people's systems and do what they wanted. They called themselves hackers too. This was really unfortunate, because the name kind'a stuck.

Real hackers do not consider such security breakers to be hackers. The term preferred for such persons is cracker:

cracker n.

One who breaks security on a system. Coined ca. 1985 by hackers in defense against journalistic misuse of hacker (q.v., sense 8). An earlier attempt to establish `worm' in this sense around 1981-82 on Usenet was largely a failure.

While it is true that many hackers posess the skills for cracking, anyone past larval stage is expected to have outgrown the desire to do so except for immediate, benign, practical reasons.

Contrary to popular belief (amongst non hackers), there is far less overlap between hackerdom and crackerdom. Very often it has been thought that there is a very thin line between being a hacker and being a cracker. Several debates have been initiated on usenet and in geek media.

The basic difference between hackers and crackers is this:

hackers build things, crackers break them.

As a hacker, I build software programs for others to use. There is nothing illegal or shameful about the hacking I do. Most of my software is given away with the freedom to modify, reuse and redistribute with the only restriction being that these freedoms are always included. My hacks are meant to help other people, not hurt them.

With the introduction of the IT Bill, it is important that these facts be made public so that the culture of hackers in India do not have to be ashamed to admit who they are. It is also important to ensure that they are not seen as criminals in the eyes of the law. The law must clearly define what a `cybercrime' is and state clearly that hacking is not one of them. Cracking is. Make hacking a crime and one will have to charge every single proficient and competent computer programmer in this country.

This article seeks only to introduce the proper terminology. There is far more information available on the Internet, and I urge you to read through it. For starters run through Eric Raymond's essay on `How to become a hacker' Read through the jargon file and `A Brief History of Hackerdom' also at the same site. Then, browse down to GNU and read the philosophy of free software. You may also want to get hold of a copy of `The New Hacker's Dictionary' and `Open Sources' from O'Reilley.

Hackers have a bad name primarily because of the way the media spreads reports of `hacking'.

In April 1988, ZDnet was conducting a survey. They use the word `hacker' to mean `cracker', but their readers don't. Greg Lehey reports that he found approximately 80% of the responders agreed that a hacker is as defined above and not the same as a cracker. I wonder how much that has changed in the last 12 years.

We request that you try to make things right. From now on, when you say hack, make sure you mean hack and not crack. You owe hackers an apology for spoiling their name, but most of all, you owe them respect.

Philip Tellis

Parts of this article have been taken from sources mentioned here, most notably, the jargon file and the hacker-howto by Eric S. Raymond. Please do read the originals.
Check out Greg Lehey's The term ``hacker'' as well.
The jargon file can be found at: http://www.catb.org/jargon/html/index.html
The hacker howto can be found at: http://www.catb.org/~esr/faqs/hacker-howto.html

Foundation hopes to create a Linux-based platform for mobile devices

Nancy Gohring, IDG News Service
Thursday, June 15, 2006

A group of top mobile phone makers and operators are launching a foundation to create an open Linux-based software platform for mobile devices, they said today.


Advertisement




The companies, including Motorola, Vodafone Group, NTT DoCoMo, Samsung Electronics, NEC, and Panasonic Mobile Communications, plan to focus on the development and marketing of an API (application programming interface) specification, architecture, and source reference.

The group hopes to create a collaborative environment to build a mobile Linux development ecosystem and work to minimize fragmentation in the market. Initially, the founders plan to be responsible for the reference implementation of the mobile operating platform but will later invite other companies including phone makers, operators, chip manufacturers, and software vendors to join.

The foundation also hopes to offer a test suite so that developers can demonstrate that their products conform to the specification.

Gaining Momentum

Linux is already a popular operating system for phones in China and is just gaining momentum in Europe. Operators and phone makers say that using Linux can help them reduce the cost of handsets.

This will be the third mobile Linux group to launch within a year, joining the Linux Phone Standards (LiPS) Forum and the Mobile Linux Initiative (MLI). Like the new foundation launched on Friday, the LiPS Forum aims to focus on the creation of APIs to enable interoperability of applications across Linux handsets.

PalmSource, France Telecom, and Orange are among the leaders of LiPS. The MLI, with members that include Motorola and PalmSource, is working on unifying developments around the mobile Linux kernel.

Tuesday, June 20, 2006

Zend Technologies provides Zend Platform free for PHP Developers

CUPERTINO, CA – May 31, 2006 – Zend Technologies, Inc., the PHP Company, today announced that it is offering a free developer’s version of Zend Platform, its PHP runtime optimization technology, to all buyers of Zend Studio Professional 5.2, the industry leading software development environment for PHP. Zend Platform enhances PHP deployments with real-time debugging, monitoring, configuration, performance management, clustering, and Java integration. The functionality of the developer’s version is identical to the production version of Zend Platform, enabling PHP developers to get their applications to deployment faster and reducing the frequency and severity of post-deployment problems in their PHP applications.

“For developers of web applications it is important to be able to test their applications as early as possible,” said Andi Gutmans, co-founder and vice president of technology at Zend Technologies. “With Zend Platform, developers can debug their applications, optimize performance and scalability and be confident that these applications will perform reliably when they go into production.”

Research shows that most PHP developers create their applications on Windows computers, while deploying the majority of those PHP applications on Unix and Linux systems. To support this usage model, Zend is releasing a developer version of Zend Platform for Windows as part of its Zend Studio Professional 5.2 announcement.

”Zend Platform is sold mostly to web administrators who operate business-critical web sites,” said Mark de Visser, chief marketing officer of Zend Technologies. “By making a developer’s version of Zend Platform widely available to PHP developers, it enables them to develop and stage their web applications under similar conditions as the final production environment, therefore improving coordination between developers and administrators.”

Pricing and Availability Info
Zend Studio Professional 5.2 is available for purchase at www.zend.com now. It is available for Linux, Windows and the Mac OS X. The price for Zend Studio Professional is $299 per developer workstation. As a special introductory offer, buyers will receive a 20% discount if they purchase before July 1, 2006.

About Zend Technologies, Inc.
Zend Technologies, Inc., the PHP company, is the leading provider of products and services for developing, deploying and managing business-critical PHP applications. PHP is used by more than twenty-two million Web sites and has quickly become the most popular language for building dynamic web applications. Deployed at more than 15,000 companies worldwide, the Zend family of products is a comprehensive platform for supporting the entire lifecycle of PHP applications. Zend is headquartered in Cupertino, California. For more information, please visit www.zend.com, or call 1-408-253-8800.
###

Zend, Zend Technologies, Zend.com, Zend Studio and Zend Platform and/or the logos and icons associated with each of these names are trademarks of Zend Technologies, Inc. and may be registered in certain jurisdictions. All other trademarks are the property of their respective owners.

How To Use the AT Command to Schedule Tasks

This article was previously published under Q313565
On This Page
SUMMARYSUMMARY
Overview of the AT CommandOverview of the AT Command
How to Create a Scheduled TaskHow to Create a Scheduled Task
ExamplesExamples
How to Cancel a Scheduled TaskHow to Cancel a Scheduled Task
ExamplesExamples
How to View Scheduled TasksHow to View Scheduled Tasks
ExamplesExamples
TroubleshootingTroubleshooting
REFERENCESREFERENCES
SUMMARY
In Windows 2000, you can use the Task Scheduler tool in Control Panel to schedule tasks. You can also use the at command to schedule tasks manually. This article describes how to use the at command to create and to cancel scheduled tasks.

Back to the top Back to the top
Overview of the AT Command
You can use the at command to schedule a command, a script, or a program to run at a specified date and time. You can also use this command to view existing scheduled tasks.

To use the at command, the Task Scheduler service must be running, and you must be logged on as a member of the local Administrators group. When you use the at command to create tasks, you must configure the tasks so that they run in the same user account.

The at command uses the following syntax:
at \\computername time /interactive | /every:date,... /next:date,... command
at \\computername id /delete | /delete/yes
The following list describes the parameters that you can use with the at command:
• \\computername: Use this parameter to specify a remote computer. If you omit this parameter, tasks are scheduled to run on the local computer.
• time: Use this parameter to specify the time when the task is to run. Time is specified as hours:minutes based on the 24-hour clock. For example, 0:00 represents midnight and 20:30 represents 8:30 P.M.
• /interactive: Use this parameter to allow the task to interact with the desktop of the user who is logged on at the time the task runs.
• /every:date,...: Use this parameter to schedule the task to run on the specified day or days of the week or month, for example, every Friday or the eighth day of every month. Specify date as one or more days of the week (use the following abbreviations: M,T,W,Th,F,S,Su) or one or more days of the month (use the numbers 1 through 31). Make sure that you use commas to separate multiple date entries. If you omit this parameter, the task is scheduled to run on the current day.
• /next:date,...: Use this parameter to schedule the task to run on the next occurrence of the day (for example, next Monday). Specify date as one or more days of the week (use the following abbreviations: M,T,W,Th,F,S,Su) or one or more days of the month (use the numbers 1 through 31). Make sure that you use commas to separate multiple date entries. If you omit this parameter, the task is scheduled to run on the current day.
• command: Use this parameter to specify the Windows 2000 command, the program (.exe or .com file), or the batch program (.bat or .cmd file) that you want to run. If the command requires a path as an argument, use the absolute path name (the entire path beginning with the drive letter). If the command is on a remote computer, use the Uniform Naming Convention (UNC) path name (\\ServerName\ShareName). If the command is not an executable (.exe) file, you must precede the command with cmd /c, for example, cmd /c copy C:\*.* C:\temp.
• id: Use this parameter to specify the identification number that is assigned to a scheduled task.
• /delete: Use this parameter to cancel a scheduled task. If you omit the id parameter, all scheduled tasks on the computer are canceled.
• /yes: Use this parameter to force a yes answer to all queries from the system when you cancel scheduled tasks. If you omit this parameter, you are prompted to confirm the cancellation of a task.
Note When you use the at command, the scheduled task is run by using the credentials of the system account.

Back to the top Back to the top
How to Create a Scheduled Task
1. Click Start, point to Programs, point to Accessories, and then click Command Prompt.
2. At the command prompt, type the following line, and then press ENTER to display a list of currently running services:
net start
If Task Scheduler is not displayed in the list, type the following line, and then press ENTER:
net start "task scheduler"
3. At the command prompt, type the following line (use the parameters that are appropriate to your situation), and then press ENTER:
at \\computername time /interactive | /every:date,... /next:date,... command
Examples
• To copy all files from the Documents folder to the MyDocs folder at midnight, type the following line, and then press ENTER:
at 00:00 cmd /c copy C:\Documents\*.* C:\MyDocs
• To back up the Products server at 11:00 P.M. each weekday, create a batch file that contains the backup commands (for example, Backup.bat), type the following line, and then press ENTER to schedule the backup:
at \\products 23:00 /every:M,T,W,Th,F backup
• To schedule a net share command to run on the Sales server at 6:00 A.M. and to redirect the listing to the Sales.txt file in the shared Reports folder on the Corp server, type the following line, and then press ENTER:
at \\sales 06:00 cmd /c "net share reports=d:\Documents\reports >> \\corp\reports\sales.txt"
Back to the top Back to the top
How to Cancel a Scheduled Task
1. Click Start, point to Programs, point to Accessories, and then click Command Prompt.
2. At the command prompt, type the following line, and then press ENTER to display a list of currently running services:
net start
If Task Scheduler is not displayed in the list, type the following line, and then press ENTER:
net start "task scheduler"
3. At the command prompt, type the following line (use the parameters that are appropriate to your situation), and then press ENTER:
at \\computername id /delete | /delete/yes
Examples
• To cancel all tasks that are scheduled on the local computer, type at /delete, and then press ENTER.
• To cancel the task ID 8 on a computer that is named "MyServer," type at \\MyServer 8 /delete, and then press ENTER.
Back to the top Back to the top
How to View Scheduled Tasks
To view the tasks that you created by using the at command, follow these steps:
1. Click Start, point to Programs, point to Accessories, and then click Command Prompt.
2. At the command prompt, type the following line, and then press ENTER to display a list of currently running services:
net start
If Task Scheduler is not displayed in the list, type the following line, and then press ENTER:
net start "task scheduler"
3. At the command prompt, do one of the following steps:
• To view a list of tasks that you scheduled by using the at command, type the following line, and then press ENTER:
at \\computername
-or-

• To view a specific scheduled task, type the following line, and then press ENTER:
at \\computername id
Examples
• To view all scheduled tasks on the local computer, type at, and then press ENTER.
• To view all scheduled tasks on a computer named "Support," type at \\support, and then press ENTER.
• To view the task ID 18 on the local computer, type at 18, and then press ENTER.
Back to the top Back to the top
Troubleshooting
• When you type at \\computername to view a list of scheduled tasks, some (or all) of the scheduled tasks that you created by using the at command are not listed.

This behavior can occur if you modified the tasks in the Scheduled Tasks folder after you used the at command to create the task. When you use the at command to schedule a task, the task is displayed in the Scheduled Tasks folder in Control Panel. You can view or modify the task. However, if you modify the task, when you use the at command, you cannot view the task.

To work around this behavior, view or modify the task in the Scheduled Tasks folder in Control Panel.For additional information about this behavior, click the article number below to view the article in the Microsoft Knowledge Base:
220149 (http://support.microsoft.com/kb/220149/EN-US/) AT Tasks Cannot Be Viewed Using the Task Scheduler Tool
• When you use the at command to schedule a task, the task does not run at the specified time or date.

This behavior can occur if one of the following conditions are true:
• The command syntax is incorrect.

After you schedule a task, type at \\computername to confirm that the syntax is correct. If the information that is displayed under Command Line is incorrect, cancel the task, and then recreate it.

-or-
• You schedule a task to run a command that is not an .exe file.

The at command does not automatically load cmd (the command interpreter) before it runs commands. Unless you are running an .exe file, you must load Cmd.exe at the beginning of the command, for example, at cmd /c dir > c:\test.txt.
For additional information about troubleshooting the AT command, click the article numbers below to view the articles in the Microsoft Knowledge Base:
142040 (http://support.microsoft.com/kb/142040/EN-US/) Troubleshooting AT Command Using /k Switch
121562 (http://support.microsoft.com/kb/121562/EN-US/) Applications Started with AT Are Not Interactive

PHP and ASP.NET Go Head-to-Head

By Sean Hull

One developer's view of the pros and cons of the two most popular means of building web applications

When it comes to Web development these days, you have a lot of options. Many of these methods involve preprocessing—that is, embedding code into HTML pages with special tags that signal to a preprocessor that they contain code, and that it should do something with it. Much like a CGI, this code is then run on the server, and it returns some content, which then assumes part of the shape of the resulting HTML page sent back to the browser. Both the open source scripting language PHP and languages within Microsoft's ASP.NET framework fall into this category; JavaServer Pages (JSP) and Perl/Mason operate this way as well.

In this article I'll focus on PHP, the technology Oracle has chosen to incorporate into its products, and ASP.NET. I'll overview the various strengths and weaknesses of each, discussing in particular those areas that will help you make your decision on which to go with for your development project. There are a lot of factors to consider, and different projects may appeal to a different technology. In conclusion you'll find a point-by-point comparison in terms of price, speed and efficiency, security, cross-platform support, and the advantages of an open source solution.

What is ASP.NET?

The latest incarnation of ASP, ASP.NET, is not completely backward-compatible with previous versions of ASP, as it is a complete rewrite of the software. Previous ASP technology actually has a lot more in common with PHP than with ASP.NET, which is a complete framework for building Web applications. One of the principal features of this model is the flexibility to choose your programming language. ASP.NET works with scripted languages such as VBScript, JScript, Perlscript, and Python, as well as compiled languages such as VB, C#, C, Cobol, Smalltalk, and Lisp. The new framework uses the common language runtime (CLR); your language source is compiled into Microsoft Intermediate Language code, which the CLR then executes.

The framework also provides for true object-oriented programming (OOP), and true inheritance, polymorphism, and encapsulation are supported. The .NET class library is organized into inheritable classes based around particular tasks, such as working with XML or image manipulation.

Besides the programming language and the methodology, database access is a significant concern. When you program in ASP.NET, integration with databases can be accomplished through ODBC, which provides a consistent set of calling functions to access your target database.

Strengths and Weaknesses

ASP.NET's strength lies clearly in its clean design and implementation. It is an object-oriented programmer's dream, with language flexibility, and with sophisticated object-oriented features supported. In that sense, it is truly interoperable with your programmers' existing skills.

Another strength of ASP.NET is the development environment. For instance, developers can use WebMatrix, a community-supported tool, Visual Studio .NET, or various Borland tools such as Delphi and C++ Builder. Visual Studio, for instance, allows setting of breakpoints, tracing sections of code, and reviewing the call stack. All in all, it's a sophisticated debugging environment. Plenty of other third-party IDE solutions for ASP.NET are certain to surface as well.

But what you gain in robustness, you pay for in efficiency. ASP.NET is expensive with respect to memory usage and execution time, which is due in large part to a longer code path. For Web-based applications, these limitations can be a serious problem, because on the Web, your application is likely to scale to thousands and thousands of users per second. Memory usage can also become an issue on your Web server.

What is PHP?

PHP is a scripting language based on the model of preprocessing HTML pages. When the PHP preprocessor in your Web server notices a PHP language tag like the following, the PHP engine is invoked to execute that code:

some code here
?>

PHP will be familiar to any programmers who have worked with imperative programming languages; you'll notice syntactical similarities with Perl, C, and Java. Strictly speaking, Java is an imperative programming language, but it also makes use of object-oriented constructs and concepts. PHP borrows from this structure when it is convenient, but it is not a pure OOP language.

In the discussion of ASP.NET above, I mentioned the ODBC driver, and how applications can be built with database abstraction in mind. In PHP, you can also use ODBC to talk to databases, so you already have a whole list of supported databases to choose from. There are also native drivers for MySQL, Oracle, and Postgres. Furthermore, if you are connecting to Oracle, a special OCI8 library provides more feature-rich access to Oracle, allowing you to use such features as LOB, BLOB, CLOB, and BFILE.

You might ask, at this point, "Why are database-dependent libraries being touted as features of PHP?" Database abstraction, or independence, is a feature if you seek to build an application that works with multiple databases in one application or that can easily be ported to another database—when moving from development to production, for instance. And these are indeed valid concerns and considerations.

But, as Tom Kyte points out in his latest book, Effective Oracle by Design (Oracle Press), database dependence should be your real goal because you maximize your investment in that technology. If you make generic access to Oracle, whether through ODBC or Perl's DBI library, you'll miss out on features other databases don't have. What's more, optimizing queries is different in each database.

Zend Technologies, a commercial software company that contributes significantly to PHP, has created a commercial-development environment called Zend Studio that includes a sophisticated debugger, a profiler, and other features. It has also built the free Zend Optimizer, which, in combination with the Zend Encoder, compiles PHP code to speed performance. Additional commercial products also exist, such as the Zend Performance Suite, which can cache precompiled PHP pages, further speeding overall performance tremendously.

Strengths and Weaknesses

As of beta version 4, PHP 5 still has a few shortcomings, including its lack of exceptions, event-based error-handling instances that interrupt the normal flow of a program, jumping your code to a special error-handling section. Java also provides exceptions for error handling, while C++ provides exception handling via the try, catch, and throw syntax. You can, of course, still manage errors in PHP, but the structure is not standardized, so programmers are left to their own devices on how to implement error handling, leading to less consistency and a tendency to reinvent the wheel.

Another weakness is that PHP's function names are case insensitive. Some programmers might find this feature annoying, though this isn't a serious drawback.

I do have misgivings about PHP's object model, however. PHP wasn't designed to be an object-oriented language. Some of those features were added later, although care was made to keep backward compatibility with PHP 3, so you're left with a bit of both models. In fact, many of these weaknesses are addressed in PHP 5. Keep your ears to the ground.

What PHP lacks in a few areas, it makes up for by leaps and bounds in areas in which it excels. The price is right, so you don't have to worry about licensing issues. It's open source, too, so an entire community will keep a close eye on development, identifying bugs and making sure they get fixed. And if there's a feature you don't like, you can dabble with the code. What's more, PHP works native with Apache: It can be compiled as a module or directly into the Apache binary.

But running on Apache means that, with PHP, you can take advantage of whatever server investments you've already made, because Apache runs on Windows, Linux, Solaris, and various other Unix platforms. Also, going with a web server with Apache's track record means security remains a top priority. And, finally, PHP has a smaller code path, meaning there's less server-side code executed to parse and execute your PHP page, which results in more efficient memory and usage and faster execution.

What's New in PHP 5?

The fourth beta release of PHP 5 came out at the end of December 2003, and the change log makes it obvious that many bugs are being identified and ironed out. Although it's still in beta, it's definitely worth taking a look at for all the new features and advances.

PHP 5's major new achievements come in the area of its exception handling and a new object that introduces features that bring true OOP to PHP. Exception handling was certainly one of the most noticeable missing features in PHP 4, and its addition to PHP 5 is certainly a sign of maturity. Exception handling means you have language defined and standardized ways of handling errors in your software. Just use the try, catch, and throw methods, and your PHP code becomes more robust and clean.


class blue {

function openFile ($inFile) {
if (file_exists ($inFile)) {
# code to open the file here
} else {
throw new Exception
("Cannot open file: $inFile");
}
}
}

$blueObj = new blue ();

try {
$blueObj->openFile ('/home/shull/file.txt');

} catch (Exception $myException) {
echo $myException->getMessage ();

# rest of exception handling code here
}

# rest of blue methods here

?>

The new object model has a number of positive impacts on programs written in PHP. In PHP 4, when an object was passed to a function or method, it was passed by value, unless you explicitly told PHP otherwise. This procedure meant that a copy of that object, all the data structures in memory, would have to be copied. This step used memory and made access slow and clunky. In PHP 5, however, objects are always passed by reference.

The new object-oriented features in PHP 5, including constructors and destructors, are noteworthy. As with C++ and Java, they provide a standard way to create the object, allocate memory, and do any necessary setup via a constructor method and perform cleanup with a destructor method.

PHP 5 also introduces more subtle control of methods and variables in your classes. In PHP 4, everything was public: You could access variables from your classes outside the class or in derived classes. In PHP 5, you can still make variables or methods public, but you can also make them private, so they're used only within the class itself. A third option is to make them protected, which means that methods and variables can be viewed within the class or when subclassed.

Furthermore, PHP 5 introduces type hinting, or better type checking. When you pass an object into a routine, PHP can check that it is the right type and give a type-mismatch error if the check fails.

Additional features such as static methods and variables and abstract classes exist, so be sure to check the documentation for details.

Security Comparison

ASP.NET officially requires that you use IIS. Unfortunately, IIS has a long history of vulnerabilities, which makes many administrators reluctant to deploy it to handle their web site. Whether these weaknesses are because of Microsoft's ineptness or because IIS is a real red flag to hackers is irrelevant: Those systems have a history of being hacked and compromised. PHP runs on Apache, too, which is fast and open source and has a good security track record. Also, as I mentioned, Apache runs on many platforms.

If you are considering ASP.NET but you want to use Apache for your front-door to the Internet, you are fortunate to have a few options. First, you can use Apache to relay requests to IIS running internally on another machine. Apache then handles static content and passes aspx content on to the IIS server, which isn't exposed to the internet.

However, if you want to host ASP.NET with Apache, a couple of options are available that may or may not be supported by Microsoft. As a last alternative, there is Ximian's Project Mono, which is working to build an open-source module. Check www.go-mono.com for more information.

Database Coding Examples

Connecting to a database is one of the first things you'll consider doing in PHP or ASP.NET. With ASP.NET, however, it's a little more complicated, because you have the option of any of a number of languages to choose from. Of course, these code samples would have to be embedded into an HTML page, the classes instantiated, and so on. The following information, however, will give you an idea of the coding styles for each.

PHP 5 Connecting to Oracle

Here's a PHP 5 class that provides an Oracle connect-and-disconnect routine to show one way of connecting to Oracle with PHP 5 (other drivers, such as the ODBC driver, and generic database interfaces can be used as well):

class oracle_object {
protected $theDB;
protected $user;
protected $pass;
protected $db;

function __construct($u, $p, $d) {
$this->user = $u;
$this->pass = $p;
$this->db = $d;
}

function db_open () {
$theDB = @OCILogon($this->user, $this->pass, $this->db);
db_check_errors($php_errormsg);
}

function db_close() {
@OCILogoff($theDB);
db_check_errors($php_errormsg);
}

function __destruct () {
print ("so long...");
}

}

ASP.NET Connecting to Oracle

If you're looking to connect to Oracle with VB.NET (Visual Basic is Microsoft's default .NET programming language), take a look at this sample from MSDN:

Imports System
Imports System.Data
Imports System.Data.OracleClient
Imports Microsoft.VisualBasic

Class Sample

Public Shared Sub Main()

Dim oraConn As OracleConnection = New OracleConnection("Data Source=MyOracleServer;Integrated Security=yes;")

Dim oraCMD As OracleCommand = New OracleCommand("SELECT CUSTOMER_ID, NAME FROM DEMO.CUSTOMER", oraConn)

oraConn.Open()

Dim myReader As OracleDataReader = oraCMD.ExecuteReader()

Do While (myReader.Read())
Console.WriteLine(vbTab & "{0}" & vbTab & "{1}", myReader.GetInt32(0), myReader.GetString(1))
Loop

myReader.Close()
oraConn.Close()
End Sub
End Class

Making the Choice

Without assuming you've already decided to go with PHP, I'll conclude that its strengths far outweigh its weaknesses. (See the summary in Table 1.) It boils down to price, speed and efficiency, security, cross-platform applicability, and open-source opportunity. Its only weakness is its lack of a pure and perfect OOP implementation; however, this is a minor drawback. Though language constructs do help, ultimately, good coding is a matter of practice, execution, good habits, and discipline.

Table 1
PHP 4 PHP 5 ASP.NET
Software price free free free
Platform price free free $$
Speed strong strong weak
Efficiency strong strong weak
Security strong strong strong
Platform strong strong weak (IIS only)
Platform any any win32 (IIS only)
Source available yes yes no
Exceptions no yes yes
OOP weak strong strong

Price. Here, we must consider not simply the price tag of the initial investment, which, in the case of PHP, is obviously free, but also the implementation, maintenance, and debugging costs. In the case of PHP, you may invest in the Zend optimization engine. With ASP, however, you're investing from the very beginning, and you're spending for add-on technologies—libraries for doing graphics manipulations, for instance. But, in the long term, PHP isn't going to press you to upgrade and collect more licensing fees. Everyone who has dealt with complex licensing also knows that companies spend time and money just ensuring they are compliant. Furthermore, you have a difference in response when getting bugs fixed. This, of course, translates to time, which translates to cost for overall development.

Speed and efficiency. As I mentioned earlier, ASP.NET is a framework allowing you to use various programming languages. In addition, it is touted as having a great object-oriented model. All this is true, but it becomes a detriment as far as speed is concerned. For all that advantage, there is a lot more code to run through to execute the same ASP page than you have to execute in the PHP engine for an equivalent PHP page. PHP is the quick-and-dirty type of solution, the one to get the job done. And though a lot of robustness has been added to it since its 2.0 and 3.0 days, it still retains that core optimized high-speed approach.

Speed is not the only consideration. Memory usage is also important.

Security. ASP.NET runs on IIS, which has been compromised innumerable times, as evidenced by IT news reports every other week. It has become such a liability, in fact, that in spite of all the marketing dollars spent on it, many IT professionals refuse to have their networks exposed with an IIS Web server. PHP, however, works with Apache, which has a proven track record of speed, reliability, and hardened security. Check www.securityfocus.com for more information.

Cross-platform applicability. ASP.NET runs on IIS and is starting to run on Apache, which can run on a whole host of platforms. PHP has been designed to work with Apache from the beginning, so you have many proven and reliable server platforms to choose from.

Open source opportunity. Open source is not just some philosophical torch idealistic programmers, or companies wanting to save a few bucks on licensing costs, are carrying. When you're dealing with bugs in the software itself, open source can be a serious godsend.

In either case, with PHP or ASP.NET, you have a large user base using the software and possibly encountering bugs. With ASP.NET, those bugs have to go through a bureaucratic process to get acknowledged, fixed, tested, and rolled out in a new patch or release. PHP fixes, however, can get fixed quickly and rereleased. Anyone who has watched open-source development knows new releases and patches often come out in days rather than in weeks or months, as with commercial software. If that's not fast enough, you can always fix a problem yourself if you have to.

Monday, June 19, 2006