document

124
Issue 18

Upload: imad-humayun

Post on 13-Mar-2016

215 views

Category:

Documents


0 download

DESCRIPTION

http://www.freesoftwaremagazine.com/node/2139/issue_pdf

TRANSCRIPT

Issue 18

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Issue 18

By adminIssue 18 is here and with it another bunch of great articles all about free software. We have Andrew Minshowing us how to dual-boot Windows and Kubuntu. There's Mitch Meyran's in depth article on 3D desktopsand Xavier Calbet's one on Fractal generation. Rosalyn Hunter breaks in new users with her follow up articleon using the CLI and Jonathan Roberts gives us all the low down on how to get help with free software. Ofcourse, I'm only scratching the surface... there's a lot more in this fine issue of Free Software Magazine.

Source URL:http://www.freesoftwaremagazine.com/issues/issue_018

Issue 18

Issue 18 1

Issue 18

2

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Editorial

By Tony MobilyThe desktop computer is not dead, but it’s doomed. Laptops are not dead, but they are doomed. And ourmobile phones are going to kill them… sounds unlikely? Well, please read on—and let me know what youthink. People have predicted the death of the desktop computer and the death of the laptop many times. Thesedeath sentences have often sounded like those religions which predicted the world would end by the year2000—then the year 2000 came, and the end of the world was then rescheduled for 2004—then 2004 happilycame and went—and so on.

Just like the end of the world, the end of the desktop computer and laptops, as we know them, never seems tobe getting any closer. The “killers” have been dodged every time, swiftly and quietly. First, it should havebeen the “smart television”, which would’ve made computers obsolete… but didn’t. Then, it should have beenthe dumb terminal—just a screen and a keyboard in your house, with the real computer residing elsewhere.Again, a flop. The internet tablets came along, armed with big PR funds and promises. Nope. Then, it shouldhave been the mobile phone. Well, as far as I know, there are a lot of people right now who are after mobilephones that are just that—mobile phones, without all the extraneous stuff. If the computer, as we know it, wasa person it must have had a good laugh at all the attempted assassinations which have failed one after theother.

However, I believe it’s time for the computer to stop laughing. Now, something has changed.

Four things have happened:

Technology has evolved, and everything now can indeed be small and cheap (rather than big andcheap or small and expensive).

PDAs are becoming as usable and as powerful as computers.• Thanks to bluetooth, there is now a way of adding bits and pieces (see: keyboard and mouse) to yourPDA.

The internet. The computer itself today is less and less important—being able to read and answeremail today is the big deal.

Microsoft realised this very early. This is why it tried to force-feed Windows Pocket PC to anybody releasinganything powerful enough to run it (turning a lot of neat pieces of hardware out there into useless, crashingjunk. But that’s a different story.)

PDA is a very old term. I used it back in 1993) referring to a big bar code scanner which could beprogrammed in Basic. We used to call it the cockroach—it was square-ish, black, and you felt a little uneasywhen it was strapped to your hand. Little I knew, that 14 years later I would be writing an article about PDAstaking over the world.

“Internet tablet” is a relatively new term: it refers to ultra-portable computers often without keyboard andmouse.

Mobile phones are relatively old (I remember some people sacrificing their boot space in their car for the“receiver”), and always immensely popular.

In 10 years, our “phones” won’t be “phones” anymore. They will be called “phones”, but they will be amixture of a PDA, an internet tablet and a phone—and they will kill the personal computer. They have existedfor a while, but right now they are on the verge of becoming immensely popular.

Issue 18

Editorial 3

It will start in 3 or 4 years: there will be a technology to send the signal from your phone to an LCD screen.(This is, in my opinion, the real missing piece in the puzzle.) People will realise that with an LCD screen(under $30), an external keyboard and their phones, they are able to write emails, browse the Internet, andwrite their blogs. The revolution will start from the “normal” people—our mothers, our grandfathers, and(why not) our children. Internet connectivity will be through WiFi or equivalent in 10 years.

In 6 years, people will start noticing: it won’t be a “computer in every home” anymore. It will be a“combination-of-screen-and-mouse-and-keyboard in every home—and a computer in everybody’s hands”.

Sales of normal computers will decline, and sales of such devices will increase. Apple will come up withsomething perfect for the goal—a combination of screen-and-mouse-and-monitor, with a neat proprietary slotto insert your Apple iPhone which will have anything you could possibly want.

In 10 years, the desktop PC sales will be very limited; laptops will still sell; mobile phones will outsellanything else, by far.

The irony? Apple will come up with a fantastic name (iPC? iPDA? iTablet? iAM, short for iAppleMac—Ithink therefore iAM!). Trademark war will break out. But people will still call it “my phone”. Can I connectmy phone/computer to your screen for a minute? I want to type a longish email.

Does this sound unrealistic? Well, then you need to look at:

The Nokia 800• A list of PDAs running Windows Mobile•

They are here. More of them are coming. They will take over the computer world and eat the desktop andlaptop markets alive—all they need, is a way of connecting to a big, flashy monitor.

Free software is already moving towards the PDA market, and it’s doing it well. Who wants to spend moneyfor a Windows license when the PDA itself costs probably less than the license?

Ubuntu’s recent announcement of a new portable Ubuntu distribution can only make me happy.

We shall see.

Biography

Tony Mobily (/user/2" title="View user profile.): Tony is the founder and the Editor In Chief of Free SoftwareMagazine

Copyright information

Verbatim copying and distribution of this entire article is permitted in any medium without royalty providedthis notice is preserved.

Source URL:http://www.freesoftwaremagazine.com/articles/editorial_018

Issue 18

4

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Sun Ultra 20 M2 review

A powerful workstation from a mainstream vendor for areasonable priceBy Martin BrownWhen you are looking for a workstation or new desktop there are a seemingly infinite number of potentialsolutions available. So where do you start? Well if you are after a powerful AMD based computer then youmight want to take a look at the Sun Ultra 20 M2, a workstation based around AMD Opteron 1200 dual-coreCPU, and available at a surprisingly reasonable price.

Workstation or desktop?Historically from a Unix vendor like Sun, the workstation was the desktop equivalent of the big server (orservers) you had in the server room. Workstations were typically of two types. At the lower end of the scalewas the workstation that was designed to operate on the same CPU and platform type as the rest of your Unixhardware and was designed as developer’s workstations so that they could build and test the software thatwould ultimately be executed on the company servers.

At the other end of the scale, the high-end workstations were designed to be used in environments where thereal power was required, for example in engineering environments, computer aided design, fluid dynamicsand 3D modeling (including many of the computer generated animated films we’ve seen recently).

For Sun, workstations of any type were based on the SPARC processor—I cut my teeth on a Sparc2 and latera Sparc10 and over the years have owned an IPC, Ultra5, Ultra1, and currently own an Ultra60, while havingan Ultra 3 Mobile Workstation on test from Sun for more than the last year now (and I still love it, I don’t carehow noisy it can be). SPARC was the standard, at least up until recently.

Today the market and environment have changed, the “big iron” servers are not always based on specializedCPUs like the SPARC series used by Sun. Today a number of the servers that run our internet systems andcompanies operate on the Intel/AMD platform, and the role of the desktop PC now stretches from therequirements of the typical desktop right through to the advanced workstation style environments that werethe preserve of the custom Unix workstation.

SPARC is still a big part of the Sun hardware environment, and still powers their servers. With CPUs like theT1, which provides a higher number of cores and more simultaneous thread executions but at a lower clockcycle.

When Sun started selling AMD based servers, it made sense for them to develop a workstation

When Sun started selling AMD based servers, it made sense for them to develop a workstation that couldsolve the problem of the standard desktop PC and be scalable up to the workstation.

The hardwareThis is where the Ultra 20 fits in, and it manages to suit from the low-end, where the developers willappreciate the high power and low price, right up to providing support for professional level 3D graphics. TheUltra 20 M2 is the new incarnation that includes a dual-core AMD Opteron 1200 CPU. The unit I’ve had ontest consists of a dual-core Opteron at 2.8GHz, 4GB of ECC RAM, a 250GB SATA hard drive and the top ofthe range NVidia Quadra FX video card.

Issue 18

The hardware 5

Figure 1: The Ultra 20 M2’s clean design

The Ultra 20 M2 will support up to 8GB of ECC RAM, and with a suitable 64-bit OS you’ll have full accessto all the memory for your applications. Having that much memory on tap can be incredibly useful forapplications like database development and 3D graphics, where the amount of RAM can be used to hold muchmore data in memory.

They were also kind enough to loan me a 20” LCD panel (a rebadged NEC unit—I already have one attachedto the MacBook Pro). By using an AMD CPU, Sun have produced an interesting machine. Unlike SPARCbased workstations which are limited in their operating system choices (basically Solaris or GNU/Linux), theAMD workstations are able to run a whole host of OS, including Solaris, GNU/Linux (SuSE and Red Hat arecertified) and, of course, Windows.

With either of these latter two choices you could run your alternative OS at the same time as your host OS.Alternatively, you could just multi-boot into whatever you needed at the time. This makes the Ultra 20 M2 awonderful choice if you are a developer who needs to develop on one these platforms, but still needs access tothe corporate email service or applications.

The box itself is a full size tower case (see figure 1), but is quite a clean design, with only the CD drive, powerbutton, headphone and some USB (six in total) and Firewire ports (two). There are also a full complement ofhigh definition audio in/out ports, both on the front and back of the case.

Support is provided on the motherboard for one PCI Express x16 (taken up by the graphics card), an x16 slotwired as an x8 (and therefore suitable for a second graphics card, at a reduced rate), plus three conventionalPCI slots. Two SATA hard disks are supported and you can take advantage of RAID 0/1 support (currentlyonly in Microsoft Windows).

Finally, the motherboard provides two Gigabit ethernet interfaces. I’ve used these ports simultaneously, firstto provide connectivity to the network, and provide a test interface to the T1000 I currently have on test. I’vebeen able to keep both ports at full capacity with various tests.

Inside the case (see figure 2) you’ll find a similar clean design to the outside—there’s a massive amount ofspace in the case, which means you could add a couple of full size PCI cards and fill up on hard drives andstill the case wouldn’t feel cramped. Right in the middle of the motherboard is one of the largest heatsinksI’ve ever seen on a commercial PC system from a mainstream vendor. It’s small compared to the heatsinks onthe T1000 or T2000 CPU, but still impressive.

All that space in the case means that the airflow is efficient. There are a number of fans on the case, and at fullblast the workstation is almost as noisy as the T1000. In normal use though, it’s hard to identify among theother noises in the room whether the machine is on or not. Given that fan noise can be one of the moreannoying aspects of the modern computer, it’s nice to see that Ultra 20 M2 is both quiet and effective.

Right in the middle of the motherboard is one of the largest heatsinks I’ve ever seen

Issue 18

6 The hardware

Figure 2: Inside the Ultra 20 M2

Just don’t expect that peace to last if you provide it with a big complicated processing job, those fans can kickin with a jolt that wakes you up.

Operating system supportAs with any Intel/AMD based PC the range of operating systems supported is suitably large, including Sun’sown Solaris 10 or OpenSolaris, GNU/Linux, BSD and many others. Sun officially provide drivers for the RedHat Enterprise Linux, SUSE Linux Enterprise Server/Desktop and Microsoft Windows. I tried Solaris, RedHat, SUSE and Windows on this machine.

It should be fairly self-evident that Sun’s own Solaris is the preferred solution for the machine. The unit cameinstalled with everything working, but I’ve had to wait for a few revisions of the driver CD to replicate thissituation on later installations. Version 1.5 of the CD seems to work fine.

I’m a big fan of Solaris, and have been since I started using it 15 years ago. The latest incarnation, Solaris 10,includes some significant improvements, including improved network performance (a feature I’ve been ableto take advantage of during testing), support for Solaris Containers (virtualized operating system units), and ahost of improvements in the desktop environment for those people using Solaris as their main computer.

Using Solaris also enables you to take advantage of the bundled software, which includes Sun Java StudioCreator 2, Sun Java Studio Enterprise, the NetBeans IDE and Sun Studio 11. This is a rich combination, idealfor those users developing Java applications, and, with Sun Studio 11, C/C++ and Fortran applications. I’vebeen using Sun Studio 11 for a while now and have found it a excellent alternative to GNU gcc.

Of course, since Solaris is one of the oldest Unix variants, you can download and install a host of otherapplications, including all the GNU tools, Firefox, Thunderbird, MySQL, PostgreSQL, and many others.Some of these are provided as standard, and others are available on a CD provided with the machine. I haven’thad any trouble manually building any of the typical free software solutions for use on Solaris either, andthere are many sites, such as SunFreeware and Blastwave that will provide these solutions for you if you wantthem.

Beyond Solaris, I was impressed with the level of support when using both the Red Hat and SUSE Linuxvariants. The drivers that Sun supplied provide enhanced video driver support that make X fly. I have to admitto not being a regular user of either distribution—I use Gentoo or Kubuntu by choice—but I ran bothdistributions for over a month while doing a variety of tasks, from software development, through web sitedeveloping (including testing a deployment that uses the LAMP stack) and more general web browsing andwriting duties.

Beyond Solaris, I was impressed by both the Red Hat and SUSE Linux variants

The only issue I came across was a small problem with Red Hat not always shutting down properly. SUSEdidn’t seem to exhibit the same problem, so I don’t take this as an indication of a fault with the box.

Issue 18

Operating system support 7

Running Microsoft Windows was also impressive, especially when taking full advantage of the fast graphicscard and trying out some 3D software and the occasional game. The ability to run Windows, especially as adual- or multi-boot system with your other OS of choice is a big advantage.

PerformanceMeasuring performance is an art of course, and I decided to look at the performance in two different ways.The first is by using a standardized performance measuring tool (GeekBench), and the second is just to look atthe machine in terms of how it feels and runs in use.

Geekbench resultsThe Geekbench performance measuring tool has a key advantage over many of the other tools available inthat it is designed to test a range of functionality and is able to do this in a standardized method across manydifferent operating systems. This can be useful, not only to compare different machines, but also to comparedifferent operating systems on the same machine.

I decided to try the Ultra 20 M2 with Windows XP, Solaris and Red Hat Enterprise Linux. I also comparedthis to a 24” iMac (with the T7600, 2.33GHz CPU) running Mac OS X.

I ran the tests 10 times and then took an average of the results. The overall scores were as follows:

Machine Platform Avg. Score Low HighUltra 20 M2 Solaris 272.08 270.1 273.1Ultra 20 M2 Red Hat EL 252.35 250.73 253.51Ultra 20 M2 Windows 289.68 282.3 291.7iMac OS X 245.75 243.0 249.4GeekBench results

Basically, pretty quick. If you use the Geekbench Results Browser you can see the Windows result is right upthere at the top, even beating out a Pentium D, and, in fact, even the iMac beats the Pentium D on the overalltests. If you want the full results, use the GeekBench Results Browser to get an idea.

Basically, pretty quick

What is interesting is the performance difference between the different operating systems. The GeekBenchteam will tell you that this is due to differences in the way each OS handles different elements.

All the results are within 7% of each other overall, and the basic impression you should get from these resultsis that the machine is very quick.

General useHard numbers and statistics aside, what is really important with a workstation like this is what it feels like ingeneral use. I’ve been working with the machine now for more than 4 months and I’ve used it for everythingfrom writing documentation (using OxygenXML, an entirely Java based XML editor), as a developmentenvironment for a Perl/Apache based web project, and using Eclipse and Sun’s own Java Studio.

Issue 18

8 Performance

Figure 3: Ultra 20 M2 and Monitor

I tried the same systems and operations in all the operating systems I tried and not once experienced anyproblems. Building and compiling applications is quick, whether they are Java or C/C++ based, and the dualcores mean that the machine stays responsive throughout.

In some of the more detailed experiments I tried running two different compilations simultaneously (runningboth MySQL 5.0 and 5.1 builds at the same for example), and I was still able to continue web browsing, emailand even writing documentation without any problems.

In all other situations it’s hard to find fault with the machine on a performance perspective.

ConclusionSun have managed to produce a very good machine in the Ultra 20 M2. It’s fast and capable, and has a goodrange of hardware ports and support. As a full 64-bit workstation it is hard to fault, especially when youconsider that prices start just US$845 for a basic dual-core model.

With support for the four main operating systems, including Sun’s own Solaris, two GNU/Linux variants(with full driver support) and Windows (with added RAID support), this machine would be a greatworkstation for the typical developer or engineer who wants to use their OS of choice and the modernrequired alternatives like Windows. Not one of the OSes I tried had any problems, and although it’s targetedas a Solaris workstation, it would be just as happy running GNU/Linux or Windows all day.

That’s not to say that there aren’t some faults and room for improvement. With only four DIMM slots, andRAM officially limited to 8GB, some users will be frustrated by the limitations. Also, the limited PCI expressexpansion could be an issue, especially if you wanted to take full advantage of dual graphics card solutions.

These are really niggles though, rather than serious faults, and don’t let these be reasons for you to rule outpurchasing what is otherwise a very capable solution to 64-bit computing.

Biography

Martin Brown (/user/6" title="View user profile.): Martin â’�MCâ’� Brown is a member of thedocumentation team at MySQL and freelance writer. He has worked with Microsoft as an Subject MatterExpert (SME), is a featured blogger for ComputerWorld, a founding member of AnswerSquad.com, TechnicalDirector of Foodware.net and, and has written books on topics as diverse as Microsoft Certification, iMacs,and free software programming.

Copyright information

Verbatim copying and distribution of this entire article is permitted in any medium without royalty providedthis notice is preserved.

Issue 18

Conclusion 9

Source URL:http://www.freesoftwaremagazine.com/articles/ultra_20m2

Issue 18

10 Conclusion

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Dual-booting Kubuntu and Windows

The step-by-step method to installing Kubuntu and Windows forpeople without any technical experienceBy Andrew MinWe have come to a cross-roads in the computer world today. Stick with the familiar Microsoft Windows, ortry the stable, secure, but unfamiliar GNU/Linux-based operating systems that have recently started taking off.There are two big factors that stop most people from loading GNU/Linux onto their computer. The first is thatthey think they need to be a geek to install it. I admit that it is often hard to install something you’ve never hadexperience with. But with the right coaching, you can do it. Also, people think that you can’t run Windows ifyou have GNU/Linux (so they lose all their games and other important programs). However, it is actuallypossible to run Windows and GNU/Linux on the same computer. So what are you waiting for?

Important note: this article will explain how to install Windows and Kubuntu on the same computer, startingfrom scratch. This is ideal if you don’t have any data on your Windows machine, or if your data is fullybacked up. This article does not cover how to install Kubuntu on an existing Windows machine preservingyour Windows installation.

IntroductionRecently, I was asked by a friend if I would install a GNU/Linux-based operating system onto his machine. Ihad told him about how good GNU/Linux was (virus-free, crash-free, and headache-free). Besides, hisWindows install was completely messed up. But he also wanted to be able to use his Windows-only gamesand programs. So I gave him the best of both worlds by backing up his important documents, formatting hishard drive, and then creating a Windows XP and GNU/Linux dual-boot. This sped up his Windows drive forwhen he absolutely needed to use a Windows-only program, and still allowed him to use GNU/Linux. Youmay be asking, “How do I do it?”. Believe it or not, it is actually very simple.

Which GNU/Linux operating system you should useand whyThe first step is to figure out which GNU/Linux-based operating system (also known as a distribution or distrofor short) to use. After all, there are hundreds to choose from. But how do you choose?

You want a distribution that will install easily onto your computer, one that will install third-party programseasily, and one that looks good. There are quite a few that satisfy one or two of the items on our list, but theonly one that I’ve found has all three is Kubuntu. Kubuntu is based off of the Ubuntu distribution, well knownfor installing easily to your computer’s hard drive. In fact, installing Kubuntu is easier than installingWindows. Since Kubuntu is also based off of the Debian distribution it installs 3rd party programs very easily(as it automatically takes care of dependencies). It also uses the K Desktop Environment, also known as KDE,which makes your computer look very elegant.

Preparing for Kubuntu

RequirementsThe first thing you want to do is make sure your computer can run Kubuntu. Generally, if you can runWindows XP, you should be able to run Kubuntu. If you want numbers, you’ll need 256MB of RAM or more

Issue 18

Preparing for Kubuntu 11

and a hard drive with a capacity of 20GB or more. To find out if you have enough RAM, right-click on MyComputer, click Properties, and in the bottom right it should tell how much RAM you have (1024MB = 1GB).To find out how much space is on your hard drive, open My Computer, right click on the C: drive, and clickProperties. It should show you the amount of free space. If you don’t have enough RAM or if your hard driveisn’t big enough, any local computer store should be able to help you upgrade.

You’ll need 256MB of RAM and a hard drive with a capacity of 20GB or more

You will also need a Kubuntu CD or DVD. There are several options: you can have a copy shipped to you forfree (not recommended, as it takes six to ten weeks to ship), you can order one to be shipped (between $4 to$10), or you can just download it for free. For the last option, go to the download page, click the continentclosest to you, then the country, and then click a location near you. Then, right-click on “CD Image fordesktop and laptop PCs”, and click Save Link As or Save Target As. You may want to consider getting adownload manager to speed things up (DownThemAll is my favorite). After downloading the ISO CD image,burn it to a CD. If you don’t know how to, use the free (as in speech) InfraRecorder. When you download it,open it and hit Actions→Burn Image. Select the ISO image you downloaded, and start the burn. You canalso refer to the InfraRecorder manual, which comes with the program.

Backing upPlease keep in mind that this article is about installing Windows and Ubuntu on an empty, newlyformatted machine. This means that you will lose all of your Windows data. If you don’t want to loseyour data, you will need to back up your Windows drive.

There are other ways to install Kubuntu on an existing Windows machine in which you don’t have to formatyour drive, but starting from scratch is the easiest option (and will clean up Windows too).

If you do have valuable data on your Windows machine, you will need to backup what you want to keep. Youhave a few options for where to backup to: a bunch of CDs, a bunch of DVDs, an external hard drive, or anonline host. Backup all the data that you want to keep (documents, pictures, movies etc). Also, backup yourdrivers. For this use the free (as in beer) DriverMax. Most importantly, write down your product key forWindows XP. If you can’t find it, use the Magical Jelly Bean Key Finder - again, Magical Jelly Bean is free asin cost, rather than freedom (unlike GNU/Linux and most of the software that comes with it). You may wantto write down product keys (also known as registration keys) for other software you have bought. Rememberto backup your data and the installation packages of your programs!

There is one other thing you must do before you install Windows and Kubuntu, and that is to change the bootpriority so that the CD is above the hard drive in boot order. What this does is simply make it so that thecomputer will run off of the CD (so you can install Windows and Kubuntu) instead of off of the hard drive.Consult your manual on changing the boot priority. If you can’t find out how, call your computer’smanufacturer or do a search online for “booting from a cd with INSERT COMPUTER NAME HERE”.Replace the INSERT COMPUTER NAME HERE with your machine’s name, like “Dell Dimension 4700”.

Installing WindowsFirst, you need to get the Windows installer ready. Find the Windows XP CD you got when you first got yourPC (or when you upgraded it from Windows 2000 or 98). Insert it in your PC. You should see a Windows XPprompt. Hit the Enter key.

OK, you are now ready to install Windows. The first thing you will see is an End User License Agreement(EULA). Hit the F8 key. Next, you’ll see a screen listing all your partitions (as shown in figure 1).

Issue 18

12 Installing Windows

Figure 1: Partitions list

Now, delete the C: partition. Highlight it (if necessary) using the up and down arrow keys on your keyboard,then hit the D key. You will be prompted to delete partition C:. If you can’t handle pressure, scream at the topof your lungs and hit Esc key. But if you are brave, and want to install Windows and Kubuntu, hit the L key.Now you’ll see the screen that was in figure 1, with a major difference: it shows Unpartitioned Spaceinstead of C:. Highlight the Unpartitioned Space, and then hit the Enter key (figure 2).

Figure 2: Formatting

Now, wait patiently as XP formats the hard drive. When it is done, it will reboot (or it will prompt you toreboot). As soon as it turns back on, remove the CD. Now guess what? The brains at Microsoft force you toput the CD back in! Put it in, let XP install (don’t go away though, in the middle you will be asked to set timezones and other “useful” things), reboot, take out the CD as soon as the computer turns on, and completeWindows XP setup (pretty straightforward, if you are unsure what to put as your account/user name, just putyour name). When you are done, you should see a blank Windows XP desktop. However, don’t transferyour files or install any programs yet.

Installing KubuntuInsert your Kubuntu CD into the CD drive. Next, reboot the computer. When the Kubuntu menu comes up,choose the first option (Start or Install Kubuntu). The desktop should come up (as shown in figure 4).

Issue 18

Installing Kubuntu 13

Figure 3: Loading the Kubuntu desktop

Double click on the Install icon on the desktop (if two Install windows come up, close one). The installer hassix easy steps, which I will walk you through.

The first step is to select a language. When you are done, click the Continue button.

Second, select your city, and then click Continue.

Third, find out your keyboard layout (most likely U.S. English in the States). Select it, and then Continue.

At the fourth screen, tell Kubuntu to automatically resize the partitions (and pull the scroll bar to 50%).

Tell Kubuntu to automatically resize the partitions

If you can’t do this, then try selecting Use largest continuous space. Now, continue to the fifth screen.

Type in your name, your login (to simplify things, you could put this as the same as the Windows user name),your password, and the name of the computer. Then go to the sixth and final step.

Make sure all the information is correct, and then hit Install. When it is done, click the Restart Now button atthe prompt. Wait for Kubuntu to shut down, then remove the CD when it tells you to (Kubuntu may freeze upon shutdown. If it does, hold down on the physical power button on your computer for a couple of secondsuntil it starts to power down again). Put the Kubuntu CD away. Then, hit the Enter key to restart yourcomputer. Everything is now done. When you first restart, you’ll be greeted with a menu with four options inwhich to boot into. Choose the Ubuntu option (probably Ubuntu kernel 2.6.20-15-generic) toget you into Kubuntu (the last option, the Windows XP option, will get you into Windows). Log in withyour username and password. Now, don’t do anything. Restart again (K Menu→Log Out) just to makesure Kubuntu configured itself correctly. Now, you’re done. You can transfer all your files and folders toeither the Windows partition, the Kubuntu partition, or both (note that Kubuntu can read and write to theWindows partition, but Windows can’t even see the Kubuntu partition. So, it may be a good idea to put yourfiles on the Windows side so both Kubuntu and Windows can access them).

Getting used to KubuntuThe default file manager (like Windows Explorer but better) in Kubuntu is called Konqueror. It can openPDFs, multimedia files, web pages, and much more. Most of your files are stored in the directory ~/ (whichredirects to /home/[USERNAMEHERE]). The external media (flash drives, CDs, the Windows partition,etc.) are located in the /media/ folder. The desktop folder is located at ~/Desktop/.

For creating office documents, use OpenOffice.org (K Menu→Office→OpenOffice.org WordProcessor). It has database, presentation, spreadsheet, and word processing applications bundled with it.And it is compatible with Microsoft Office. For music, use Amarok (K Menu→Multimedia→Amarok) orNoatun (K Menu→Multimedia→Noatun). And for web browsing, you can use Konqueror (not only is it a

Issue 18

14 Getting used to Kubuntu

file manager, it is also a fully featured internet browser).

Where to get help for KubuntuA great spot for help is the Kubuntu Forums. I use it every time I have a problem. A useful thing to do is totake a screenshot of the problem (using KSnapshot under K Menu→Graphics), upload it to a photo hostingsite, then link to it in the forum post. Another good forum is LinuxQuestions.org. It is bigger, so you’ll getmore people helping you. There’s also some documentation from the official Kubuntu site. You can chat withothers for help at via IRC at #kubuntu on irc.freenode.net using Konversation (KMenu→Internet→Konversation, see figure 4). Psychocats has some good beginner guides, thoughmost of the screenshots are from Ubuntu not Kubuntu. Lastly, you can always Google the question.

Figure 4: Using Konversation to connect to the #kubuntu channel at irc.freenode.net.

A great spot for help is the Kubuntu Forums

Want to install more programs? Clicking on Add and Remove in the K Menu will show all the softwareyou have installed, and show some you can get. There’s a handy guide to installing stuff in Ubuntu over at theMonkey Blog, and it works for Kubuntu users too.

ConclusionCongratulations! You now have a Kubuntu and Windows system up and running. Now, help others do thesame thing. Print this article and show your friends. Install Kubuntu for them. Do a video tutorial of installingKubuntu and put it on YouTube (or put it on Revver and make some dough while you’re at it). Blog (or writefor Free Software Magazine) about your experience. Become a GNU/Linux evangelist. Help others in forums.

In most countries selling harmful things like drugs is punishable. Then how come people cansell Microsoft software and go unpunished?—Hasse Skrifvars

Biography

Andrew Min (/user/37372" title="View user profile.): Definition: Andrew Min (n): a non-denominational,Bible-believing, evangelical Christian. (n): a Kubuntu Linux lover (n): a hard core geek (n): a journalist forseveral online publications including Free Software Magazine, Full Circle Magazine, and Mashable.com

Copyright information

This article is made available under the "Attribution" Creative Commons License 3.0 available fromhttp://creativecommons.org/licenses/by/3.0/.

Source URL:http://www.freesoftwaremagazine.com/articles/dual_boot_kubuntu

Issue 18

Conclusion 15

Issue 18

16 Conclusion

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Debian as a desktop system

A good alternative to UbuntuBy Yousef OurabiDebian is well respected as a stable server distribution, and most of the reviews focus on aspects appropriateto server deployments. This article covers Debian on the desktop. It is not a step by step tutorial, but focuseson the highlights of the recent Etch release.

An important difference between Debian Etch and its previous releases is its ease of use as a desktopoperating system. Ubuntu has been in the limelight recently, but it’s important to remember that Ubuntu isbased on Debian, and every once in a while it’s important to return to a project’s roots. Debian was the firstdistribution to have a social contract with its users and its full name is Debian GNU/Linux, a sign of respectand acknowledgment towards the GNU foundation.

I’ve been running Etch on my laptop very successfully and I’m happy to report that previous pain points, suchas wireless networking, “just work” on my Dell laptop. In addition to this new polish, a graphical installer andsupport for the AMD64 architecture are both new to Debian Etch. Also included are many favorite freesoftware Java packages such as Ant and Tomcat into the main package repositories.

Debian has the perception of being a “geek” distribution, but I would make the opposite argument. It is in factinclusive, taking great pride in the number of hardware architectures it supports.

Debian GNU/Linux was the first distribution to include a social contract

Etch contains reasonably up to date core packages. Here are some of the more notable ones:

Xorg 7• GNOME 2.14 with bits from 2.16• IceWeasel 2.x and IceDove 1.x• OpenOffice.org 2•

Iceweasel is Firefox

Iceweasel is a re-branded Mozilla Firefox browser. This was done by Debian in order to comply with ademand from the Mozilla foundation that they either drop the Firefox name and media (icons, etc.) or complywith policies Debian found unacceptable.

InstallationI won’t cover every screen of the installation, only a small sample to demonstrate the new installer. I’ll thencover what I consider to be the most important steps of the installation, selecting and configuring the aptmirrors.

The beginning of the installation process is more or less similar to that of Sarge with two main exceptions: theinstaller (which is new) and the default kernel (now the 2.6 kernel, where you previously had to enterlinux26 at the boot prompt to install the newer kernel).

When the boot loader prompts you (figure 1), enter installgui and hit Enter to start the graphicalinstallation. Or, if you prefer to work the older text based installer, simply hit Enter.

Issue 18

Installation 17

Figure 1: Etch Boot Manager

Here are the installation steps in rough order. Items in parenthesis are actions the installer performsautomatically. I have also provided screenshots as indicated in the steps to provide a more detailed view.

Choose Language1. Choose Country or Territory2. Choose Keymap3. (Hardware Auto detection, Network Auto Configuration via DHCP…etc…)4. Enter Host name5. Enter domain name6. (Disk partition auto detection)7. Partition Disks, note the only way to setup encrypted LVM it use the GUI8. Select Physical Disk9. Partitioning Scheme10. Partition confirmation11. Write to disk12. (Writing partitions to disk)13. Select Time Zone14. Set root password15. Setup user account16. (Installation of base system)17. Configure the package manager, use a network mirror (figure 2)18. Select the Debian Archive mirror country (figure 3)19. Select the Debian Archive mirror within that country20. Configure HTTP proxy information21. Configure popularity-contest22. Software Select (figure 4)23. (Installs selected software packages)24. Select Resolution for xserver-xorg configuration (figure 5)25. Install GRUB as default boot loader26. Installation complete27.

Issue 18

18 Installation

Figure 2: Etch Network Mirror Confirmation. The first of several screens that configure the packagemanagement utility apt is the one confirming whether or not you choose to use a network mirror todownload and install packages from. Select “yes”

Figure 3: Etch Network Mirror Country Selection. This screen prompts you to select the DebianMirror archive that is closest to you. In my case, I chose “United States”

Figure 4: Etch Boot Manager. The software selection screen offers you a selection of packages tochoose from. I’m running Etch on a laptop so I elected to install the “Desktop”, “Laptop” and“Standard system”. This was enough to install a reasonable desktop system, which I could then tweakby installing other packages. Choose whatever you feel is appropriate to your current setup

Issue 18

Installation 19

Figure 5: The Etch installer does a good job of auto-detecting your hardware—simply select yourmonitor resolution and hit Enter!

The desktopThe Etch installer does a good job of auto-configuring Xorg and picking sane defaults. After the installationwas complete, I was presented with a GNOME login screen. Out of the box, I discovered Etch wouldrecognize an iPod when plugged in, detect my network printer almost automatically and allow me to do prettymuch everything I needed to do. There were a few extra packages I needed to install, but Synaptic and aptare a mean pair and make this a breeze.

I really like this zen-like approach to setting up a new system. During the software selection step of theinstaller I simply checked that I wanted both the “desktop” and “laptop” and voila, I had a fully functioningDebian desktop.

Minutes into my first boot, I hooked up my iPod via a USB cable and Etch detected it, mounted it, made itavailable under the “Computer” and launched the default application associated with it (figure 6). This is onpar with other alleged “plug and play” systems. While going into detail about how to manage iPods on Etch isout of the scope of this article, I highly recommend reading “Managing your iPod without iTunes” by JonPeck. I will say I ended up using Amarok to manage my iPod after finding Banshee unusable, but that is aproblem with Banshee and not Debian specific.

Figure 6: iPod, plug and play, Debian style

In my opinion this was a pretty solid start. There were still a few things missing—some applications that I’vebeen meaning to play around with. In previous incarnations of Debian I would simply crack open a shell,possibly do an apt-cache search if I didn’t remember the package name, and then apt-getinstall it. That was until I discovered that beyond simply installing software, Synaptic is a great tool fordiscovering new software I didn’t know about.

Issue 18

20 The desktop

Synaptic & aptThe Synaptic front end to apt has become the de facto standard, included by default in both Debian Etch andDebian derivatives such as Ubuntu.

apt is Debian’s package management tool. There are a number of front ends to it, namely Synaptic which Iam about to cover. It is obviously possible to perform a wide number of operations with the apt-* tools suchas apt-get and apt-cache search, but Synaptic is really the way to go. I’m only going to cover a fewcommon operations that should be enough to get you on your way installing packages.

The first thing to do is clean up the package resource list. These are the remote software repositories that aptsearches for new packages and updates for currently installed packages. By default the installer includes theCDROM used to install Debian in the sources list, something I’ve always found annoying. The second thingto do is add some extra repositories, such as contrib and non-free. These are repositories that are notincluded in the general release due to licensing restrictions.

Start by launching Synaptic via the “Desktop” drop down in the top GNOME bar, then selecting“Administration” then selecting “Synaptic Package Manager”. Once it’s fired up you should see somethinglike what is shown in figure 7. The first thing to do, as mentioned above is configure how apt looks for newpackages. Inside Synaptic select the “Settings” drop down, and then select “Repositories”.

Figure 7: Synaptic Package Manager

This will open the software preferences editor, which is a nice graphical way of configuring the contents of/etc/apt/sources.list. I selected the “CDROM” entry and deleted it, and then selected both“Binary” and “Source” blocks and clicked “Edit” where I added the contrib and non-free repositories. Ineeded the non-free repository because the Intel driver for my wireless chip set is released under a“non-free” license. After this installing my wireless drivers was a simple apt-get command, though Iobviously was connected via a wired connection. That should be all that’s needed for most people.

Issue 18

Synaptic & apt 21

Figure 8: apt-get/Sources configuration

If you do find you need more or simply want to explore apt directly instead, the main apt configuration file is/etc/apt/sources.list. It configures which apt repositories to use, which version (Etch, Sarge…etc.) and which groups (main, contrib, non-free). It should look something like the following:

deb http://mirrors.kernel.org/debian/ etch main contrib non-freedeb-src http://mirrors.kernel.org/debian/ etch main contrib non-free

deb http://security.debian.org/ etch/updates main contrib non-freedeb-src http://security.debian.org/ etch/updates main contrib non-free

Here are some of the common actions you’ll use with apt:

apt-cache search python (Searches repositories for packages with python)• apt-get install vim (Installs vim)• apt-get remove vim (Removes vim)• apt-get clean (Deletes downloaded .deb files)• apt-get -t unstable apache2-utils (*) (Installs apache2-utils from unstablerepository)

dpkg -l (Lists all installed packages)• dpkg -i foo.deb (Installs .deb package you manually downloaded)• dpkg -L apache2-utils (Lists files owned by package, i.e. those installed byapache2-utils)

(*) Requires a line in /etc/apt/sources.list describing unstable target i.e.:

deb http://mirrors.kernel.org/debian/ unstable contrib non-free

After configuring the repositories I returned to Synaptic to install a few applications. I selected the “Graphics”group and browsed for Blender—an application I’ve been trying to learn to use in my spare time. I simplyselected it, and hit the apply button. Synaptic figured out the dependencies and prompted me to mark them forinstallation as seen below.

Figure 9: Installing Blender via Synaptic, as easy as clicking yes

That’s about as simple as it gets, and from there the sky is the limit. My next step was to install the driver formy wireless card, which I briefly cover next.

Wireless networking done rightThough not specifically a Debian innovation, the inclusion, support and integration of the GNOMENetworkManager, along with HAL and Dbus, are part of what makes Debian Etch suitable for the desktop.The GNOME Network Manager describes itself as “pain free” networking, which I’ve found to be very true.

Issue 18

22 Wireless networking done right

The GNOME NetworkManager makes networking pain free

The Dell laptop I run Etch on comes with the common ipw3945 wireless chipset. The first time I tried gettingwireless going it was a huge mess. I had to compile the kernel module, install the daemon, download thefirmware separately and place it in the correct location—all this just to recognize the device.

I then had to go about configuring it for use. The two wireless networks I used the most, one at home and theother at work, both used WPA encryption, which means I then had to install wpa-supplicant, andconfigure it an a variety of ways. I opted to stick everything in /etc/network/interfaces since that’swhat I knew best.

This meant I was commenting and uncommenting different blocks depending on which network I wascurrently supposed to be on. There probably was an easier way that I was just ignorant of, but still…

GNOME’s Network Manager saved me from all of that. On top of that, I find my wireless connection neverdrops, as it frequently does when I’m running Windows.

The trick, and one that initially caught me off guard, was to remove all the previous wireless configurationfrom /etc/network/interfaces, and let the NetworkManager auto-detect the wireless networks. I hadbecome so accustomed to tweaking the interfaces file, that I actually messed up the network manager bycontinuing to tweak it. This really takes the “desktop” aspects of Debian to the next level, something assimple as wireless network, which has plagued me for so long, is now resolved.

Once the driver was installed, I simply selected my wireless network from the GNOME Network Manager infigure 10.

Figure 10: Wireless network selection with the GNOME Network Manager

It then prompted me for the WPA passphrase that I configured to access the network (figure 11). I entered itand—voila!—wireless networking done right.

Issue 18

Wireless networking done right 23

Figure 11: Wireless passphrase

Printing also done rightI have an HP Photosmart 2610 and getting it to work was, well painless. Another FSM article, Printing withUbuntu, by Mark Rais, applies directly to Etch as well and is pretty much all that was required. I usedSynaptic to install hpoj (the HP drivers), which prompted me for various settings during the installation andwere easy enough. Then I simply clicked on “Desktop→Administration→Printing→New Printer” there was anoption to use a pre-detected printer and my network printer was indeed listed. I selected it and hit “Yes” acouple of times, and voila, I was printing from Etch. The ease of this setup may be an artifact of the printermodel I have being well supported so your mileage may vary. So far so good for a desktop experience.

AutomatixAutomatix is a package that gained popularity by providing post-installation polish to Ubuntu by installingapplications that weren’t included in the repositories. It can be used to install many proprietary applicationsusers from other operating systems may be used to having such as Macromedia Flash, and Real Player, as wellas codecs for Windows media files. As of April 2007, it also runs on Debian Etch, and as such I’m going tobriefly cover some of the packages Automatix can install that will spruce up your Debian Desktop.

Automatix can be downloaded from the GetAutomatix.com website.

Automatix works by using Debian’s own package manager, apt, to download packages from either theofficial Debian repositories, or other third party repositories and when applicable configures the systemappropriately.

After the installation you should be able to start “Automatix via Applications→System Tools→Automatix”. Itwill prompt you with a warning stating that it is against the law to install the DVD decryption codecs incertain countries. Obviously readers should obey their local laws. After hitting “Yes” you should be presentedwith the following screen.

Figure 12: Automatix landing

The options most relevant to any desktop system are under “Codecs and Plugins” and “Media Players andEditors”. In the codecs section, I would recommend installing everything you are legally able to, and underplayers the most interesting applications I would recommend are: Songbird, Democracy Player, and RealPlayer.

Songbird is a particularly interesting application, based on XulRunner the runtime environment that powersFirefox and Thunderbird.

Some people make take offense to proprietary applications on a GNU/Linux desktop system—but I’m apragmatist, and I like my media.

Issue 18

24 Automatix

Things to look forward to in Debian

Etch is the first Debian release to natively support the AMD64 platform and take a more inclusive stancetowards free software Java packages. It will be interesting to see how this evolves.

Another interesting development is Ian Murdock, joining Sun Microsystems, and the announcement of project“Indiana”. I think it’s highly likely we are going to see Debian’s package management system included in thenext Solaris release (Solaris 11).

ConclusionI feel that Debian Etch is as good on the desktop as it is on the server. It has a long rich history, a strongcommunity, is amazingly stable and is a great fit for both my servers and my laptop. I urge everyone to give ita go on the desktop.

BibliographyThe installer

Printing in Ubuntu—published in Free Software Magazine

Ian Murdock joins Sun—article

Interview with Murdock

Biography

Yousef Ourabi (/user/43" title="View user profile.): Yousef Ourabi (http://yousefourabi.com) is a developer inthe San Francisco bay area. He is currently working at the startup he recently founded, Zero-Analog(http://www.zero-analog.com " title="Zero-Analog). Zero-Analog is currently developing an enterpriseapplication, however, one of its stated goals is "to increase the rate of open source adoption in companies ofall sizes, across all industries". Zero-Analog also offers consulting services, all based around open sourcetools, frameworks and applications.

Copyright information

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU GeneralPublic License, Version 2 or any later version published by the Free Software Foundation. A copy of thelicense is available at http://www.gnu.org/copyleft/gpl.html.

Source URL:http://www.freesoftwaremagazine.com/articles/debian_as_a_desktop_system

Issue 18

Bibliography 25

Issue 18

26 Bibliography

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Using VirtualBox to run Ubuntu and any otheroperating system

The easy way to run operating systems without messing upyour systemBy Andrew MinGNU/Linux can be scary to a new user. After all, what if you mess up? What if you end up corrupting yourhard drive so badly that you need to format it to get rid of GNU/Linux? The solution is to use virtualizationtechnology. A virtual machine creates a virtual hard drive as well as a virtual computer, so you can install andrun it from within another operating system. If you want to get rid of the virtualized (also known as the guest)operating system, just delete the virtual hard disk from the real (host) computer’s hard drive.

IntroductionFirst, choose which virtualization tool to use. Right now, there are four big ones: Parallels, VMWare, QEMU,and VirtualBox. Parallels is commercial at US$49.99 for Windows and GNU/Linux. For me, that is way tooexpensive. That leaves us with VMWare, QEMU, and VirtualBox. VMWare has two freeware versions. One(called a player) runs pre-built operating systems (known as appliances). The other one (called a server) willmake machines, but isn’t as fast as the professional version. The problem with QEMU is that it is completelycommand-line (there are GUIs made for it, but they never worked for me). Therefore, it is extremelycomplicated to create a new virtual machine with it. Besides, it just can’t do some basic things that the otherscan (like pause a virtual machine, for example). That leaves us with VirtualBox.

VirtualBox is free software. It is cross-platform (runs on Windows and GNU/Linux, with an Intel Mac versionin beta). It runs Windows, OS/2, GNU/Linux, BSD, Netware, Solaris, and L4 guests. And on certain guests,you can install VirtualBox Guest Additions, which lets you share files and more between the guest and thehost. The next version, coming soon, will include support for running the pre-built VMWare appliances [1]. Itsimply works.

Getting VirtualBoxGetting VirtualBox varies from platform to platform. There are binaries on the download site for Windows,Ubuntu 6.06-7.04, Debian 3.1-4.0, openSuSE 10.2, Mandriva 2007.1, Red Hat Enterprise 4, and theUnivention Corporate Server 1.3-2. The SimplyMEPIS site has a guide to installing VirtualBox here. If yourun Ubuntu or MEPIS, you can install Automatix, which will install VirtualBox for you. Lastly, there is also ageneric installer for GNU/Linux on the download page. Unfortunately, there are two versions of VirtualBox:one is freeware and one is free software. These binaries are for the freeware version, rather than the freesoftware version. For some reason, Innotek (the company behind VirtualBox) hasn’t released open-sourceedition binaries. I’m not really sure why hackers haven’t released any binaries using the source code (theexception is one by a Macintosh programmer, who created an unofficial free software OS X 10.4 binary here).However, I am sure binary versions of this fantastic piece of software will eventually appear for manydifferent distributions.To compile, visit the Build_instructions page at the VirtualBox wiki. GNU/Linux andWindows are supported, with Macintosh OS X (Intel-only) and OS/2 in testing.

Setting up your first virtual machineNow that VirtualBox is installed, create your first virtual machine. Your first guest will be the well-knownUbuntu. Download the 7.04 Desktop edition CD image here. When it finishes downloading, open VirtualBox(on GNU/Linux, LD_LIBRARY_PATH=. ./VirtualBox, on Windows, run VBoxSDL.exe in the

Issue 18

Setting up your first virtual machine 27

folder you compiled it in).

Select the “New” button (or hit Ctrl + N). A “New Machine Wizard” window should pop up (figure 1).

Figure 1: New Machine Wizard

Click “Next”. Then, type a name for the virtual machine (I typed Ubuntu). Choose Linux 2.6 (the standard formost modern Linux distros) for the OS type, then hit “Next”. You will be asked how much memory to give.Choose 256MB. For most GNU/Linux distros, you’ll need at least 256MB of RAM to be comfortable (you’llalso need to make sure you have at least 512MB of total physical RAM and have all possible programsclosed). Next, you will be confronted with an option to create a hard disk (figure 2).

Figure 2: New Virtual Disk Wizard

Click “New”, and yet another window opens. Click “Next”. Now, you have an option to create a dynamicallyexpanding image (hard drive) or fixed-size. Fixed size stays a certain size, while a dynamically expanding onegets bigger or smaller depending on what’s on it. For now, choose dynamically expanding. The next dialogasks you how big you want the hard drive to pretend to be (actual size will vary as mentioned before). Choose5GB. Next, make sure all details are correct, then click “Finish” to exit the virtual disk wizard. Hit “Next”,confirm everything is correct, then “Finish” to exit the new machine wizard.

Now, click “Ubuntu” once, then click “Settings” (figure 3).

Issue 18

28 Setting up your first virtual machine

Figure 3: Adding a CD/DVD-Rom

Select “CD/DVD-ROM”. Then, check the “Mount CD/DVD Drive”, select “ISO Image File”, then click thefolder icon. The Virtual Disk Manager will pop up. Click “Add”, browse to the place where you saved theUbuntu file, then highlight it and click “Open”. Now, click “Select” to assign the Ubuntu CD to the Ubuntuvirtual machine. You may also want to make sure the “Enable Audio” under the Audio section is checked, soyour audio is working.

You are now ready. Click “Okay” and then double-click the “Ubuntu virtual machine”. A new window shouldlaunch (figure 4).

Figure 4: The Ubuntu installer

Select “Start or Install Ubuntu”, with the arrow keys, then hit “Enter”. Clicking inside of the window willcapture the mouse so you can use it in the virtual machine. To release it hit the right control (Ctrl) key. Waitfor Ubuntu to load the desktop. Then, double-click on the “Install” icon. Select a language, then a city, then akeyboard layout, and give some personal info. When you are asked to prepare disk space, choose to erase thewhole disk, then hit “Next”. Verify everything is correct, then hit “Install”. Wait for Ubuntu to finishinstalling (this will take a very long time). Then, restart when it prompts you to. It will tell you to remove theCD. Click the “Devices” menu at the top of the window, and click “Unmount CD/DVD-ROM”. Then, hit“Enter”. Ubuntu will finish restarting. Now, you are done! You can delete the CD image by taking thefollowing steps: first stop the virtual machine by shutting it down (click the power button in the top rightcorner in Ubuntu). Then click on the Virtual Disk Manager (“File→Virtual Disk Manager” in the mainVirtualBox window), then the CD/DVD Images tab, then click “Release”, then “Remove”. Then, delete theactual CD image.

More advanced usageNow that Ubuntu is up and running, do some more advanced things with it. You can integrate the mouse (inother words, you won’t have to keep hitting the right Ctrl key to release it) by installing Guest Additions.

Issue 18

More advanced usage 29

Guest Additions will also improve your video support and synchronize your time with the virtual machine’stime. Here’s how to install it: open the Ubuntu virtual machine, click “Devices” at the top of the window, andthen “Install Guest Additions”. Then go to “Accessories→Terminal”, type cd /media/cdrom0. Then typesudo sh ./VBoxLinuxAdditions.run and hit “Enter”. Follow the on screen instructions. Then,restart (hit the power icon in the top right corner). Now, the cursor isn’t trapped inside the virtual machine!

Another powerful tool that VirtualBox offers is the pause feature. If you close the virtual machine, it will popup a message asking whether to power off or save machine state. Powering off is the equivalent of unpluggingthe power cord to the virtual machine. Saving the virtual machine state basically pauses it. It is sort of likehibernating. When you open up a saved machine, it will automatically pick up from where it left off. This isparticularly useful when you are installing a new operating system, and want to turn it off without messing upthe install.

Where to go from hereUbuntu isn’t the only GNU/Linux distribution (or operating system) that VirtualBox can run. It can runWindows, SuSE, Linspire, and much more (see the Guest OSes page at the VirtualBox wiki for more). It’s agreat way to test out GNU/Linux distros before you install them for real. It’s great for security: getting virusesin the virtual machine doesn’t affect the host machine. And GNU/Linux users can run it and Windows at thesame time without paying a cent. All in all, VirtualBox is a powerful program that is worth the download.

References[1] Open source at CeBIT 2007

Biography

Andrew Min (/user/37372" title="View user profile.): Definition: Andrew Min (n): a non-denominational,Bible-believing, evangelical Christian. (n): a Kubuntu Linux lover (n): a hard core geek (n): a journalist forseveral online publications including Free Software Magazine, Full Circle Magazine, and Mashable.com

Copyright information

This article is made available under the "Attribution" Creative Commons License 3.0 available fromhttp://creativecommons.org/licenses/by/3.0/.

Source URL:http://www.freesoftwaremagazine.com/articles/using_virtualbox_to_run_ubuntu

Issue 18

30 References

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Freemind in your kitchen

Represent recipes as mind maps with Freemind. Bonus feature:my father’s own recipe you can try for yourselfBy Gianluca PignalberiTired of reading recipes the usual way? Frankly, I am. I find them more interesting, as well as easier andfaster to read, by representing them as mind maps [3, 4]. In this article I have two goals: to demonstrate analternative format for presenting recipes, and at the same time to provide a short users’ guide for Freemind [1,2]. As I progress through the article I will also be describing a recipe that you can try for yourself—enjoy themeal!

Textbox 1: The recipe —Mario’s fettuccine—

Ingredients (4 servings)

Fettuccine 280g

Butter 200g

Bacon 200g

Milk 0.50 litres

Parmesan 40g

Strip the bacon and put it in the frying-pan along with the butter. Let the bacon cook until it turns goldenbrown; meanwhile, cook the fettuccine in about 3 litres of boiling salted water. Drain the fettuccine when it isal dente and put it in the frying-pan over a hot ring. Pour in the milk and the grated parmesan, frying andcombining them, until the milk curdles and serve immediately.

Glossary

Fettuccine: a kind of noodles, about half a centimetre in width, usually made with eggs.

Al dente: indicates that the boiled pasta is no longer hard, but not yet soft like wet cement. Usually, it issufficient to boil it according to the time indicated on its box but as a guide to deciding when the pasta is “aldente” you can use the following criteria: if it sticks to your teeth because it’s still hard, you need to boil it abit longer; if it sticks to your teeth because it’s too soft (similar to cement) then you’ve boiled it for too longand need more fettuccine.

Don’t be at the window, start entering the main doorReturning to Freemind, the very first thing you will need to do is download the software. Go to the project’swebsite and choose whether to download the minimum or the maximum version; I downloaded the minimumversion but choose whichever suits you best.

After you’ve prepared whichever package you downloaded you will be ready to run it. In GNU/Linux you canlaunch it with the following command, after navigating to the directory where you extracted the downloadedarchive:

Issue 18

Don’t be at the window, start entering the main door 31

$ freemind.sh

in a few seconds your desktop will show the window in figure 1.

Figure 1: Freemind’s main window, as it appears the first time you run the application; in the future,you will be presented with the most recent mind map

If you open a new document you will find it is not completely empty: it shows a single node, i.e. your mindmap’s root. You can edit its text, change its colour, add icons and much more, by right-clicking on the nodeand selecting the appropriate option from the context menu.

We want the root node to contain the recipe’s name and a picture as well (as shown in figure 2).

Textbox 2: A very short summary of mind maps

The mind map’s ancestor, the concept map, was created in the light of David P. Ausubel’s ideas of …learning. By transforming experiences into concepts and giving them meaning they no longer remain separateentities but arrange themselves into groups, or “maps”: this approach mirrors the way our brains learn.

A mind map is a sort of simplification of the concept map because it only allows hierarchical links: a mindmap is a diagram used to represent words, ideas, tasks and other items all linked to a central idea. They havemany different uses ranging from acting as a study aid to an organizational aid, to problem solving anddecision making.

Figure 2: Root final aspect of Mario’s fettuccine mind map

Fathers and sonsThe first thing in any common recipe is the list of ingredients and a mind map will show this as a series ofchild elements. Since Freemind only allows mind maps to be represented “winged” we can only add children

Issue 18

32 Fathers and sons

to the root’s left and right.

To insert a child of the currently highlighted node press the Ins key; if you press the Enter key you add asibling (this is true except for the root node which can’t have any siblings!). Figure 3 shows what an examplemap would look like at this point.

Figure 3: The recipe’s map with some child nodes

Parents and children are automatically linked with an “edge”; Freemind, unfortunately, doesn’t allow you tolabel edges directly but you can always simulate labelled edges with a node. There are two ways to make anode and an edge rest on the same level: either by changing the edge’s text size, or by dragging and droppingthe node into a suitable position. In figures 4 and 5, I show both ways to accomplish the aforementioned task.

Figure 4: Line up two nodes to simulate a labelled edge: select the node to be transformed into anedge and reduce its text size

Issue 18

Fathers and sons 33

Figure 5: Line up two nodes to simulate a labeled edge: drag the node (an ellipse indicates theselected node) and drop it to a suitable position

A parent can show its children (an explicit path), or it can hide them (an implicit path, or short form). The rootnode can only show them, so the recipe’s “short form” will be made from the root and its immediate children,i.e., the ingredients. Figure 6 shows a mind map with both explicit and implicit paths.

Figure 6: The recipe grows. Some nodes are implicit, while others are explicit

You can make child nodes look however you like—for example, I find colour codes work very well when I’mtrying to organise myself. Moreover, a mind map is, in my opinion, more useful than a traditional recipe: toknow how to use an ingredient you have to read a recipe very carefully, but in a mind map you canimmediately see how an ingredient is used by the number of child nodes it possesses.

Free joinCreating a tree diagram using mind mapping software is tricky because it is not usual for two parents to sharea single child. Undoubtedly, there are cases where this would be useful, particularly when working withrecipes: Freemind does make this possible, however, with its Insert→Add Graphical Link feature.

To use this feature hold the Ctrl key to select two nodes: the first node you select will be the link startingpoint and the second will be its end point and will be represented as a Bezier curve with an arrowed head.

Freemind will also allow you to add a local hyperlink which will take you directly to the linked node whenyou click on it; you can also point a hyperlink at an external resource such as a local file or a web address. Inboth of these cases the node will have an arrow icon to its side which indicates the presence of a hyperlink.

Figure 7: The recipe’s mind map is now complete, with all the nodes, edges and links in the rightplace

Issue 18

34 Free join

Textbox 3: Mind-manual and mind-system

When you open the help menu you are presented with a mind map that explains how Freemind works andexplains some of its more common features; if you require more help there is also an online manual.

The program also provides a file browser, which will display the root directory’s content as a mind map; toview a file, Freemind uses another file browser such as Nautilus or Konqueror. You can set your favouritebrowser, as well as all of Freemind’s other parameters in the Tools→Preferences menu.

And now, let’s workNow that I have explained what a mind map is and how to create your own one, you’re left with the hardwork: find all the ingredients and cook the meal. My father tells me he invented this recipe and that hebelieves it could be appreciated all over the world because of the ingredients, some of which are widely usedso the taste shouldn’t seem too exotic.

Even though I used to dislike my father’s recipes, as they are not light at all, I do like this one and wouldrecommend anybody try it!

Bibliography[1] Freemind’s official site.

[2] Freemind Project’s main page.

[3] Mind mapping.

[4] Mind maps and mind mapping.

Biography

Gianluca Pignalberi (/user/4" title="View user profile.): Gianluca (/contacts/g.pignalberi) is Free SoftwareMagazine's Compositor.

Copyright information

This article is made available under the "Attribution-Sharealike" Creative Commons License 3.0 availablefrom http://creativecommons.org/licenses/by-sa/3.0/.

Source URL:http://www.freesoftwaremagazine.com/articles/making_mind_maps_with_freemind

Issue 18

Bibliography 35

Issue 18

36 Bibliography

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

OpenOffice.org and mail merge: how to suppress theAddress2 line

Getting rid of those pesky empty lines in OOo mail mergesBy Solveig HauglandMail merges are a great way to save time, since they pull information from the same fields, over and overagain with each new record in your database. There’s only one problem—all records aren’t created equal; theydon’t all have, or all need, the same fields. This article solves that perpetual problem with labels. If you’realready familiar with the problem, you can go straight to the solution entitled: Suppressing blank lines withsections step by step.

The problem of blank [Address2] linesSome people live in houses; some in apartments. Some work in enormous campuses with mailstops orbuildings in the address; others receive their work mail at a post office box.

Everyone knows this, of course. So why is this worth mentioning? Because it affects how you do mail mergeswhen you send mail to these people. You’ll need all the relevant information for their addresses to print out onlabels, or in the header of form letters. You want them to look like figure 1.

Figure 1: Standard mail merge layout

Some have a second line for the address; some don’t. That’s just the way that addresses are. This is reflected,of course, in the database. You create your database and, for each person, fill in the Firstname, Lastname,Address1, Address2, City, State, and Zip fields as appropriate. If there is no value for the Address2 field, youleave it blank.

So far so good.

Figure 2 shows what the labels template looks like when you set up your mail merge.

Issue 18

The problem of blank [Address2] lines 37

Figure 2: Labels setup

However, this is how your labels will look when they come out of the printer. And, while the post officecertainly will deliver letters and packages addressed like this, it does look kind of goofy. (Think how muchgoofier if you had three address lines in your database.) See figure 3.

Figure 3: Printed version of labels with variable addresses

Nothing shows up where the empty Address2 value is. At least OpenOffice.org hides the empty Address2field. That’s good. But OpenOffice.org doesn’t hide the empty carriage return, the empty line reserved for thatfield. That’s the problem: the carriage return is still there.

The solution to the blank address line issueAnyone who’s researched how to suppress the blank Address2 line knows it’s a frustrating process. There aresome solutions, but they don’t work that well, or they’re complicated, or they only work for letters, not labels.I haven’t tried them all but I concluded from the comments on various forums that we, as OpenOffice.orgusers, have not yet reached the promised land for this issue.

Here are two solutions. The first one is okay if you’re already using the mail merge wizard. The second oneworks under any circumstances for any templates.

An adequate solution for suppressing empty linesChoose Tools→Mail Merge Wizard. In window 3, you’ll see this section (shown in figure 4) that letsyou suppress any blank lines in the address block.

Issue 18

38 The solution to the blank address line issue

Figure 4: Mail merge wizard with the option to suppress blank lines

However, there are two disadvantages: 1) this is a very complicated, yet powerful, wizard; and, 2) it onlyworks for letters, not labels.

The other solution is more elegant and simpler, if not blindingly easy. And once you’ve done it once, it’s veryeasy to repeat.

Overview of the best way to suppress any blank lineWhen I say “the best way”, that is of course my own opinion. But I think once you do it, you’ll see it’sreasonably slick. You can also use it for dozens of other purposes.

The key thing, remember, is to suppress the carriage return that’s associated with the empty field, not theempty field itself. The field is empty so it’s not going to show up, period.

You need to hide the carriage return after the <Address2> field IF the <Address2> field is empty.

I have tried to do this with the Fields window but couldn’t find a way to express a carriage return.

My solution is to use sections, as shown in figure 5.

Figure 5: Sections

Suppressing blank lines with sections step by stepI show how to do this in a WorldLabel template, template WL-OL1125.ott. You can downloadOpenOffice.org templates for free here. However, the principle applies to anything. You can use this in mailmerge letters that you create yourself; you can use it in the templates you get from usingFile→New→Labels; and, of course, you can use it in other WorldLabel templates. The key thing is to

Issue 18

An adequate solution for suppressing empty lines 39

simply create the mail merge the way you usually do, then put the field that might be empty in a section withthe right condition.

A. Get a database.

I’ll assume that you know how to do this or that you already have created one.

B. Create the mail merge.

I’ll show how to do it in the most straightforward way, using the WorldLabel template WL-OL1125.ott.

Open the template. See figure 6.1.

Figure 6: Labels template

Optional: The templates are made of tables. I like to add visible borders to the table so it’s easier totell what I’m doing. Select the whole table and click the indicated icon to put borders on. You canturn them off again before you print. See figure 7.

1.

Figure 7: Showing borders

Click in the first label area. See figure 8.1.

Issue 18

40 Suppressing blank lines with sections step by step

Figure 8: The first label area

Choose Insert→Fields→Other, then the Database tab, and select Mailmerge Fields. See figure9.

1.

Figure 9: Fields window, inserting fields from a table

Select the database and expand to see the table you want to use. See figure 10.1.

Figure 10: Selecting the table containing the fields you want

Select the first field, then click Insert. It will appear. See figure 11.1.

Issue 18

Suppressing blank lines with sections step by step 41

Figure 11: Inserting a field

Type a space after that field in the label, then insert the next field. Press Enter in the label, insert thenext field, and so on. It should look like figure 12 when you’re done.

1.

Figure 12: Inserting additional fields

Select the Address2 field or whatever field you want to suppress if it’s empty. (Select the field, asshown, without the carriage return—I know, it doesn’t make sense but it works correctly this way.)See figure 13.

1.

Figure 13: Selecting the Address2 field to create a section

Choose Insert→Section. The Section window will appear.1. Select the “Hide With” field and type the condition. This condition just says “Hide this part that theuser selected whenever the contents of the field I’m referencing are blank”. See figure 14.

2.

Issue 18

42 Suppressing blank lines with sections step by step

Figure 14: Creating a conditionally hidden section

The following are the syntax and an example.

Syntax (replace the italicized values with the real values):

databasename.tablename.fieldname EQ “”

Example:

mailinglist.Names.Address2 EQ “”

Note: You could hide anything depending on whether any field or variable is blank, or is equal to Montana,or any other value. The possibilities are tremendous.

Click Okay.1. The address block will look like figure 15.2.

Figure 15: The address block with the conditional section

Format the address block the way you want it to look: select the font, font size, style, etc.1. Copy the whole address block and paste it in the next label area, or to wherever you want to use itagain. See figure 16.

2.

Issue 18

Suppressing blank lines with sections step by step 43

Figure 16: Copying and pasting the address block with the conditional section

You only need to do this step if you are using a document you’ve created from scratch yourself, or atemplate you’ve downloaded such as a WorldLabel template. It triggers the next record to appear inthe next label.

1.

Figure 17: Inserting a field to trigger the next record

In the address block that you just pasted, click immediately to the left of the first field, as shown infigure 17.

In the Fields window, select the Next Record field and in the right-hand column of the Fields window,select the table you’ve been using. Click Insert. You won’t see anything appear, but the field will bethere. This is the field that makes the next record’s values appear in the new label, rather than the datafor the same record being reprinted in every label on the page. See figure 18.

Figure 18: The Next Record field

Issue 18

44 Suppressing blank lines with sections step by step

Copy the second address block, with the Next Record field in front of it if you added it. Paste it intoall the other labels in the page. See figure 19.

1.

Figure 19: Copying the record

To print your mail merge, just choose File→Print and click Yes. Leave the checkbox unmarked.See figure 20.

1.

Figure 20: Printing a mail merge

Choose what range to print, and whether to print to a file or to the printer. If you print to the file,you’ll get one document for every piece of paper; if you have 25 addresses on a 10-per-sheettemplate, you’ll get three documents. See figure 21.

1.

Figure 21: Print setup for the mail merge

Issue 18

Suppressing blank lines with sections step by step 45

With the hidden section, you’ll get results that look like figure 22.1.

Figure 22: Printed results, with missing Address2 fields skipped

ConclusionThis isn’t a very easy, wizardy sort of solution. For a beginner or user with “core” skills, it’s not reallypossible. For an average user with some tech skills, it’s workable, and of course you SQL programmers outthere are looking at each other saying “This is hard?” For the first two categories, though, let me emphasize acouple things.

If you’re an IT director or have any sort of authority within an organization, set this up as a template.Do whatever you can to make this easier or invisible for the people using it. Don’t just send out a linkto this article.

You do have the option of using the big mail merge under Tools→Mail Merge to accomplish thesame goal; however, it’s not for labels, just letters.

And on a different note, the conditionally hidden section is extremely powerful. You can use it withmail merge fields or user variables under Insert→Fields→Other, Variables tab, User Variablesitem.

As with nearly everything in OpenOffice.org, suppressing a blank line in a mail merge is possible—but, inthis case, it’s just not obvious.

Biography

Solveig Haugland (/user/20443" title="View user profile.): Solveig Haugland has worked as an instructor,course developer, author and technical writer in the high-tech industry for 16 years, for employers includingMicrosoft Great Plains, Sun Microsystems,and BEA. Currently, Solveig is a StarOffice and OpenOffice.orginstructor, author, and freelance technical writer. She is also co-author, with Floyd Jones, of three books:Staroffice 5.2 Companion, Staroffice 6.0 Office Suite Companion and OpenOffice.Org 1.0 Resource Kit,published by Prentice Hall PTR. Her fourth book, the OpenOffice.org 2.0 Guidebook, is available fromAmazon.com, from Cafepress, and directly from Solveig . For tips on working in OpenOffice.org orStarOffice, visit Solveig's blog: http://openoffice.blogs.com.

Copyright information

This article is made available under the "Attribution" Creative Commons License 3.0 available fromhttp://creativecommons.org/licenses/by/3.0/.

Source URL:http://www.freesoftwaremagazine.com/articles/openoffice_how_to_suppress_the_address2_line

Issue 18

46 Conclusion

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

The story (and the protocols) behind instantmessengers

The history of the instant messengers, from IRC to PidginBy Andrew MinThere was a time when geeks were the only ones who used instant messengers. Not so now. Almost everyone,from high school students to Congressmen, have instant messaging accounts. Businesses use instantmessengers like Lotus Sametime or Novell GroupWise within their companies. How did instant messengersget this far?

In the beginning…One of the first chatting protocols was a chat room network protocol known as Internet Relay Chat, or IRC.IRC was started in Finland in 1988 by Jarkko “WiZ” Oikarinen. Although there were other chat roomprotocols available, IRC gained popularity during the Soviet Coup of 1991, when a group of Sovietgovernment leaders attempted to overthrow Mikhail Gorbachev. While doing this, there was a mediablackout. During this blackout, IRC was the only way to know what was happening in the Soviet Union untilorder was restored. Following the blackout, people started using IRC for other matters, such as technicalsupport chat rooms.

The “Big Four” and JabberToday, things have come a long way from IRC. Nowadays, there are four major instant messaging clientsknown as the “Big Four” (ICQ, AIM, Windows Live Messenger, and Yahoo! Messenger). They supportfeatures such as microphones, webcams, file transfers, skins, and much more. Each have their own protocols(though some work with each other). But the Big Four aren’t the only options for instant messaging. There’salso a VoIP client that thinks it is a chatting program, an open protocol with many of its own clients, andGoogle’s approach.

ICQ: The mother of them allIn 1996, the first major peer-to-peer instant messenger was born. Four Israelis, Yair Goldfinger, Arik Vardi,Sefi Vigiser and Amnon Amir, came together to form a company called Mirabilis. Their first product was aprogram called ICQ, a play on the phrase “I Seek You”. Unlike IRC, ICQ took the approach of letting usersconnect directly to each other through servers, instead of being forced to use a chat room. This novel ideaquickly became popular. Soon, big companies started paying attention. One of these was America Online. In1998, they announced that they had acquired Mirabilis for the sum of US$240 million. In 2002, AOL TimeWarner announced that ICQ had received a United States patent for instant messaging. But ICQ was doomedfor failure. Since many people already had AOL screen names, they were more inclined to use AIM then ICQ.Also, by this time, Yahoo! and Microsoft had announced their own instant messengers, drawing users fromtheir own extensive user bases. ICQ started losing market share quickly. By 2006, they had only 4 millionactive users (compared to Windows Live Messenger’s 27.2 million, this is a tiny amount).

ICQ was the first. Does that mean it is the best? It has quite a few cool features, such as multi-user chats, SMSmessaging, file transfers, games, and audio and video chat. However, there are quite a few downsides to ICQ.First of all, ICQ is stuck with extremely annoying ads, making the interface extremely cluttered. In addition,only Windows users can use the latest official client (6.0). Mac users are stuck with version 3.4.23, whileGNU/Linux users don’t even have an official client.

Issue 18

The “Big Four” and Jabber 47

ICQ Homepage•

AOL Instant Messenger (AIM): One of the more popularWhen ICQ started taking off, people were starting to realize that there was a market for instant messengers.America Online (also known as AOL) was one of these. In 1997, they announced the release of the AOLInstant Messenger, or AIM. Like ICQ, AIM quickly took off. In 1998, AOL announced the acquisition ofICQ, giving them a huge market share in the instant messenger market. In 2003, that share went even higherafter Apple Inc. (then Apple Computer) announced iChat AV, a new instant messenger program that would beincluded in Macintosh OS X 10.3 and using AIM’s OSCAR protocol. And in 2006, AOL announced thatusers of AIM could now receive calls from landline phones for free using AOL’s AIM Phoneline.

So is AIM worth using? Actually, it is probably the instant messenger that users will want to stay away fromthe most. It has even more ads than the rest of the Big Four clients. Even worse, it bundles software that usersdon’t necessarily want and can’t always get rid of, such as the Viewpoint Media Player (which sends usageinformation to Viewpoint), the Plaxo Address Book (which at one time spammed its users), and Wild Tangentsoftware (labeled by some security applications as spyware). Plus, it tries to change the user’s browserhomepage and add desktop icons to things that people don’t need. Additionally, the Mac and GNU/Linuxversions are outdated. All in all, a very unenjoyable experience.

AIM Homepage•

Yahoo! Messenger: Yahoo! joins in the funThe same year AOL bought ICQ, Yahoo! announced the release of Yahoo! Pager (soon to be renamed toYahoo! Messenger). Since Yahoo! already had a lot of users, it wasn’t long before AOL began to realize thatthey didn’t have the corner on the market that they thought they did. Soon, Yahoo! Messenger was a hugerival to AIM.

Yahoo! Messenger helped even the instant messenger playing field. Unfortunately, today’s version of Yahoo!Messenger is crippled with numerous annoyances. Like AIM, it tries to install extra software that users don’tneed (like the Yahoo! Toolbar), and tries to change the user’s browser homepage to http://www.yahoo.com/.It is also hampered by its annoying ads. It does have some nice features like interoperability with WindowsLive Messenger. However, like ICQ, it is also short on platform support (the Macintosh and GNU/Linuxversions don’t even have microphone support).

Yahoo! Messenger Homepage• GYachI (unofficial Yahoo! Messenger clone for GNU/Linux) Homepage•

Windows Live Messenger (formerly MSN Messenger) andWindows Messenger(Microsoft decided that “if Yahoo! and AOL can do it, we can too”.)

Now the instant messenger wars were on in earnest. And Microsoft didn’t help calm them. In 1999, theyannounced the release of MSN Messenger, using the .NET Messenger Service protocol (again, a proprietaryprotocol). In 2000, Microsoft announced some groundbreaking features. Version 3 of MSN Messenger offeredVoIP support. Now, users could call anyone who had MSN Messenger (a feature not many other instantmessengers included). They could also call landlines for a fee using Net2Phone. Then, in 2001, Microsoftannounced that they would bundle Windows Messenger, a MSN Messenger-compatible program, withWindows XP. In 2006, Microsoft re-named MSN Messenger “Windows Live Messenger”, following there-branding of most of their MSN products to their new Windows Live product line.

Microsoft has a huge advantage over their competitors since every single copy of Windows XP sold comeswith Windows Messenger. Therefore, every Windows XP user can chat using the .NET Messenger Serviceprotocol. Unfortunately, Windows Live Messenger struggles from much the same problems that Yahoo! does:platform support. There’s no GNU/Linux version, and the OS X version doesn’t support key features like

Issue 18

48 ICQ: The mother of them all

audio/video chatting. The cluttered interface doesn’t help either.

Windows Live Messenger Homepage• aMSN (unofficial Windows Live Messenger clone for Windows, Macintosh, FreeBSD, andGNU/Linux) Homepage

Jabber: Finally, an open protocolThe year 2000 marked a new milestone: an open protocol. There were several unique characteristics about thisparticular protocol. Unlike the other protocols, Jabber was free software. It also had the idea ofde-centeralizing the servers by allowing anyone to host their own server. Additionally, Jabber let its usersconnect to almost any protocol via transports, so users could use a Jabber client to chat with users using AIM.Finally, Jabber didn’t offer an official Jabber client, opening the field for numerous new instant messengers.These all combined to make Jabber a viable alternative to the Big Four’s protocols.

Since Jabber is an open protocol that has multiple clients, there is no longer any problem with platformsupport. Users now have the freedom to choose what client they want. And since many Jabber clients are freesoftware, ads are no longer a problem. Unfortunately, there is one big downside to Jabber. Unlike the BigFour protocols, there is no official audio or video support (Sean Egan is working on libjingle, a protocolto add audio to Jabber, but not all Jabber clients support this).

Jabber Homepage• List of Jabber clients• List of Jabber servers•

Google Talk: Google does instant messaging right. Sort ofIn 2005, users suddenly discovered that talk.google.com was an active Jabber server. Since this cameright after a report by the New York Times that Google was going to create a communications program, peoplestarted anticipating a new instant messenger from Google. They were right. A few days later, Googleannounced Google Talk, “A Google approach to instant communications”. But unlike their competitors,Google didn’t create their own protocol. Instead, they decided to use standards. Therefore, the Google Talkteam announced that their program would use the Jabber protocol. They also hired Sean Egan, project leaderof the Gaim instant messenger, to work on their new instant messenger. Although, it was at first slow to catchon, the Google share boosted tremendously after they added a basic Google Talk-compatible client to theirGmail web email.

Unfortunately, Google Talk isn’t perfect. First, it has no video support. Also, the audio version is available forWindows-only (users can text chat with Google Talk users using Jabber, but not all Jabber clients supportGoogle’s audio protocol). In addition, it doesn’t have all the features that other Jabber clients have (liketransports or chat rooms). And although Google has done many things for the free software world, GoogleTalk is still only free as in beer.

Google Talk Homepage• Instructions for using 3rd party clients•

Skype: VoIP and chatting uniteIn 2003, Niklas Zennstr?nd Janus Friis, creators of Kazaa, created Skype. Although primarily a VoIP client,Skype included a chatting function that quickly took off. Soon, people were using Skype as an alternative tothe Big Four clients, especially since Skype started adding games, SMS, broadcasts, videos, and other featuresthat the Big Four clients had.

At first, Skype looks like a breath of fresh air. Its ads are much smaller and less noticeable than the Big Fourclients’. It also has the best audio quality (it is, after all, a VoIP application). However, like the Big Fourclients, it is very low on platform support. In fact, the Pocket PC version is more advanced than theGNU/Linux version. Furthermore, like Google Talk, it is free as in beer but not free as in freedom.

Issue 18

Windows Live Messenger (formerly MSN Messenger) andWindows Messenger 49

Skype Homepage•

How to survive in a world with five protocolsMost people can’t download the Yahoo! client, the Windows Live client, the AIM or ICQ client, the Skypeclient, and a Jabber (or Google Talk) client and run them all at the same time. However, in order tocommunicate with people, you will need a way to connect to each of the protocols. The solution is to usemulti-protocol instant messengers. Believe it or not, Microsoft was the first company to try to do this (that’sright, Microsoft actually did something useful and innovative). Users of MSN Messenger 1.0 could connect tothe AIM network. But after AOL repeatedly blocked them, this stopped. In 2002, AOL decided to try a similarapproach by changing ICQ’s protocol to OSCAR, the protocol of AIM, letting ICQ users chat with AIM (andvice versa). And in 2006, Microsoft and Yahoo! announced that their users would be able to chat with eachother. However, all of these approaches only work for a few protocols. That’s where third party multi-protocolmessengers come in.

Pidgin (formerly Gaim): Multi-Protocol messaging beginsGaim (originally GAIM as an acronym for GTK+ AIM, then changed to simply Gaim to avoid trademarkdisputes with AOL) was one of the first multi-protocol messengers. Released in 1998 by Mark Spencer, Gaimpioneered the idea that users could connect to multiple protocols. It was also one of the first free softwareinstant messengers available. Gaim users could connect to Gadu-Gadu, Jabber/Google Talk, IRC, the .NETMessenger Service (Windows Messenger and MSN Messenger/Windows Live Messenger), Novell’sGroupWise, OSCAR (AIM and ICQ), SILC, Yahoo!, Zephyr, Lotus Sametime, SIP, and QQ. Soon, manywere using Gaim. It was named Project of the Month at Sourceforge.net for November 1998. Adam Isercreated a fork of Gaim known as Adium which allowed Macintosh users to use Gaim without using X11.However, not everyone was happy with Gaim. In 2006, Gaim was contacted by AOL’s lawyers. The reason?Once again, Gaim was told to change its name, or face legal issues. Sean Egan (the head of the project) optedfor the latter and announced that Gaim would be renamed to Pidgin.

Figure 1: Pidgin conversation

Pidgin is one of the more popular multi-protocol instant messengers. In fact, several GNU/Linux distributionsincluding MEPIS and the well-known Ubuntu include Pidgin by default. Pidgin can also connect to protocolsthat most other multi-protocol instant messengers don’t (QQ and Zephyr are two good examples). It also hassome cool features like Buddy Pounces, email notification, and a strong plugin API. The only downside is thatPidgin has no audio or video support (despite the fact that Pidgin’s main developer is working on an audioprotocol for Google Talk). Even still, Pidgin is a powerful alternative to the Big Four clients.

Pidgin Homepage• Adium (OS X Fork) Homepage•

Issue 18

50 How to survive in a world with five protocols

Miranda IM: another free multi-protocol IMIn 2000, a Windows ICQ clone called Miranda ICQ was released. By 2003, a stream of developers had comeand gone without accomplishing anything individually. But together, they had done much. That year, thename was changed from Miranda ICQ to Miranda, the first version to be released with full support for theAIM, MSN, and Jabber protocols (Yahoo! would later be added too). From there, Miranda took off. Itsupported tons of protocols, had one of the biggest plugin directories, and was extremely lightweight (it takesup less than 1MB of space).

Figure 2: Miranda

Miranda has a lot of desirable features. It is extremely lightweight. It supports almost every protocol on theinternet. And it has a very strong plugin system (there are over 500 plugins available at the Miranda site).Unfortunately, like Gaim, there is no audio or video support (there is an unofficial plugin to add audio andvideo, but both users must use Miranda and have the plugin installed). Also, it is Windows-only (although youcan run Miranda in WINE). Still, for a slow Windows computer, Miranda is tops.

Miranda Homepage• Unofficial GNU/Linux build• WINE AppDB Info•

Trillian: The free (as in beer) audio/video clientAlthough both Gaim and Miranda were growing in popularity, neither provided a key feature: audio and videochatting. Trillian provided the answer. Founded in 2000 as a free (as in beer) instant messenger, Trillian atfirst was just another multi-protocol instant messenger with support for IRC, AIM, ICQ, and MSN Messenger(with Yahoo! support coming later). Since competing products like Gaim and Miranda had already gotten abig market share, Trillian’s popularity was fairly low. In 2001, that changed. The 0.70 version was releasedwith a huge number of features (including the largest emoticon set at the time). In 2002, it became so popularthat the company decided to create a pro version ($25 a year), with features such as SMS and mobilemessaging capabilities, Yahoo! Messenger video, email alerts, and plugins. However, the popularity soon dieddown. Users started losing interest in waiting months for the next version to come out, and started switchingto other clients. Version 2.0 received little interest. But in 2004, version 3 of the Basic and Pro versions wasreleased with logging, Wikipedia integration, a new skin, and most importantly audio and video support withAIM, MSN Messenger and Yahoo! Messenger. Immediately, downloads started going up. Users startedconsidering Trillian a major instant messenger again.

Though Trillian might seem like it is the perfect answer, it isn’t. While the audio and video support is great(especially since it is included in the freeware version), most of the functionality, such as Jabber support orplugins, is only available in the $25 pro version. It is also, like Miranda, Windows-only (there is a webversion coming in version 4, but it won’t be as functional as the Windows-only client). In addition, Trillian isnot free (as in speech) software but freeware (as in beer).

Trillian Homepage•

Issue 18

Miranda IM: another free multi-protocol IM 51

Kopete: KDE’s response to GNOME’s PidginThere are only three multi-protocol instant messengers that support any type of audio and videocommunication with different protocols. Two are free as in beer (Trillian and instan-t), and one is free as inspeech (Kopete). Kopete was started in 2001 as an KDE ICQ client by Duncan Mac-Vicar Prett. A fewmonths later, AIM, MSN, and IRC protocol support were added. Soon, Jabber (and Google Talk) was alsoadded. MSN and Google Talk (libjingle) and MSN and Yahoo! webcam support were later included. Peoplebegan taking notice of Kopete. Soon, Kopete became a part of the official KDE Network package.

Figure 3: Kopete Conversation

Kopete’s biggest strengths are its audio and video support and the fact that it is one of the few KDE instantmessengers available. However, it has a lot of features missing (including basic features such as assigningbuddy nicknames). Also, it is restricted to GNU/Linux platforms only (though Mac users can run an unofficialversion using fink). Finally, Kopete doesn’t have audio and video support for all the platforms (unlikeTrillian). But if you are a KDE user, Kopete is probably the best option.

Kopete Homepage• Kopete on OS X with fink (unofficial)•

eBuddy and meebo: The start of a new type of instantmessengerIn 2003, a new type of messenger was born: an online one. eBuddy (originally Everywhere-MSN, thenchanged to e-Messenger and later eBuddy to avoid prosecution from Microsoft) was programmed, not in C orC++, but in web programming languages. Although not as powerful as desktop clients like Pidgin or Kopete,eBuddy grew in popularity especially in the mobile world. In 2005, eBuddy was joined by meebo, alsoprogrammed using online languages. Unlike eBuddy, meebo allowed users to log into multiple accounts at thesame time. But this comes with a downside: unlike eBuddy, meebo doesn’t work as well with mobile phones.

So what are the downsides to eBuddy and meebo? After all, both let users instant message from anywhere inthe world that has an internet connection. Unfortunately, neither are extremely powerful. Users can sendmessages and emoticons. No audio calling, no video calling, no offline messaging, and no file transfers.Despite these shortcomings, meebo and eBuddy still remain popular. In fact, eBuddy claims 35 million users,more than either Yahoo! or Windows Live Messenger have.

eBuddy Homepage• eBuddy mobile version• meebo Homepage•

Why these multi-protocol programs occasionally have problems

Issue 18

52 Kopete: KDE’s response to GNOME’s Pidgin

Great! So we have three free software clients (free and open source), and three freeware clients (both eBuddyand meebo are free in price but are closed-source). What could be better? Unfortunately, there’s a problem.The companies behind the proprietary protocols hate them. In 2002, AOL attempted to block Trillian’sSecureIM four times in three weeks. In 2004, Yahoo! blocked all third party services. Gaim and Trillianresponded by temporarily joining forces to crack Yahoo!’s protocol. Skype won’t even let third partymessengers connect to their protocol unless they have Skype installed and running.

Now that you know a little about the protocols, I’ll do a recap of the different ones.

Jabber OSCAR(AIM/ICQ)

.NET Messenger Service(Windows LiveMessenger/MSN Messenger)

Yahoo!Messenger Skype

License Open Proprietary Proprietary Proprietary Proprietary

ActiveUsers

Unknown (40-50Million total,January 2007)

57 Million(September2006)

27.2 Million (September2006)

22 Million(September2006)

9 Million(January2007)

AudioSupport Partial Yes Yes Yes Yes

VideoSupport Partial Yes Yes Yes Yes

GroupChat Yes Yes Yes Yes Yes

The five major protocols

Now that I’ve given you an idea of the capabilities of the major protocols, it is time to choose a client toconnect to them.

AIM eBuddy GoogleTalk ICQLicense Proprietary Proprietary Proprietary ProprietaryType Adware Freeware Freeware AdwareWindows Version Yes (6.1.41.2) Yes Yes (1.0.0.104) Yes (6)MacintoshVersion Dropped (4.7.1333) Yes Using unofficial Jabber

client Dropped (3.4.23)

GNU/Linuxversion Dropped (1.5.286) Yes Using unofficial Jabber

client No

Mobile VersionWindows Mobile, Palm, andany cell phone using AIMMobile

Yes (any) Blackberry Windows Mobile

OSCAR Protocol Yes Yes Jabber transport Yes.NET MessengerService Protocol No Yes Jabber transport No

Yahoo! Protocol No Yes Jabber transport NoIRC Protocol No No Jabber transport NoJabber Protocol No No Yes NoSkype Protocol No No No NoFile Transfer Yes No Yes Yes

MicrophoneSupport Yes No

Yes(libjingle-compatibleclients)

Yes

Webcam Support Yes (Windows-only) No No Yes(Windows-only)

The twelve major clients (1 of 3)

Issue 18

Why these multi-protocol programs occasionally have problems 53

Kopete meebo Miranda PidginLicense GPL Proprietary GPL GPL

Type Free software Freeware Free software Freesoftware

Windows Version No Yes Yes (0.6.8) Yes (2.0)Macintosh Version Yes (0.12.4, requires X server) Yes No Yes (2.0)GNU/Linuxversion Yes (0.12.4) Yes No Yes (2.0)

Mobile Version No No No

Unofficial(Qtopiausing Gaimfor Qtopia)

OSCAR Protocol Yes Yes Yes Yes.NET MessengerService Protocol Yes Yes Yes Yes

Yahoo! Protocol Yes Yes Yes YesIRC Protocol Yes No Yes YesJabber Protocol Yes Yes Yes Yes

Skype Protocol Yes (requires Skype and unofficialplugin) No Yes (requires Skype and

official plugin) No

File Transfer Partial No Yes Yes

MicrophoneSupport

Yes (.NET Messenger Serviceprotocol and libjingle-compatibleclients)

NoYes (only with otherMiranda users withunofficial plugin)

No

Webcam Support Yes (.NET Messenger Serviceprotocol and Yahoo!) No

Yes (only with otherMiranda users withunofficial plugin)

No

The twelve major clients (2 of 3)

Skype Trillian Windows Live Messenger Yahoo! MessengerLicense Proprietary Proprietary Proprietary ProprietaryType Adware Freeware Adware AdwareWindowsVersion

Yes(3.2.0.145) Yes (3.1.5.1) Yes (8.1.0178) Yes (8.1.0.249)

MacintoshVersion

Yes(2.5.0.85) No Yes (MicrosoftMessenger for

Mac) Yes (3.0b1)

GNU/Linuxversion

Yes(1.3.0.53) No No Yes (1.0.6)

Mobile Version WindowsMobile

Unofficial (any usingI.M. Everywhere andTrillian Pro)

Any cell phone usingWindows Live MessengerMobile

Blackberry, any cellphone using Yahoo!Mobile

OSCARProtocol No Yes No No

.NET MessengerService Protocol No Yes Yes Yes

Yahoo! Protocol No Yes Yes YesIRC Protocol No Yes No NoJabber Protocol No Yes (Pro only) No No

Skype Protocol YesYes (Pro only,requires Skype andunofficial plugin)

No No

File Transfer Yes Yes Yes Yes

Issue 18

54 Why these multi-protocol programs occasionally have problems

MicrophoneSupport Yes Yes Yes (Windows-only) Yes (Windows-only)

WebcamSupport Yes Yes Yes (Windows-only) Yes (Windows-only)

The twelve major clients (3 of 3)

ConclusionMost users will end up opting for multi-protocol messengers. And with good reason. After all, runningmultiple messengers will gobble up RAM and CPU usage. But which one? In the end, it depends on the user.If the platform is GNU/Linux and audio and video are important, Kopete is the best bet. If audio and videoaren’t important, Pidgin is probably the best on GNU/Linux. On Windows systems, either Pidgin or Mirandaare good bets.

Biography

Andrew Min (/user/37372" title="View user profile.): Definition: Andrew Min (n): a non-denominational,Bible-believing, evangelical Christian. (n): a Kubuntu Linux lover (n): a hard core geek (n): a journalist forseveral online publications including Free Software Magazine, Full Circle Magazine, and Mashable.com

Copyright information

Figure 1 is licensed under the GNU General Public License as published by the Free Software Foundation.Taken by Nrbelex (http://en.wikipedia.org/wiki/User:Nrbelex) Figure 2 is licensed under Creative CommonsLicense 2.0 by Lordcolus. Figure 3 is under the same license as the article by Andrew Min.

Source URL:http://www.freesoftwaremagazine.com/articles/instant_messengers

Issue 18

Conclusion 55

Issue 18

56 Conclusion

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Firewall Builder

A firewall configuration GUIBy Marco MarongiuHave you ever wanted to configure a personal firewall for your GNU/Linux box, but were scared of thecomplexity of iptables? Well, I might not be able to make you a security expert, but I can show you a tool thatwill help you to configure your personal firewall the easy way. The secret? Firewall Builder (also known asfwbuilder for short).

Firewall Builder is a graphical user interface (GUI) that allows you to configure a number of firewall enginesin many different environments. As of version 2.0.9 it supports these firewall softwares:

FWSM• ipfilter• ipfw• iptables• PF• PIX•

and these environments:

FreeBSD• Cisco FWSM• Linksys/Sveasoft• GNU/Linux (kernel 2.4 and 2.6)• MacOS X• OpenBSD• Cisco PIX• Solaris•

Obviously, if I had to talk about internet security in general and about all possible uses of Firewall Builder onall the possible platforms, I’d be better off writing a book. Therefore, I’ll focus on a specificcase—configuring a “personal” firewall (that is, a firewall that protects just the one computer it is running on)on a DHCP-configured machine. I will create the basic configuration with a wizard and add somecustomisations afterwards.

Firewall Builder is a graphical user interface (GUI) that allows you to configure a number of firewallengines in many different environments

The platform I will work on is:

Linux 2.6 (Debian Testing)• iptables 1.3.6• Firewall Builder 2.0.9•

I will assume that you already installed Firewall Builder on your system (using apt-get or SynapticPackage Manager, for example).

Firewall Builder releases

Firewall Builder 2.0.9 is not the latest release available, but it’s the one that currently ships with distributionslike Debian Testing and Ubuntu Edgy. The latest release is the 2.1.10, which you can compile by yourself by

Issue 18

Firewall Builder 57

downloading the source from SourceForge.

Starting Firewall BuilderYou can run Firewall Builder by finding it in a menu and clicking on its icon, by simply firing up a terminalwindow and typing fwbuilder. The program will come out with a welcome window that asks if you wantto open an existing file or create a new project: choose to create a new one and give a filename, then click on“Next”.

You are then asked if you want to use a Revision Control System and if you want this project to be the defaultone. We are just playing around, so leave them unchecked and go ahead with “Finish”. The real game startsnow.

Figure 1: Starting to create your personal firewall

Look at the “Firewalls” folder at the top left: it’s empty and we are going to create a new one. Right click onthe folder and choose “New firewall” from the context menu.

Figure 2: Selecting your firewall’s platform

You are now asked for a name, a firewall application and an operating system: for the name, choose any oneyou like (“ifts” is the name I give to my firewall for historical reasons); for the other two, I am assuming youare using iptables on GNU/Linux. To use the wizard, be sure to check the “Use preconfigured templatefirewall objects”.

Issue 18

58 Starting Firewall Builder

Figure 3: Starting with a wizard

At this point you are presented a list of canned templates. Please choose “host fw template 1” and go ahead.

Figure 4: Your first firewall configuration is there, already!

After a few moments you are shown a graphical representation of the pre-set rules for this template. As youwill easily realize, you can accept SSH connections, ping requests and other useful ICMP requests (rule 0);you will also be allowed to open connections to anywhere you like (rule 1). The last rule (rule 2) will be theone that will be used if neither rule 1 nor rule 2 match: the connection is denied and the attempt is logged.

Assuming that you are satisfied with these rules so far, how do you actually use them?

Figure 5: Compiling your firewall rules

Issue 18

Starting Firewall Builder 59

Just press the gear button (Compile) in the button bar. A window like the one above will appear. Since it says“Policy compiled successfully” you may well expect to find something somewhere that will finally activateyour brand new firewall, but where?

Just look at the first line, it says

fwb_ipt -f /home/bronto/ifts.fwb -d /home/bronto ifts

Since /home/bronto/ifts.fwb is my source file, then something “ifts”-related has been probably builtin /home/bronto, my home directory. Just take a look (using Nautilus or using the command line) and youwill find a .fw file in that directory (in my case: /home/bronto/ifts.fw). It’s a shell script that youmay want to take a look at: you will see that he rules you created graphically have been transformed intoiptables commands.

To apply those rules, just run that script as root and you’re done.

If you don’t want to use the command line, and you are using GNOME, you will need to open a “rootNautilus window”. To do so, press ALT-F2 (under GNOME) and type: gksudo "nautilus--browser". Find your home directory (in my case, /home/bronto) and double click on the fileifts.fw. Choose the option “Run in terminal”, and voil? the firewall command is run!

Figure 5a: Running a command

If you are more accustomed to using the command line, you can run the newly created script by opening aterminal and running:

$ sudo /home/bronto/ifts.fw

It’s just been a few minutes using Firewall Builder and you already have a firewall running on your PC!

Editing the rules: removing servicesYou might not want to allow anybody to connect to your PC via SSH. In this case, all you have to do is clickon the SSH service in the interface and press the “Del” key and the service will disappear. You can nowrecompile and run the new script, but before doing that it’s better to wipe away the old rules. Just type thesefew commands into a terminal as root:

iptables -Fiptables -Xfor CHAIN in INPUT OUTPUT FORWARD ; do iptables -P $CHAIN ACCEPT ; done

Those three lines will flush the rules from all tables, flush all user-created chains and reset the default policyto ACCEPT for the three main tables: INPUT, OUTPUT and FORWARD. You may want to place those linesinto a shell script. I did it and called it shutdownfw.sh.

Issue 18

60 Editing the rules: removing services

You don’t have to run the command line to run these commands. If you re using Gnome, right click with themouse in your home directory, and pick “create empty file”. Name the file shutdownfw.sh. Right click onit, and choose the tab “permissions”. Tick the box “Allow executing file as program”. The file is not markedas an executable file. Now, double click on the file. Rather than choosing “Run in terminal”, choose“Display”. Then, paste this in the file:

#!/bin/bashiptables -Fiptables -Xfor CHAIN in INPUT OUTPUT FORWARD ; do iptables -P $CHAIN ACCEPT ; done

They are precisely the same as the ones I wrote earlier, but with #!/bin/bash at the top.

Figure 5b: Setting the permissions

It’s all ready to go: just double click on the same file, but this time choose “Run in terminal”. The programwill be executed, and the firewall rules cleared.

Editing the rules: adding servicesSuppose you want to enable more services. For example, you have a web server on your PC and you want toallow people to connect to it.

If you click with your mouse on the pull-down menu that currently shows “User” you will get a second itemto click on: “Standard”. When you click on it, a new series of folders will appear in the box below. Open the“Services” folder, then the subfolder “TCP” and look up the “HTTP” service. Just drag it and drop it into the“Services” column in rule 0—that’s all. You can also delete freshly added rules if you like, following theinstructions I wrote earlier in the article. When you are happy, recompile and run the script again to activatethe new rules.

iptables is powerful and complex: Firewall Builder hides a lot of complexity but it also hides a part ofiptables’ power with it. To get the most out of iptables you need to understand it in depth, and you also

need some knowledge of internet security principles and internet protocols

Only allowing local computersWhat if you wanted only the other computers on your local network to connect to the web server? It’s a bitmore elaborate than the previous cases, but I promise it’s not that difficult. Let’s suppose that your localnetwork has the very common private addressing 192.168.1.0/24 scheme (hosts in your network have theaddresses 192.168.1.1, usually assigned to the gateway, 192.168.1.2 and so on up to 192.168.1.254).

First, you are restricting access from a specific network. Hence, you can’t use rule 0 that acts on any sourceaddress; you need to add a rule.

Issue 18

Only allowing local computers 61

Figure 6: Adding a new rule

To add it under rule 0, right click on “0” and select “Add rule below”. You will get a window like the one infigure 6.

You then need to change a number of things.

First, you always add “deny” rules by default, whereas this time you’d like to add an “accept” one; so, rightclick on the “deny” icon and select “accept” instead. Also, new rules have logging activated by default;usually you don’t need to log packets that match “accept” rules (while you often need to log those that match“deny” ones), so right-click on the logging icon as well, and disable it.

Now for the interesting part. As before, drag and drop the “HTTP” service in the “Service” cell. After that,open the “Objects” folder, then the “Networks” subfolder: look up the “net-192.168.1.0” icon and drag anddrop it into the “Source” cell.

So far so good, but now you are missing the icon for the “destination” cell—where did your host/firewallhide? Well, since it’s your firewall rule, its place is not in the “Standard” folders but in the “User” folders. Goback to the “User” folders by clicking on the pull-down menu on the top left that currently displays“Standard”; look up in the folders and find your rule in the “Firewalls” folder, then drag it to the cell. You aredone!

Running the firewall script automaticallyIf you want to run your firewall script automatically, you can add it to your rc.local file. If you arerunning Debian or a Debian-based system (such as Ubuntu), and assuming that your script is/home/bronto/ifts.fw, you can just add /home/bronto/ifts.fw to the file /etc/rc.local(before the exit command at the end of the script). You can do so using the GUI (as explained above, usingthe “root Nautilus window” to edit /etc/rc.local).

Issue 18

62 Running the firewall script automatically

Figure 6a: The new /etc/rc.local file

ConclusionIn this article I gave you just a few, simple examples that, I hope, will help you in getting started with FirewallBuilder. You can go on and experiment with it.

Keep in mind that iptables is as powerful and complex: Firewall Builder hides a lot of complexity but italso hides a part of iptables’ power with it. To get the most out of iptables you need to understand it in depth,and you also need some knowledge of internet security principles and internet protocols. Creating youriptables rules with Firewall Builder” and understanding what they do is a good way to learn how iptableswork, but don’t expect to go that far without going deeper into the theory.

BibliographyFirewall Builder web site

Biography

Marco Marongiu (/user/26" title="View user profile.): Born in 1971, Marongiu graduated in appliedmathematics in 1997; he's now a full-time system administrator for a European ISP. He's also a Perlprogrammer and technical writer and lecturer by passion, and is interested in web and XML relatedtechnologies. Marongiu has been a Debian User since version 1.1.10 and he helped found the GULCh LinuxUsers Group (Gruppo Utenti Linux Cagliari), the first one in Sardinia. He recently became a father to his firstson Andrea, and he's been trying to reorganise his life since, so that he can start writing technical articlesagain and holding seminars.

Copyright information

This article is made available under the "Attribution-NonCommercial" Creative Commons License 3.0available from http://creativecommons.org/licenses/by-nc/3.0/.

Source URL:http://www.freesoftwaremagazine.com/articles/firewall_builder

Issue 18

Bibliography 63

Issue 18

64 Bibliography

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

3D desktops—Beryl, Compiz and more

They can be both useful and fun to useBy Mitch MeyranSome would say 3D desktops are useless fluff; some swear by them. This article gives you an overview oftoday’s 3D desktop options, and how they can help you be more productive.

Barring that, you can still brag about your top-notch computer in front of those poor Aero Glass-limitedfriends of yours.

Beryl and Compiz are two sides of the same coin: in fact, Beryl is a fork of Compiz, headed towards glitz andshiny stuff, while Compiz tries to become as stable as possible.

Beryl and Compiz are two sides of the same coin

Recently though, Compiz reached a stage where it was stable enough to start adding nice stuff; since Berylhasn’t progressed that far away from Compiz yet, the two projects are currently attempting to merge backtogether. The core system will be a modified Compiz, some basic plugins will be linked to it, but stuff likeBeryl’s plugin manager, themes manager, several plugins and the configuration panel may remain.

What hardware do you need?Essentially, any video card that has working 3D under Xorg may work. I’ll give you some details,manufacturer by manufacturer.

ATIThere are two drivers for ATI/AMD cards: the free Xorg radeon driver, and the proprietary fglrx one.

radeon—free, default

supports all r100 and r200 chip families fully; r300 is very well supported too. r400 and more recentare touchy at best

performance is best when using the latest Mesa CVS snapshot, and a kernel version 2.6.18 or better.• AIGLX supported—preferred option.•

fglrx—proprietary, extra install

latest version supports r300, r400 and r500 chip families.• XGL is the only option.• Option "Composite" "disabled" needs to be set manually in xorg.conf.•

NVIDIABasically, the same as ATI/AMD’s offer: free and proprietary

nv and nouveau—free

No 3D yet, plain and simple.

Issue 18

What hardware do you need? 65

The nv driver is maintained by NVIDIA and supports their whole range of hardware on all platforms,but it’s 2D only.

The nouveau driver is based on nv for 2D, but has seen EXA and DRI support added and is adding 3Dsupport. However, it doesn’t support textures yet; it is still very much experimental.

nvidia—proprietary

96.xx and 100.x: for Geforce2MX (96.xx up to Geforce 4, 100.x from Geforce FX up) to Geforce8, supportfor AIGLX, Xorg ABI 1.0 and accelerated GL_EXT_texture_from_pixmap. The different driverversions may indicate a focus on programmable shaders depending on the hardware.

There is an annoying bug under Beryl with drivers 96.xx and more recent: when you fill up the frame buffer,all subsequent windows (or dialogues) will appear black. This is caused by Beryl’s use of an NVIDIA specificrendering method; forcing Beryl to use AIGLX will fix the bug, at least on driver versions 97.55 and100.14.03, with the price of a slight reduction in performance depending mainly on frame buffer size:

32MB: forget about this fix, it’s slow as molasse.• 64MB: with a screen that isn’t too big (1024x768), you can consider it. You may want to disabletriple buffering too.

128MB or more: go for it.•

As far as I know, Compiz doesn’t use the NVIDIA rendering method and thus doesn’t fall for the bug.

Options for xorg.conf in the “Screen” section:

Option "AddARGBGLXVisuals" "true" makes window borders work.

Option "TripleBuffer" "true" gives more fluid graphics

IntelDriver is in Xorg, Mesa and Linux DRM trunks, supported directly by Intel; it works out of the box. Nonotable bugs, full support—except for the long forgotten i740. i810 to i965 work well now.

MatroxThere are two sources: Matrox-published source code for g100 to g550, and rewritten Xorg code. The latter isusually preferred.

3D should work, and AIGLX is supported; however, both drivers are quite buggy and your experience mayvary. My advice: try AIGLX then XGL on the free driver first, before you attempt to compile the Matroxsources.

OthersExcept the 730 Sis family which has a working free 3D driver, they are not worth mentioning. This maychange, but don’t hold your breath.

The software itself: Compiz or Beryl?Compiz is essentially the basis of Beryl, the latter being supplemented with plugins; as it stands though, mostof the plugins developed for Beryl are either extensions upon Compiz’s set, or brand new ones. Since studyingCompiz’s plugin means looking at a “cut-rate” but much more stable subset of Beryl’s own set, we’ll studyBeryl’s plugins and say how they are common with Compiz’s when needed.

Issue 18

66 The software itself: Compiz or Beryl?

The standard packageEssentially, Beryl is a compositing window manager—meaning that clients (applications) connected to it sendfull windows to it and Beryl does what it can to display them on screen. Beryl alone merely handles windows,that’s it. The first subset of plugins are windows movement, positioning, and resizing. Can be added, bordersnapping, window switcher, window attributes, scaling. This set of plugins bring it up to par with the best“classical” WM out there.

Now that you can move your windows, you need to decorate them: add borders, a window title, buttons…That’s a job for the window decorator. Beryl comes with its own, called Emerald, which allows you to choosewhatever theme you want; these usually come as mock-ups of other OSes’ interfaces, with addedtransparencies, gradients, etc., or completely new ones. It allows the use of Compiz themes too.

However, you can make use of your native environment’s themes with window decorators such asAquamarine for KDE or Heliodor for GNOME, which replace your environment’s decorator while retainingits themes—with improvements such as linear gradients in translucency applied to inactive windows, and dropshadows. This makes it much less jarring when switching Beryl on and off too (figures 1 and 2).

You can make use of your native environment’s themes. This makes it much less jarring whenswitching Beryl on and off

Figure 1: Detail of a GNOME desktop without Beryl…

Figure 2: … and now with Beryl. Notice the translucent window titles on inactive windows

The most well-known thing about Compiz and Beryl is the cube. Essentially replacing virtual desktops forGNOME or making a single desktop 4 times larger than before, the Cube plugin is probably the core of mostfurther plugins (figure 3).

Issue 18

The standard package 67

Figure 3: Details of a rotating cube; notice the added depth given by Beryl with windows distancedfrom the desktop

Other plugins include “fade to desktop” which allows fast access to the desktop, and cube cloning.

Lastly, a trigger (some distributions use F12, others use a small screen area) allows all windows to be arrayedin a mosaic on the desktop, allowing you to choose the new active window in a snap (figure 4).

Figure 4: Mosaic window chooser in action

Differences with CompizThe following plugins are very specific to Beryl:

The window switcher has a secondary mode, called ring mode (figure 5), that displays small captures ofopened windows in a 3D carousel. The window scaling and snap to border may not be part of Compiz’sstandard array of plugins either.

Issue 18

68 Differences with Compiz

Figure 5: One Ring to see them all

Beryl adds upon it by increasing windows sense of depth (figure 3 again): you can set all windows to stack“closer” to you, giving a better view of them—you can even make them thick instead of paper thin. It is usefulwhen the desktop is cluttered and you use free rotation to see what’s behind on top of giving a better “feel” forthe desktop, but other than that it’s pure glamour.

Animations allow you to apply different effects to different actions made to a window: minimize like a geniegetting back in its bottle (figure 6), or fold the window, fade it out (several variants)…

Figure 6: The Magic Lamp effect. Notice the small snapshot of the window in the Taskbar

Deformations are common with Compiz’s “jelly” window behaviour. Funny at first, it gets really annoyingreally fast.

Blur effects are also available. Pure glamour, it allows you to emulate some of Vista’s AeroGlass effects.Heavy in resources and pretty useless, I recommend you deactivate these.

Some extra plugins allow you to doodle on screen, water effects, splash screens..

A very useful accessibility is the interactive zoom plugin: with it, you can instantly magnify a portion of thescreen. Content stays editable. Another useful thing when, say, typing a document, is the ability to see intransparency what is under the window. This is, for example, priceless when describing a full-screen image ina text editor without having to switch from one to the other all the time.

Issue 18

Differences with Compiz 69

Figure 7: Several translucency settings

Some extra plugins allow you to doodle on screen (figure 8), make a screen copy, give water effects, get asplash screen, window previews (useful for minimized apps—see figure 6) and a benchmark.

Figure 8: Doodling on your screen? Bad, bad you!

Image management allows you to decide what images will be supported by Beryl: PNG, JPEG and SVGsupport allow you to put images on the top or bottom of the cube.

Differences between Beryl and CompizThe nicest thing added to Beryl compared with Compiz, is the Beryl manager—which allows you to changestuff such as operational modes for Beryl, what WM is in use, what window decorator is used, what pluginsare active, and allows you to start the Emerald theme manager. You can also import Compiz’s options; Berylcan either store its data in GNOME’s gconf “hive” or in a flat file. On Compiz’s side, you need to usegset-compiz—which is quite a bit less entertaining—to set it up, on top of a GNOME hive.

On Compiz’s side, you need to use `gset-compiz`—which is quite a bit less entertaining—to set it up ontop of a GNOME hive

The Beryl manager allows you to do away completely with command lines such as compiz --replaceand also allows a backup WM to be loaded if Beryl crashes (this can be done through a plugin too). It is alsoquite handy to disable 3D use when starting a full-screen game, when the 3D driver won’t allow hardwarevideo overlays (making video a tad choppy) or to start the theme manager without having to hunt for it. It,moreover, dispenses you with configuring start-up scripts to engage 3D mode, as it will start with the latestWM active when it was shut down—starting Beryl-manager can thus start Beryl automatically too.

Most (if not all) of these plugins have several options that are activated by triggers (usually, key sequences,but also screen areas or timers) that can be set up in Beryl Setting manager (figure 9).

Issue 18

70 Differences between Beryl and Compiz

Figure 9: The Beryl Settings manager

Personally, I prefer to associate most of them with the “Super” key plus a sequence (the “Super” key isusually the Windows logo key in the keyboard, but could be the Apple or Command key on a Mac) such as:

Super + mouse wheel: interactive zooming• Super + mouse click (hold): free cube spinning• Super + left/right/up/down: snap to cube face• Super + Alt: doodle mode• Super + Tab: ring window chooser• Alt + mouse wheel: window transparency•

These don’t normally interfere with GNOME’s hotkeys, but you are free to choose.

What else?

GNOME vs. KDEWhile the two environments can be mixed and mashed to a great extend, due to Compiz having beendeveloped primarily for use with GNOME, integration with KDE is a bit more troublesome. As such, you’llhave much more success making both Compiz and Beryl work nicely with GNOME than with KDE; note thatdue to its ability to store settings in a flat file, Beryl doesn’t need GNOME as much as Compiz does.

Under KDE, you won’t get virtual desktops anymore, only a very wide desktop split in four (default numberof faces for the cube).

Graphical bugs may also occur more frequently under KDE than under GNOME—it is getting less frequentthough.

LimitationsWhile you can ask Beryl and Compiz not to redirect full screen applications to textures, the abundance ofways to get an application full screen often result in this setting being inefficient. In that case you frequentlyneed to switch off Compiz/Beryl.

Hardware video overlays are the best way to get video on screen flicker-free and save on CPU time; such anoverlay allows the card to receive a YUV chain of images and does the YUV to RGB conversion on the fly.The overlay doesn’t use the frame buffer but has a dedicated share of memory—this is why making screencapture of a video overlay results in a black or solid colour-keyed rectangle—and this also causes the video tonot follow the cube’s rotation or windows scaling.

Note: NVIDIA binary drivers do software redirection; when an overlay is created in 3D mode, said overlaybecomes virtual and is sent as a texture—making those following the cube’s rotation, at the price of a very

Issue 18

What else? 71

slight flickering. Cards with programmable shaders can still accelerate the YUV to RGB conversion, as suchCPU use doesn’t go up a lot.

Compiz and Beryl concentrate on the desktop; as such, window planes are always parallel to the cube’s faceto which they are linked. Other 3D managers don’t always use the same philosophy, which leads us to…

Some other compositing window managersProject Looking Glass was the first such 3D desktop worth its name; it allowed you to stack windows, and torotate them on their X, Y and Z coordinates.

More recently, a French project took up the same principle of acting on the windows: it is called Metisse(figure 10), and is right now available in Mandriva 2007.1 Spring and others such as Ubuntu and Fedora.

The interest is that the desktop gets a real depth in Metisse: windows are really in 3D, and you can interactwith them when they are turned. The prerequisite are the same: some 3D hardware, the ability for the X serverto do compositing. Metisse also provides a window manager and a decorator.

Windows are really in 3D, and you can interact with them when they are turned

Please note that for now, no extra plugins have been created: you have to turn and fold the windows yourselfand set the transparency level manually. However, pre-recorded behaviours could include stacking thewindows on a side of the screen, putting them in a real carousel for window switching, make them spin away,or even rolling them so as to see only a few lines at a time—or magnifying those same few lines.

Figure 10: A little preview of Metisse (screen capture courtesy of Alessandro de Oliveira Faria)

ConclusionWhile still very much eye-candy oriented, several uses can stem from the extended options a compositingwindow manager provides, and 3D acceleration makes it very smooth while at the same time unloading theCPU from window management tasks. As such, even if you end up using only a few options from the plethoraavailable to you, there is still something to gain in tinkering with those environments.

BibliographyThe Beryl project website.

The Compiz project website.

Mandriva’s Metisse page.

The latest version of my 3D driver matrix.

Issue 18

72 Bibliography

The NVIDIA forum page that yielded the black windows bug workaround.

Biography

Mitch Meyran (/user/17379" title="View user profile.): Mitch is a professional computer abuser. He started onthis peculiar kink when he got a 8088-based PC, and soon found out that tinkering with computers is almostas fun as using them - provided the OS lets you do it.

Copyright information

Image in Caption 10 downloaded from http://www.linhadecodigo.com.br/artigos.asp?id_ac=567; copyrightAlessandro de Oliveira Faria.

Source URL:http://www.freesoftwaremagazine.com/articles/3d_desktops-beryl_compiz_and_more

Issue 18

Bibliography 73

Issue 18

74 Bibliography

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Why everybody should use GNU/Linux, and how?

5 reasons why you should use GNU/Linux, with 10 bonus tips ifyou decide to do so!By Phil ThaneGNU/Linux is getting bigger and bigger. Microsoft’s recent patent threats are definitely helping GNU/Linuxto gain mainstream popularity. Unfortunately, new users are often confused by why they should actually useGNU/Linux, and how to go about the transition. Hopefully, this article will fill that gap!

Why should everybody use GNU/Linux?Number one reason, it’s fun. Windows XP has been around so long and changed so little, it’s boring. Vistalooks slightly more interesting, but it’s expensive and won’t run on a lot of hardware (including mine!).GNU/Linux caught up with XP a few years ago and beat Vista to things like 3D desktops and windows withvariable transparency. Even if you stick to basics, it’s fun learning a new operating system and newapplications. It’s especially fun if it doesn’t cost you anything.

Figure 1: Beryl 3D desktop on Mepis

Reason two, therefore: it’s free. If you download a user friendly distro like Kubuntu it will fit on a single CD,so a cheap CD-R from your local bargain store is all it will cost. It’s free in a more important sense too. Noone stops you from copying Linux: the trademark is owned by its creator Linus Torvalds, and the code isowned by many programmers worldwide, but the actual code is released under the GNU Public Licence(GPL) so anyone can do what they want with it. You can install it wherever you like on as many PCs as youwant, copy it, sell it, give it away, even hack into the code and change it if you know how. You don’t need toactivate it or register it.

Reason three: community. Conventional software comes with a user guide and sometimes a help desk that youcan phone and argue with when it doesn’t work. GNU/Linux doesn’t: it comes with a community of people allover the world; some of them are developers, some write help files or design icons, some are just users. All ofthem are committed to using GNU/Linux and encouraging others to use it. So, if you’re stuck, there will be aforum or a mailing list somewhere that can help. But they’re not getting paid and they’re not there to blame,which brings me to…

Software for grown ups

Issue 18

Why should everybody use GNU/Linux? 75

Figure 2: Xubuntu is Simple clean and fast

Reason four: responsibility. Buy a proprietary software licence and it comes with some (often limited)guarantee from the vendor, especially if you are a big company. GNU/Linux, and free software generally,doesn’t. It comes with a warning that this is offered free to people that think it might be useful. If it isn’tuseful, if it doesn’t work or doesn’t do what you thought it did, or even if it trashes your PC and burns thehouse down, that’s your responsibility. You are expected to treat it sensibly. To test it thoroughly, to takesensible precautions like doing a back-up before you install in case it goes wrong. In short it’s software forgrown ups. But…

Reason five: it is very reliable. In four years I have never crashed GNU/Linux, despite installing someexperimental “alpha” versions and taking liberties with things I didn’t really understand. Some free softwarewill crash, especially early versions. The well established stuff like OpenOffice.org, the GIMP, Kontact andKonqeror are bomb proof. About two years ago I managed to crash the KDE Desktop by trying to use thesame “home” directory and the same KDE settings on two computers with very different hardware. I wassimply dumped back at the log in screen but the underlying operating system carried on quite happily.Basically it was saying, “You boobed, you’re out of here, but I’m fine”.

Now, four years of using (and frankly messing around with) GNU/Linux have taught me a lot, and I’ve hadbeginners and potential GNU/Linux users ask the same questions over and over, so here’s Phil’s Top TenTips:

10 tips

Figure 3: Puppy Linux a fast Live distro

Nervous first timers should try a LiveCD version such as Knoppix, Puppy or Mepis (see links). It willrun more slowly than an installed operating system, but it will give you an idea of what a GNU/Linuxdistribution looks and feels like. Live “distros” use Windows “temp” directories which are wipedwhen you shut down, so no permanent changes are made to your hard drive. Work is generally saved

1.

Issue 18

76 10 tips

to removable media, though Puppy Linux will (if you wish) create a permanent Windows directory tostore your files.Live distros “mount” Windows drives (a:\, c:\ etc) so you can open and save to your existing files.This feature can be used as a means of rescuing work off a Windows drive that won’t boot. Run yourLiveCD, and copy your files to a USB memory device or external drive, to a network drive, to anoptical RW drive, use FTP to move them to a website or even email them to yourself!

2.

Many LiveCDs put an “install” icon on your desktop for when you decide to take the plunge, butbeware…

3.

Having two or more OSes on your PC requires either two or more hard drives, or more commonly,your single drive to be divided into two or more partitions. Most distros provide tools to re-sizeexisting Windows partitions and re-format the freed space, but do it wrong and you’ll wipe outWindows, so back up important data first (and make sure you’ve got your Windows installation disk).

4.

There are hundreds of distros and each has its followers. Safest choices for beginners are boxed setsfrom major distros such as SuSE, Mandriva or Fedora. Reliable single CD downloads are VectorSoHo (or Vector Linux’s basic offering for older hardware), Ubuntu or Kubuntu. (See links). Ubuntuwill even send you a CD—FREE.

5.

Free software developers prefer open standards such as .xml, .jpg, .odt, .html but arepragmatic enough to provide filters for common proprietary formats such as .doc, .xls, .wav.

6.

The GNU/Linux file system is different to Windows, but on a single PC with a single hard disk it’seasy to understand. /, known as “root” is the starting point—roughly equivalent to c:\ on Windows.Directories such as /bin, /opt, /etc contain applications and configuration files. Your work issaved in /home/username which equates to c:\Documents and Settings\username.

7.

Many GNU/Linux applications equal or surpass their Windows counterparts. As most are free, thereis little point in creating “lite” or cut-down versions: GNU/Linux apps are fully featured professionalpackages. As many developers are academics there is tremendous range of educational software fromKTouch, for down-to-earth keyboard training to KStars, a desktop planetarium.

8.

WINE enables some Windows apps to run on GNU/Linux. Cedega from TransGaming is a WINEbased subscription service optimised for running popular games.

9.

GNU/Linux is built for networking, even beginners can connect to the internet, create a SoHonetwork, even communicate with Windows PCs thanks to Samba. Shared printers on a Windows PCare accessible from a GNU/Linux PC and vice versa.

10.

Figure 4: Networking Ubuntu

So why are you waiting? Have fun.

Links

Live distrosKnoppix.

Mepis.

Issue 18

Links 77

Puppy Linux.

Installable distros:Ubuntu.

Open SuSE.

Mandriva.

Fedora.

CedegaCedega.

Biography

Phil Thane (/user/36535" title="View user profile.): Originally a Design & Technology teacher in England,then Support Manager at TechSoft UK Ltd in Wales, with a hobby of freelancing for educational andtechnical magazines. These days Phil is a freelance writer pretty well full-time. For links to publications seewww.brynvilla.llangollen.co.uk (http://www.brynvilla.llangollen.co.uk).

Copyright information

Verbatim copying and distribution of this entire article is permitted in any medium without royalty providedthis notice is preserved.

Source URL:http://www.freesoftwaremagazine.com/articles/beginners_gnu_linux_part_1

Issue 18

78 Live distros

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Getting help with free software

A guide to finding the answers to problems with free softwareBy Jonathan RobertsSo, you’ve made the move to free software. As you’ve no doubt noticed, there are quite a few differencesbetween the proprietary software you’ve been used to and free software: the interfaces are different; it costs aheck of a lot less; and if you’re using one of the community supported distributions there’s no premium ratehelpline! These all seem like benefits to me, but what happens when you have a problem?

There are a huge number of sources you can turn to: in this article we’ll cover where to find the most commonones and how to make the most of them. I’ll be presenting them in a hierarchy, so, when you have a problem,start at the beginning and work through to the end. This will help you to understand the problem yourself andensure you have plenty of information about it before talking to a real person (if it comes to that), makingpeople far more receptive and willing to help.

Your distribution’s documentationLet’s start with a massively underused resource: the documentation that ships with the system. Free softwarerarely comes with a printed manual but it does come with a wealth of material included in various digitalforms. If it’s a graphical application you’re having trouble with look for a Help menu; OpenOffice.org has abrilliant example of built-in help and has documentation about a huge range of features, many of which youprobably never realised existed.

If it’s a command line program you need help with, `man` and `info` are two very valuable sources ofinformation

If it’s a command line program you need help with, man and info are two very valuable sources ofinformation. Simply typing, at a command line, man followed by the program name and then Enter willprovide you with extensive instructions on how to use a program, different options, their functions, andreferences to other manual pages that might be of use; run the command man man for more details. Someprograms don’t use man for their documentation needs, but use info instead. Run the command info formore information. Another interesting, and sometimes unexpected source of information, comes when you’retrying to tweak a configuration file: more often than not, configuration files will be heavily commented,explaining all of the options available to you.

The final source of help that you’ll find is commonly shipped with distributions is that which is accessiblefrom the menus on the desktop. In GNOME, it can be found under the System menu, and in KDE under the Kmenu.

Our focus now turns to the online world. A great place to start is your distribution’s home page (or the homepage of the application you’re working with), which will often have links to community createddocumentation, covering a much wider range of topics than is available from the desktop. There will often belinks to forums here too, but I would recommend holding off on the forums for the time being. Results turnedup from Google (covered below) will often include the forums, and it’s worth doing a bit more researchyourself to ensure you have enough information to give on a forum before asking yourself.

I’ve compiled a short list of, in my opinion, some of the best online documentation provided by thedistributions. Take a look around at all of them; although each distribution is different, many of them sharecommon features and what’s not documented in one might be in another.

Ubuntu’s Official Documentation•

Issue 18

Your distribution’s documentation 79

Ubuntu’s Community Contributed Documentation• Fedora’s Official Documentation—also be sure to check the drafts for useful, but rough, information• openSUSE Documentation• The Gentoo Wiki•

Google!I’m sure you’re not surprised to find Google so high in the list, but let me put forward a few of its bestfeatures: firstly, when you first encounter a problem it’s quite likely you will only have a vague idea of whatis causing it, and Google can quickly help you to narrow down the likely causes. Secondly, it provides a greatoverview of different sites where answers might be available, helping you to better target the next stage ofyour investigation.

The Google Linux search logo, so you know you’re in the right place

I’m being specific about using Google because of their Special Searches, and more accurately, theirGNU/Linux search feature (you can find it at http://www.google.com/linux/). The benefits of this areimmediately obvious: Google indexes a huge amount of information from the web, and quite often yoursearch for information about free software returns results about Windows, and sometimes even aboutwindows! Using this special search feature will narrow the scope of results significantly and make it easier tofind exactly what you need.

Using the special Google Linux search feature will narrow the scope of results significantly and make iteasier to find exactly what you need

This is just the beginning of learning how to use Google effectively, however, and the internet is littered withcheat sheets that all promise to take your Googling to the next level. In my opinion the most useful isGoogle’s own cheat sheet which is clean and simple to use, but lacks descriptions of all the different operatorsavailable; for a more complete list see here.

Before moving on, I’ll give you an example of how to use Google. A common problem people have isstuttering DVD playback, so I’ll see if I can solve this problem for someone using Ubuntu. An obviousstarting place would be to enter “Stuttering DVD playback” into Google, unfortunately none of the results onthe first page are particularly helpful because our search was too broad. You can improve this result in twovery simple ways: switch to Google’s Linux search or use some operators in your search. A refined searchwith operators might look like “Stuttering DVD playback -windows +ubuntu”. The first result actually hasenough information in it to solve the problem. The same is true if you use Google’s Linux search, although, inmy opinion, it’s an even better result!

Real peopleWith some problems you might exhaust all of the above sources of information. In which case, it’s time toseek some help from a real person. There are three common ways to do this: forums, mailing lists and IRC

Issue 18

80 Real people

(Internet Relay Chat), and each has its own advantages and disadvantages. I will tackle forums and mailinglists first, as they tend to be slower than IRC.

ForumsAs with online documentation, the best place to start is the official forum for your distribution, or the programyou’re working with; a quick search will reveal the address of the appropriate forum. Once there, the firstthing to do is use the forums own search function and look for any relevant threads. Occasionally this will turnup results not found in Google that either provide the answer or point to an obscure page with the solution init. If this fails, start a new thread. Often you’ll have to register with the forum to do this, but none of the majorforums or distributions will send spam to your e-mail address so don’t worry about it!

When starting a new thread be as descriptive, and brief, as possible in the subject: the more informative this is,the more likely it is people will take the time to read the rest of the thread. In the body of the message provideas much information as you can: describe the symptoms; explain the steps you’ve already taken to try andsolve the problem; and provide the information you’ve turned up from Google. If there’s an option tosubscribe to the thread, do it: you’ll likely get e-mail updates whenever somebody posts a reply, allowing youto respond quickly and add extra information where necessary, which will save you from waiting days to finda solution to your problem.

The two forums that I find most helpful are:

Fedora Forum• Ubuntu Forums•

A lot of people also find Linux Questions to be very useful.

Mailing listsMailing lists are very similar: the best places to start are those belonging to your chosen distribution or theparticular program you’re having trouble with; also, you want your subject to be as descriptive as possible andto provide as much information as possible in the message body. The difference with mailing lists is thatyou’ll receive all messages sent to the list. There are pros and cons to this approach: depending on thepopularity of the list you may get a lot of e-mails sent to your inbox (in this case you may find a “daily digest”option a useful solution, look for this when signing up); on the plus side, you get to read about a lot of otherpeople’s problems, allowing you to learn a lot, and as you become more knowledgeable you will be able tosolve your own and other people’s problems more effectively in the future.

…like all aspects of life, there are social norms, and e-mail is no different

Another consideration with mailing lists (and forums), is etiquette; like all aspects of life, there are socialnorms, and e-mail is no different. You may well find that a lot of lists prefer you to send your messages inplain text format only, so look for this setting in your client and enable it (this will ensure that your messageappears correctly in everyone’s client, increasing the number of people who can read your cry for help!).Other etiquette issues are dependent on the individual list so it is sometimes advisable to spend a little time“lurking” before contributing; of course, if you make it clear that this is your first post to the list people aremore than willing to be very forgiving of etiquette issues and help you to avoid them in the future, and nodoubt once you’ve become a seasoned contributor you’ll show the same levels of kindness.

To get you started with mailing lists here are a few great ones; be warned, however, they’re addictive andincredibly easy to sign up for!

Ubuntu UK—Ubuntu’s local community team mailing lists are superb, with a tendency to be veryfriendly and helpful to new users. Look up your nearest for a great list

Debian’s User Mailing Lists are all brilliant in my opinion• Fedora Live CD list is a great example of a focused discussion list•

Issue 18

Forums 81

Another very useful feature of mailing lists is their archives: you can search these (at the very least by usingGoogle’s Site: operator); they are organised in a myriad of different forms including Date, Author andThread and contain a huge wealth of information. You can find a few examples here:

Fedora Users’ List Archive• openSUSE’s Users’ List Archive•

One final point that’s worth mentioning under mailing lists is Google Groups. They effectively recreatenewsgroups such as USENET (and even have a huge USENET archive!), which are similar to forums. Thecool thing about Google Groups, however, is how simple it is to create new groups, they’re free to access, andyou can participate in them just as you would a mailing list. What’s different compared to mailing lists is thatyou can browse through them in a directory hierarchy, which makes discovering new groups interesting andway too easy (I warned you mailing lists are addictive).

IRCSometimes being able to hold a real time conversation with someone can help solve your problem muchquicker than forums or mailing lists would allow, and this is exactly the gap IRC (Internet Relay Chat) is hereto fill. The first thing you’re going to need with IRC is a client that will connect you to both the network andchannel that is most appropriate for your problem; some of the most common clients people use are Pidgin,XChat and Irssi. Most distributions will have all of these in their repositories, so installation should be simpleand you can play around with a few and discover which one you like most. A really useful resource, whichwill help you learn the ropes of IRC, can be found at http://irchelp.org/.

Once you’ve got your client you will need to find an appropriate channel to join and ask your question in.Like many of the other methods discussed here, the best place to start is your distribution’s home page. Mostwill have channels on the freenode network, for example Fedora’s help channel is at irc.freenode.org and#fedora, whereas Ubuntu’s is on irc.freenode.org and #ubuntu. Now that you’ve found an appropriate channel,join it and ask your question. Don’t ask “Can somebody help me?”, however, as this plea is likely to gounanswered! Just ask your actual question. Make sure, as always, to give plenty of detail about what theproblem is; when somebody replies to you do your best to give any extra information they need, and if notdon’t be afraid to ask for simpler instructions, they’ve already offered to help!

As a little demo I headed into the Fedora channel on IRC and asked about stuttering DVD playback. Here’swhat happened:

09:58 < JonRob> i've been having trouble with stuttery dvd playback09:59 < JonRob> Googled around loads and it looks like it's something to do iwth DMA09:59 < JonRob> but i've got no idea what to do with it now...09:59 < autopsy> DMA is not always the cause, but if you are using EIDE disks use hdparm to check if DMA is enabled, sdparm if you're using SCSI disks.10:00 < JonRob> ok cool, umm...how do i use hdparm?10:00 < autopsy> See: man hdparm10:00 < MilkmanDan> JonRob: You RTFM, because if you don't you risk damaging your hard drive and/or destroying your filesystem.10:01 < MilkmanDan> And I'm not kidding about that.10:01 -!- thufir007 [[email protected]] has joined #fedora10:01 < JonRob> MilkmanDan: Thanks for the warning :D10:01 -!- Kwitschibo [[email protected]] has joined #fedora10:01 < JonRob> I'll go check that out!

It was unfortunate somebody told me to “RTFM” in the example, but they meant it in the best possible way:to ensure I understand what I’m doing before destroying my hard drives!

You’re now almost set for IRC. To help you get started, here’s some links to channel lists for the majordistributions. You can’t go wrong with these, as they’re nearly always busy with somebody around to help!

A huge list of Ubuntu Channels and some IRC tips• Fedora’s Communication info• openSUSE’s channel list•

Issue 18

82 Mailing lists

LUGsI will end by mentioning Linux User Groups (LUGs). Sometimes being able to meet up and talk out aproblem with like minded people is the best solution of all, and LUGs will provide you with a contact point tofind people in your local community who can help. There are often regular meetings, where people gettogether and discuss everything and anything, give presentations and fix problems; another common feature ofthe LUG is an active mailing list, which has many of the same features as a meet up, it just takes a bit longerwhen done over a list! As always, a quick internet search will help you find your nearest LUG’s website andprovide much of the information you need to get started.

The best LUG directory is:

Linux user groups•

ConclusionNow you’re fully equipped to go out into the world of free software and solve any problems you mightencounter, without a premium rate phone line in sight!

Biography

Jonathan Roberts (/user/31677" title="View user profile.): Currently a gap year student! I have a huge interestin Free Software which seems to keep growing. I run the Questions Please... podcast which can be found atquestionsplease.org. On an unrelated note I'm reading theology at Exeter next year.

Copyright information

This article is made available under the "Attribution" Creative Commons License 3.0 available fromhttp://creativecommons.org/licenses/by/3.0/.

Source URL:http://www.freesoftwaremagazine.com/articles/getting_help_with_free_software

Issue 18

Conclusion 83

Issue 18

84 Conclusion

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

A beginner’s introduction to the GNU/Linux commandline, Part II—Managing processes

A tutorial for novices that discusses processes and processrelated commands including ps, top, grep, fuser, more, jobs andkill.By Rosalyn HunterYour GNU/Linux computer is an amazing machine. It can display images. It can run programs. It can performdozens of functions all at the same time. How can you keep track of all this activity? By monitoring theprocesses that your computer runs, and one of the best ways to monitor and control processes is by using thecommand line.

Long ago computers were like calculators—they did one thing at a time—but today’s computers canmulti-task doing hundreds of things at the same time. The different tasks share processor time. This is whyyou can search the web while writing a paper and listening to music all on the same computer at the sametime.

What do you do when you can’t make your process stop no matter how many times you click that little`x` in the corner?

Each of these different things happening on the computer is called a “process”, and your computer takes turnsletting all of the processes run a little bit at a time. The computer works so fast that you usually don’t evennotice.

But occasionally, a process stops responding to you. What do you do when you can’t make your process stopno matter how many times you click that little x in the corner? You try using the keyboard commands Escand Ctrl + C. You even try Ctrl + Q, Ctrl + X, and Ctrl + Z; but they don’t work. What do youdo next?

If you can get into a terminal, you can kill any process

Well, if you can get into a terminal, you can kill any process. The command is called kill. The commandname is easy enough to remember, but your problem is knowing what to kill. Each process has a differentprocess identification number (PID) and you must use that number to kill it.

To see a list the processes currently running on your system, you can use the command ps. If I open aterminal program and type ps now, I will see this:

rosalyn@onizuka:~$ ps PID TTY TIME CMD14036 pts/2 00:00:00 bash14040 pts/2 00:00:00 ps

(The prompt on my system says rosalyn@onizuka:~$. Needless to say, your computer will saysomething different. When I show an example like this, only type the words after the dollar sign. Thecomputer’s response will be shown on the following lines.)

The computer responds telling me what processes I am currently running in this terminal window. First, I amrunning the terminal window itself using the BASH shell. Then I am running the command ps. That’s notvery informative. Is it?

Issue 18

A beginner’s introduction to the GNU/Linux command line, Part II—Managing processes 85

I would really like the computer to show me all of the processes running on my system. To find that, I mustuse options (letters typed after the command that modify its function). In order to see all of the processesrunning on my system, I use the ps aux command:

rosalyn@onizuka:~$ ps aux

ps reports a snapshot of the current processes running on your system.• a tells the computer to show all processes• u tells the user name of who owns the process, and• x lists processes that were not started in a terminal.•

This command will return a long list of processes that scrolls off my terminal screen. Somewhere in that list isthe process ID that I am looking for. If I am using a terminal with a scroll bar, I can just scroll back up andread it all to find the process. Personally, however, I prefer to use a different command to get the process ID.The command called top.

Tasks and processes

What’s the difference between a task and a process? Nobody knows. For the most part people use the wordtask when they are talking about sending things to the processor to avoid saying things like, “the processorprocesses the process”.

Well, actually, there is a difference between tasks and processes. The process that starts your computer iscalled init. It is listed by the process ID 1. This process is also called Task [0]. For the most part, however, justconsider tasks and processes to be the same thing.

Top lists the processes using the most time on the computer’s processor. It prints only what will fit in yourterminal window, and it refreshes every few seconds to give you an up to date picture of your system. If yourprogram has stalled, then it is probably taking up lots of processor time, and it will be right near the top of thelist. Typing top on my system shows me this:

top - 00:15:36 up 10:53, 1 user, load average: 0.79, 0.69, 0.58Tasks: 86 total, 3 running, 83 sleeping, 0 stopped, 0 zombieCpu(s): 29.9% us, 6.6% sy, 0.0% ni, 62.8% id, 0.0% wa, 0.3% hi, 0.3% siMem: 484292k total, 361820k used, 122472k free, 25596k buffersSwap: 1421712k total, 0k used, 1421712k free, 169384k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13247 rosalyn 16 0 155m 67m 46m R 26.3 14.2 11:58.69 seamonkey-bin 3363 root 15 0 93448 50m 44m S 9.0 10.6 6:05.50 XFree86 14032 rosalyn 15 0 27320 14m 25m S 1.0 3.0 0:02.04 konsole 13227 rosalyn 15 0 14168 9928 11m S 0.7 2.1 0:09.65 gvim 3094 gkrellmd 15 0 18824 1340 2240 S 0.3 0.3 2:24.32 gkrellmd 13207 rosalyn 15 0 26532 14m 23m S 0.3 3.1 0:01.69 kdeinit 14196 rosalyn 16 0 2104 1084 1888 R 0.3 0.2 0:00.11 top 1 root 16 0 1516 520 1364 S 0.0 0.1 0:00.58 init

If you lengthen the terminal window, it will show more data. Now, suppose the program “seamonkey” wasfrozen. I could kill it by typing the command kill followed by seamonkey’s process ID 13247.

Of course, to do this I need to get a prompt again. Top will keep refreshing in the terminal window until youtell it to stop. Both the letter q for quit and typing the control button and c at the same time (Ctrl + C) willstop the program and give you back your prompt.

To kill seamonkey, I can type:

rosalyn@onizuka:~$ kill 13247

This should stop the process causing the seamonkey window to close, but sometimes it doesn’t. What do I doif seamonkey still won’t close?

Issue 18

86A tutorial for novices that discusses processes and processrelated commands including ps, top, grep, fuser, more, jobs andkill.

Well, kill also has options. The basic command tries to be nice. It says, “Could you please stop now?” Butif the process just won’t die when you ask it nicely, then use the option -9. The command kill -9 says“take no prisoners!”

So if kill alone doesn’t work, I can type:

rosalyn@onizuka:~$ kill -9 13247

That almost always will terminate the process.

Oh, by the way, you can only kill your own processes as a user. This protects you from accidentally shuttingoff someone else’s programs. If you are logged in as a superuser, however, you can stop another person’sprograms.

Make sure to kill the right process though. In the listing above, you may notice that right below seamonkeyis a listing for a process called XFree86. XFree86 is my window manager. Killing that would close all of mywindows including the terminal that I am writing in now, so be cautious with kill.

The user Root is no normal user!

Users and superusersGNU/Linux is designed to keep you from doing things that would damage your system. Each person is giventheir own account. All of a user’s files are labeled as their own and other people usually can’t change them. Itis the same way for processes. Processes are labeled as belonging to someone, and you can only start and stopprocesses that belong to you.

But some processes belong to no one, and sometimes processes belonging to someone else get out of control.To affect those processes you have to become a superuser. A superuser, like a superhero, has amazing powersthat mere mortals do not. They can start or stop any process; restrict access to files, or free them; add andremove users; and any of a number of incredible things. A superuser can also completely trash your system, soremember “with great power comes great responsibility”.

A superuser, like a superhero, has amazing powers that mere mortals do not

Since being a superuser is so dangerous, most people only become one when they must. This is one of themajor reasons that people use the command line. They login to a terminal as a superuser, and they logoutwhen they have finished the task that they came to do.

On a GNU/Linux system, the superuser is called “root”. When you run top you will often find processes thatare owned by root, and only root can kill those processes. To become root you must switch user using thecommand su. When you type su root it will prompt you for a password.

rosalyn@onizuka:~$ su rootPassword:

Issue 18

Users and superusers 87

You had to set a root password when you installed the Linux kernel, so the person who installed your systemshould have the root password. When you have the root password, you have ABSOLUTE CONTROL overthe system (diabolical laughter), so it should not be given out casually.

If the person guarding the password refuses to give you this power, and you are tired of asking them to dosomething for you such as install new packages in a Debian system using apt-get install, they cangive you partial power by using the command sudo. It means “switch user and do”.

Slay

There is a program called slay that will kill all of the processes used by another person. You can install it onyour computer and access it from the command line. I use it when my son leaves several process-hogginggames running in the background.

As a superuser, just type slay and a user name. The user’s processes will be terminated. Needless to say,doing this while someone is working on the computer is a way to lose a few friends. So, like all of thesecommands, caution is required as well as tact.

If you’d like to see what it feels like to get slayed, save any unsaved documents and then type slay andyour user name. The effect is quite catastrophic and upsetting. Don’t say I didn’t warn you.

Using grepDo you remember how I said that ps will give you a list of processes? And, lazy person that I am, I didn’twant to take the time to read them all. If you want to find a particular process in a long list, you can search thelist using the command grep.

Grep is one of those tools that “oldetyme” programmers couldn’t survive without

When I type whatis grep on the command line it returns the following:

rosalyn@onizuka:~$ whatis grepgrep (1) - print lines matching a pattern

Of course there are other ways for me to find a specific process. There are options to ps (type ps --helpfor the options.) The command ps -C, for example, lets you search by command name. There is even adifferent command called pstree that makes a layered diagram of all of the currently running processes. Butlet us imagine for now that we are option-challenged.

grep is one of those tools that “oldetyme” programmers couldn’t survive without. It searches a file for astring and prints it on the screen. You can write the data from the ps command into a file, and then search itwith grep. Do this by using the greater-than arrow “>” to send the data to a file. Type the following:

rosalyn@onizuka:~$ ps aux > pslog.txt

This writes the output of the command ps aux to a file called pslog.txt.

Reading files on the command line

You can read a file on the command line by using the command cat. Typing cat pslog.txt will writethe contents of the file to the screen, but it scrolls the entire file across the screen without stopping. If youwant to read a file one page at a time, you can use the command more which will write only what fits on yourscreen. Press the space bar to scroll to the next page. Older versions of more only scroll text in one direction,down. Because of this, another program was written that can use the arrow keys to scroll up and down withina file. That program is called less. (Programmers have a weird sense of humor.)

Now that you have the file, you can search in it. Let’s say you’re looking for a program called abiword. Youshould type:

Issue 18

88 Using grep

rosalyn@onizuka:~$ grep 'abiword' pslog.txt

Doing that returns the string:

rosalyn 13386 0.1 2.6 23264 12632 pts/3 S 08:16 0:00 /usr/bin/abiword

Now you’ve found Abiword’s process ID. In my example it is 13386.

But in my mind’s eye I can hear some veteran command line user out there scoffing. “Ha!” he says, “I coulddo all of that in one line.” It is true that there are usually many ways to do the same thing when you are usingthe command line. I could simply type:

rosalyn@onizuka:~$ ps aux | grep "abiword"

The vertical line between the two commands is called a pipe. It is found above the backslash on the keyboard,and it is used to send the output of a process to another process just as the greater than arrow > is used to sendthe output of a process to a file. This command pipes the output of ps directly to grep and then prints it onthe screen.

rosalyn@onizuka:~$ ps aux | grep "abiword"rosalyn 13386 4.2 2.6 23264 12632 pts/3 S 08:16 0:00 /usr/bin/abiwordrosalyn 13396 0.0 0.1 1848 608 pts/2 R+ 08:17 0:00 grep abiwordrosalyn@onizuka:~$

The first line shows the command you searched for and its PID 13386. The second line shows the ID for thecommand grep that you just ran to get this data. Pipes and arrows are really useful shorthands, and you canmake quite complex commands that all fit on one line, if that makes you happy.

grep is a very useful tool. To see the options, try typing grep --help on the command line. Some of themore useful options are grep -r which will search recursively, meaning that it will search not only the filesin a directory, but the files in all of the directories below it. grep -C which stands for context prints anumber of lines that you specify above and below a line searched. So, for example, when I type:

rosalyn@onizuka:~$ grep -C3 'not to be' Hamlet.txt

the computer returns:

Enter Hamlet.

Ham. To be, or not to be, that is the Question:Whether 'tis Nobler in the minde to sufferThe Slings and Arrowes of outragious Fortune,Or to take Armes against a Sea of troubles,

In the example above, two of the three lines above the searched for line are blank. Cool isn’t it?

Virtual terminals and jobsIn many versions of GNU/Linux, they have things called “virtual terminals”. A virtual terminal allows you tosimulate the experience of being on an old fashioned monochrome terminal. The kind they had before all thisnew-fangled window stuff was around. This is a necessary safety blanket for old programmers who miss thesimplicity of it all. The great thing about having these virtual terminals is that if your graphical user interfacehangs, you can switch to a virtual terminal and kill the hung window system. It is just another process afterall.

How do you run a program from a terminal?

To get to a virtual terminal, you need to type at the same time the control key, the Alt key, and the F1 key.On my system I have six virtual terminals that I get to by typing Ctrl + Alt + F1 to Ctrl + Alt +F6. Pressing Ctrl + Alt + F7 returns me to the window system. This won’t always work though. Myother computer has no virtual terminals at all, so you will just have to try it and see.

Issue 18

Virtual terminals and jobs 89

What if you want to start a process and it isn’t in your menu? How do you run a program from a terminal?

If you’ve just downloaded a program, and you are in the same directory as it, you can type./filenameoftheprogram and it will run. If you don’t know where the program is that you want to run,you can find its location by typing whereis. So if Abiword wasn’t on my menu, but I knew that it was onmy system and I wanted to run it, I could type:

rosalyn@onizuka:~$ whereis abiwordabiword: /usr/bin/abiword /usr/share/man/man1/abiword.1.gz

The computer gives me two locations for Abiword. The first listing is the actual program. The second listingis for the program’s manual pages.Simply typing /usr/bin/abiword at the command line will start theprogram, but here is a case where a terminal is like a calculator. The prompt will vanish from the terminal,and won’t return until you have closed the program.

To run a process from a terminal and still get the prompt back, you have to run it in the background. to do thatput an ampersand at the end of the command.

rosalyn@onizuka:~$ /usr/bin/abiword&[1] 12620rosalyn@onizuka:~$

It gives me a job number and then returns the prompt so I can do something else. The second number on theline tells me the process ID, so I could kill the program if I so desired by typing:

rosalyn@onizuka:~$ kill 12620[1]+ Terminated /usr/bin/abiwordrosalyn@onizuka:~$

If I close the terminal that I started it in, Abiword will close, and I will really wish that I had saved mydata

When you run a program from a terminal it is called a job and that terminal will number the jobs it is runningsequentially. If I restart Abiword, and then type the command jobs, it returns the following:

rosalyn@onizuka:~$ jobs[1]+ Running /usr/bin/abiword &rosalyn@onizuka:~$

So I don’t have to remember the long process ID. If I want to end this job, I just call it into the foregroundwith the command fg and the job number.

rosalyn@onizuka:~$ fg 1/usr/bin/abiword

Then I can close it using the keyboard command Ctrl + C. The command fg brings a background programto the foreground, and the command bg runs a stopped job in the background. fg and bg are the terminalequivalent of tabbed browsing. This kind of thing was really hot stuff before multiple windows, but they arerarely used today. Heck, even multiple virtual terminals means that you can run processes in differentterminals at the same time, so why bother?

If you have lots of small jobs that you want to oversee. For example, if you were running ten or twelvemathematical calculation programs, you could start each of them and then leave them in an open terminalwhile you go off to do something else. You could check their status by typing jobs from time to time, oreven run top in the window for constant updates on their status.

One thing that you must remember about jobs is that they are tied to the terminal. Closing the terminal closesall of the jobs that you start in it. Therefore if I am typing a document in Abiword and I close the terminal thatI started it in, Abiword will close, and I will really wish that I had saved my data.

Issue 18

90 Virtual terminals and jobs

Fuser and devicesNow, sometimes a process is halted because it is waiting for a device to finish. Devices are hardware attachedto a computer such as a CDROM or a printer. Even the hard drive is a device. You can use the commandfuser to see what process is using a device.

If I am playing music using the Kaffeine media player, then the device cdrom should be busy. If I typefuser /dev/cdrom it will give me the process ID being used by CDROM.

rosalyn@onizuka:~$ fuser /dev/cdrom/dev/cdrom: 15562rosalyn@onizuka:~$

I can ask ps what program owns this PID by typing ps and the PID:

rosalyn@onizuka:~$ ps 15562 PID TTY STAT TIME COMMAND15562 ? S 0:02 kaffeinerosalyn@onizuka:~$

Then I can kill this program using this program ID.

rosalyn@onizuka:~$ kill 15562

And yes, by looking at the list of options, I could learn how to find who has control of the device and kill it allon one line.

rosalyn@onizuka:~$ fuser -k /dev/cdrom/dev/cdrom: 15741

What is all this business about /dev/cdrom? In Unix-like operating systems, a device is referred to as if itwere in a directory. Your cdrom may not be called /dev/cdrom like mine is. It may be /dev/cdrom0 or/dev/dvd. Since every system has different hardware, each /dev has a unique collection of files. Butdevices are a complete topic on their own.

Take control of your processes with the command line, and never be afraid of your software again

Processes are how your computer runs. Understanding processes helps you understand your computer, soopen a terminal and type top. Leave it running and see what your system is doing from moment to moment.If you are curious about what a command does, type whatis and the command name. Remember, you runthe computer it doesn’t run you. Take control of your processes with the command line, and never be afraid ofyour software again.

Biography

Rosalyn Hunter (/user/36" title="View user profile.): Rosalyn Hunter has been on the internet since before theweb was created. Born into a family of instructors, she has made it her life's goal to teach others about theimportant things in life, such as how to type kill -9 when a process is dead. She lives in a little house on theprairie in the American West with her husband, her three beautiful children, a cat and a dog.

Copyright information

Verbatim copying and distribution of this entire article is permitted in any medium without royalty providedthis notice is preserved.

Source URL:http://www.freesoftwaremagazine.com/articles/beginner_intro_cli_part_2

Issue 18

Fuser and devices 91

Issue 18

92 Fuser and devices

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

Generating cool fractals

A benchmark comparison of PDL, IDL, MATLAB, Octave, C andFORTRAN77 generating fractalsBy Xavier CalbetWhether you are a professional or amateur scientist, engineer or mathematician, if you need to makenumerical calculations and plots quickly and easily, then PDL (Perl Data Language) is certainly one of thebest free software tools to use. PDL has everything that similar high-level, proprietary, numerical calculationlanguages (like IDL or MATLAB) have. And it certainly comes with all the features you would expect tohave in a numerical calculation package.

IntroductionIn this article, I will explore a fun application of the numerical calculation field: the Mandelbrot fractal. Togenerate fractals you need to perform several computations and then plot the results. The examples that followare also simple enough for anyone to follow, but have enough features to get a feel for the language used. Forthis particular task, high-level, numerical calculation languages are the ideal tool. They provide a rapiddevelopment cycle due to its high-level nature. It is also easy to generate quality plots with these tools. And,as you shall see later, the speed performance penalty you pay by using these languages is relatively minor.

The Mandelbrot fractal example reviewed in this article will be developed in both proprietary and freesoftware languages: PDL, IDL, MATLAB and Octave. This will allow us to compare them qualitatively in atable highlighting the pros and cons of each language. Also, a quantitative benchmark comparison will bedone to illustrate the speed of each one of the languages. For comparison purposes, C and FORTRAN codefor these examples will also be shown.

The Mandelbrot fractalThe Mandelbrot set is one of the most popular fractals

According to Wikipedia, a fractal is a rough or fragmented geometric shape that can be subdivided into parts,each of which is (at least approximately) a reduced size copy of the whole. The Mandelbrot set is one of themost popular fractals. In this article I will color the fractals in a slightly different and artistic way (as seen infigure 1). The Mandelbrot fractal is generated by iterating a mathematical relationship between complexnumbers (see Complex Number Arithmetic for a quick introduction to complex numbers). Starting with a zerovalue of a complex variable (z), the fractal is materialised by iterating the following assigment:

z = z * z + k,

…where k is a complex number which is kept constant throughout the iterations. The final value of z dependsvery much on the value of the complex number k. For some values of k, the final z converges to a certainfinite value and for some others, z diverges to infinity. To avoid numerical problems with the divergences inthe calculations we will introduce a programming trick that consists of constraining the z values between -5and 5 after each iteration. In the final fractal image, the x axis will represent the real values of k and the y axisits imaginary values. In the Mandelbrot fractal, normally the divergent z values are given one color and theconvergent ones another. The frontier between one color and the other is a fractal. Here I will color the imagesusing a rainbow palette to plot the values of the formula:

image = log (sqrt(Re(z) * Re(z) + Im(z) * Im(z)) + 1)

Issue 18

The Mandelbrot fractal 93

…where Re and Im denote the real and imaginary part of z respectively. The final Madelbrot fractal imagecan be seen in figure 1.

Figure 1: the Mandelbrot fractal

PDLPDL is an extension of the Perl language for number crunching and scientific plotting

PDL is an extension of the Perl language for number crunching and scientific plotting. Because of its Perlheritage it has the clean syntax of a well settled programming language. You can also use one of the wealth ofavailable module-packages in the Perl archive (CPAN), to use the language for other purposes like databaseaccess, date handling, inter-process communication, GUI toolkit, just to name a few.

Installing PDLUnfortunately, PDL is not installed by default on many of the popular GNU/Linux distributions. Even worse,some distributions have the PDL related packages missing or partly broken. If you are running a GNU/Linuxdistribution based on Debian (Ubuntu, Knoppix, etc.), and have access to the regular Debian repositories, it isfairly easy to install PDL. You should install the pdl, pgplot5 and pgperl packages in order to followthe examples in this article. This can be done (as root) via the usual:

apt-get install pdl pgplot5 pgperl

If this is not your case, follow the instructions in [Installing PDL the quick and easyway](http://wiki.jach.hawaii.edu/pdl_wiki-bin/wiki/Getting_Started_with_PDL/Installing_PDL_the quick andeasy way).

The PDL command lineOnce you have PDL installed you should be able to run it in the command line. For this just type perldl ona terminal.

It should greet you with a message like:

xcalbet@debian:~$ perldlperlDL shell v1.33PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file 'COPYING' in the PDL distribution. Thisis free software and you are welcome to redistributeit under certain conditions, see the same file fordetails.ReadLines, NiceSlice, MultiLines enabledReading PDL/default.perldlrc...Found docs database /usr/local/lib/perl/5.8.4/PDL/pdldoc.db

Issue 18

94 PDL

Type 'help' for online helpType 'demo' for online demosLoaded PDL v2.4.2perldl>

You can try out now some of PDL features by typing demo after the PDL prompt:

perldl> demo

This will provide you with a list of demos you can try. You should also check that the plotting library you willbe using inside PDL is working properly. To do this type:

perldl> demo pgplot

Some nice graphs should appear on your screen. If this is not the case have a look in [Installing PDL the quickand easy way](http://wiki.jach.hawaii.edu/pdl_wiki-bin/wiki/Getting_Started_with_PDL/Installing_PDL_thequick and easy way).

In the next section, I will explain how to generate the Mandelbrot fractal step-by-step using the PDLcommand line, so you can learn the basics of PDL.

The Mandelbrot fractal with PDLPerl scalars are usually denoted by a variable name preceded by a dollar sign. These variables can containonly one object which can be a string, a more complex object, or, as is in this particular case, a numericalvalue,

perldl> $npts=200;perldl> $niter=10;

Here the number of points along the side of the square fractal image and the number of iterations for theMandelbrot calculation are stored in their respective variables. We can have a look at the contents of thesevariables with the print function:

perldl> print $npts;200

The basic building blocks of the PDL language are n-dimensional arrays usually referred to as “piddles”. Apiddle is stored in a scalar Perl variable, like the real and imaginary part of z, $zRe and $zIm:

perldl> $zRe=zeroes(double,$npts,$npts);perldl> $zIm=zeroes(double,$npts,$npts);

In this case, two-dimensional, double-precision, square arrays of zeroes are generated with the zeroesfunction. Its size is given by the $npts variable.

You can now generate the matrices that will represent the k constant by using the xlinvals andylinvals functions. These functions assign different values for each column or row respectively within acertain range.

perldl> $kRe=$zRe->xlinvals(-1.5,0.5);perldl> $kIm=$zIm->ylinvals(-1,1);

We can subset the $kRe and $kIm matrices with the slice method to have a better feeling of what thexlinvals and ylinvals functions do:

perldl> print $kRe->slice('0:4,0:4');[ [ -1.5 -1.497998 -1.495996 -1.493994 -1.491992] [ -1.5 -1.497998 -1.495996 -1.493994 -1.491992]

Issue 18

The PDL command line 95

[ -1.5 -1.497998 -1.495996 -1.493994 -1.491992] [ -1.5 -1.497998 -1.495996 -1.493994 -1.491992] [ -1.5 -1.497998 -1.495996 -1.493994 -1.491992]]

perldl> print $kIm->slice('0:4,0:4');

[ [ -1 -1 -1 -1 -1] [ -0.997998 -0.997998 -0.997998 -0.997998 -0.997998] [ -0.995996 -0.995996 -0.995996 -0.995996 -0.995996] [-0.99399399 -0.99399399 -0.99399399 -0.99399399 -0.99399399] [-0.99199199 -0.99199199 -0.99199199 -0.99199199 -0.99199199]]

You can now start a loop to make $niter iterations on the numerical calculations. The syntax of loops inPerl is very similar to the C language one:

perldl> for($j=0;$j<$niter;$j++){

The PDL prompt will change to:

..{ >

The meaning of which is that it is expecting you to introduce at some point the end of the loop.

Mathematical operations between piddles are usually performed on an element per element basis. Thishappens when both piddles have exactly the same dimensions. So, if you multiply or add several piddles ofthe same size, these operations will be performed element per element and the end result will be assigned to amatrix the same size as the original ones. You can use this property to make the iterations required for theMandelbrot set (z = z * z + k), which, when split into real and imaginary parts, looks like(see ComplexNumber Arithmetic):

..{ > $qRe=$zRe*$zRe-$zIm*$zIm+$kRe;

..{ > $qIm=2*$zRe*$zIm+$kIm;

You should next apply the trick of constraining the values between -5 and 5 after each iteration, this is done inPDL using the clip function:

..{ > $zRe=$qRe->clip(-5,5);

..{ > $zIm=$qIm->clip(-5,5);

And now introduce the end of the loop:

..{ > }

The calculations will take a few seconds on a relatively modern PC. When the computations are finished thePDL prompt will appear again.

Perl is a modular language with the possibility of loading other modules if needed. To plot the fractal you’llneed to load two modules with the use statement:

perldl> use PDL::Graphics::PGPLOT::Window;perldl> use PDL::Graphics::LUT;

You can now open a window for plotting:

perldl> $w=PDL::Graphics::PGPLOT::Window->new(Device=>'/xserve');

If everything works perfectly, an empty window should show up on your screen. You can now select a colorpalette and calculate the final image:

perldl> $w->ctab( lut_data('rainbow2') );perldl> $image=log( sqrt($zRe**2+$zIm**2) + 1);

Issue 18

96 The Mandelbrot fractal with PDL

Now you are finally ready to plot the Mandelbrot fractal:

perldl> $w->imag($image);

An image similar to the one in figure 1 should show up. As you have seen, making numerical calculations inPDL is easy and straightforward. Making plots of your data is also a breeze.

All these PDL statements, which you have just seen, can be compiled in a Perl program called mandel.pl,which appears in the listing below.

#!/usr/bin/env perl

# PDL code to generate a Mandelbrot fractal

use PDL; use PDL::Graphics::PGPLOT::Window;use PDL::Graphics::LUT;

# Number of points in side of image and# number of iterations in the Mandelbrot# fractal calculation$npts=1000;$niter=51;# Generating z = 0 (real and# imaginary part)$zRe=zeroes(double,$npts,$npts);$zIm=zeroes(double,$npts,$npts);# Generating the constant k (real and# imaginary part)$kRe=$zRe->xlinvals(-1.5,0.5);$kIm=$zIm->ylinvals(-1,1);

# Iterating print "Calculating Mandel\n";for($j=0;$j<$niter;$j++){ # Calculating q = z*z + k in complex space # q is a temporary variable to store the result $qRe=$zRe*$zRe-$zIm*$zIm+$kRe; $qIm=2*$zRe*$zIm+$kIm; # Assigning the q values to z constraining between # -5 and 5 to avoid numerical divergences $zRe=$qRe->clip(-5,5); $zIm=$qIm->clip(-5,5);}

# Lines below this one are commented out when making# the benchmark.

# Generating plotprint "Generating plot\n";# Opening a window for plotting$w=PDL::Graphics::PGPLOT::Window->new(Device=>'/xserve');# Changing the color palette$w->ctab( lut_data('rainbow2') );# Generating the image to plot$image=log( sqrt($zRe**2+$zIm**2) + 1);# Plotting the image$w->imag($image);

Zooming into the Mandelbrot fractalIt is now very easy to zoom into the Mandelbrot fractal by “zooming” into the initial k values. You canachieve this by changing the initial k assignment to:

# Generating the constant k$kRe=$zRe->xlinvals(0.34,0.44);$kIm=$zIm->ylinvals(0.29,0.39);

Issue 18

Zooming into the Mandelbrot fractal 97

The result is shown in figure 2.

Figure 2: Zooming into the Mandelbrot fractal

More on PDLThere is more to PDL than what you have just seen here. One of the features that makes it powerful and sets itapart from other languages, is the behaviour of the mathematical operators when the matrices involved do nothave the same dimensions. These properties are fairly well described in the PDL indexing manual page andwill not be discussed in detail here.

Another important feature is the many functions it has for manipulating array sizes and contents. We haveseen some of them like zeroes and xlinvals, but there are many others that make array programming lifemuch easier than with other equivalent languages.

There are some excellent introductions to PDL. Some of them are listed in the bibliography.

But it’s time now to look at the competition.

IDLIDL is a proprietary and certainly not free number-crunching-oriented language very similar to PDL

IDL is a proprietary and certainly not free number-crunching-oriented language very similar to PDL. Themathematical operators are mainly used on an element per element basis like PDL. Although, naturally, othertypes of operations exist, like matrix multiplication. The IDL version of the Mandelbrot program is shown inthe listing below. The comments in the code listing give an explanation of its contents.

pro mandel

; IDL code to generate a Mandelbrot fractal

; Number of points in side of image and; number of iterations in the Mandelbrot; fractal calculationnpts=1000niter=51; Generating z = 0 (real and; imaginary part)zRe=dblarr(npts,npts)zIm=dblarr(npts,npts); Generating the constant k (real and; imaginary part)a=dindgen(npts,npts)kRe=a mod nptskIm=float(floor(a/npts))kRe=kRe*2.0/(npts-1.)-1.5

Issue 18

98 IDL

kIm=kIm*2.0/(npts-1.)-1

; Iterating print,"Calculating Mandel"for j=1,niter do begin ; Calculating q = z*z + k in complex space ; q is a temporary variable to store the result qRe=zRe*zRe-zIm*zIm+kRe qIm=2*zRe*zIm+kIm ; Assigning the q values to z constraining between ; -5 and 5 to avoid numerical divergences zRe = qRe < 5 zRe = zRe > (-5.) zIm = qIm < 5 zIm = zIm > (-5.)end

; Lines below this one are commented out when making; the benchmark.

; Generating plotprint,"Generating plot"; Opening a window for plottingdevice,decomposed=0,retain=2Window,0,Xsize=400,Ysize=400; Generating the image to plotimage=alog( sqrt(Re^2+Im^2) + 1); Plotting the imagetvscl,image

end

MATLABMATLAB is a proprietary language mainly targeted at mathematical calculations

MATLAB is a proprietary language mainly targeted at mathematical calculations. It is well suited for twodimensional matrices but can also work efficiently with higher dimensional matrices. It is also, as will beshown in the benchmarks, a relatively slow executing language. One of its advantages being that it has a hugenumber of easy to use mathematical functions available, from ordinary differential equation solving, tominimisation problems, etc. In the following listing you can see the Mandelbrot program in MATLAB withcomments explaining the code.

% MATLAB and Octave code to generate a Mandelbrot fractal

% Number of points in side of image and% number of iterations in the Mandelbrot% fractal calculationnpts=1000;niter=51;% Generating z = 0 (real and% imaginary part)zRe=zeros(npts,npts);zIm=zeros(npts,npts);% Generating the constant k (real and% imaginary part)kRe=repmat(linspace(-1.5,0.5,npts),npts,1);kIm=repmat(linspace(-1,1,npts)',1,npts);

% Iterating for j=1:niter % Calculating q = z*z + k in complex space % q is a temporary variable to store the result qRe=zRe.*zRe-zIm.*zIm+kRe; qIm=2.*zRe.*zIm+kIm; % Assigning the q values to z constraining between % -5 and 5 to avoid numerical divergences

Issue 18

MATLAB 99

zRe=qRe; qgtfive= find(qRe > 5.); zRe(qgtfive)=5.; qltmfive=find(qRe<-5.); zRe(qltmfive)=-5.; zIm=qIm; hgtfive=find(qIm>5.); zIm(hgtfive)=5.; hltmfive=find(qIm<-5.); zIm(hltmfive)=-5.;end

% Lines below this one are commented out when making% the benchmark.

% Generating plot% Generating the image to plotima=log( sqrt(zRe.*zRe+zIm.*zIm) + 1);% Plotting the imageimagesc(ima);

exit

OctaveOctave is a free software clone of MATLAB

Octave is a free software clone of MATLAB. In fact, its main advantage is that it’s an almost perfect clone ofMATLAB. Some code written for MATLAB will most probably run with very few hitches, if any, in Octave.In fact, the Octave Mandelbrot example is exactly the same as the MATLAB one, shown in the previousMATLAB listing. Being such a perfect MATLAB clone it shares all of MATLAB’s advantages and all itsdisadvantages like its speed. The only exception being its price.

C and FORTRAN77C and FORTRAN77 are low-level languages, which do not compare well in developing time with the othernumerical calculation and plotting languages, but are certainly very fast in execution time. They have beenincluded here for the benchmark comparison just to give an idea of how much slower the high-level languagesare by comparison to these low-level, more traditional languages. The following listing shows the Mandelbrotprogram in C.

#include <stdio.h>#include <math.h>// Number of points in side of image#define NPTS 1000

int main(void) {

double zRe[NPTS][NPTS]; double zIm[NPTS][NPTS]; double kRe[NPTS][NPTS]; double kIm[NPTS][NPTS]; double qRe[NPTS][NPTS]; double qIm[NPTS][NPTS]; long int i,j,k,niter;

// Number of iterations in the Mandelbrot // fractal calculation niter=51;

for (i=0;i<NPTS;i++) { for (j=0;j<NPTS;j++) { // Generating z = 0 (real and

// imaginary part)

Issue 18

100 C and FORTRAN77

zRe[i][j]=0.; zIm[i][j]=0.; // Generating the constant k (real and // imaginary part) kRe[i][j]=(double)i*2.0/((double)NPTS-1.)-1.5; kIm[i][j]=(double)j*2.0/((double)NPTS-1.)-1.; } }

// Iterating //printf("Calculating Mandel\n"); for(k=0;k<niter;k++){ for (i=0;i<NPTS;i++) { for (j=0;j<NPTS;j++) { // Calculating q = z*z + k in complex space // q is a temporary variable to store the result qRe[i][j]=zRe[i][j]*zRe[i][j]-zIm[i][j]*zIm[i][j]+kRe[i][j]; qIm[i][j]=2.*zRe[i][j]*zIm[i][j]+kIm[i][j]; // Assigning the q values to z constraining between // -5 and 5 to avoid numerical divergences zRe[i][j]=qRe[i][j]; zIm[i][j]=qIm[i][j]; if (zRe[i][j] < -5.) zRe[i][j]=-5.; if (zRe[i][j] > 5.) zRe[i][j]=5.; if (zIm[i][j] < -5.) zIm[i][j]=-5.; if (zIm[i][j] > 5.) zIm[i][j]=5.;

} } }

// Lines below this one are commented out when making // the benchmark.

// Writing image to STDOUT

for (i=0;i<NPTS;i++) { for (j=0;j<NPTS;j++) { printf("%f ",log( sqrt(zRe[i][j]*zRe[i][j]+zIm[i][j]*zIm[i][j]) + 1.)); } printf("\n"); }

}

The listing in FORTRAN is shown below.

program mandel

! FORTRAN77 code to generate a Mandelbrot fractal

implicit none

integer npts! Number of points in side of image parameter (npts=1000)

real*8 zRe(npts,npts) real*8 zIm(npts,npts) real*8 kRe(npts,npts) real*8 kIm(npts,npts) real*8 qRe(npts,npts) real*8 qIm(npts,npts) integer i,j,k,niter

! Number of iterations in the Mandelbrot! fractal calculation niter=51

do j=1,npts do i=1,npts

Issue 18

C and FORTRAN77 101

! Generating z = 0 (real and! imaginary part) zRe(i,j)=0. zIm(i,j)=0.! Generating the constant k (real and! imaginary part) kRe(i,j)=dble(i)*2.0/(dble(npts)-1.)-1.5 kIm(i,j)=dble(j)*2.0/(dble(npts)-1.)-1. enddo enddo

! Iterating ! print *,"Calculating Mandel" do k=1,niter do j=1,npts do i=1,npts! Calculating q = z*z + k in complex space! q is a temporary variable to store the result qRe(i,j)=zRe(i,j)*zRe(i,j)-zIm(i,j)*zIm(i,j)+kRe(i,j); qIm(i,j)=2.*zRe(i,j)*zIm(i,j)+kIm(i,j);! Assigning the q values to z constraining between! -5 and 5 to avoid numerical divergences zRe(i,j)=qRe(i,j); zIm(i,j)=qIm(i,j); if (zRe(i,j) < -5.) zRe(i,j)=-5.; if (zRe(i,j) > 5.) zRe(i,j)=5.; if (zIm(i,j) < -5.) zIm(i,j)=-5.; if (zIm(i,j) > 5.) zIm(i,j)=5.; enddo enddo enddo

! Lines below this one are commented out when making! the benchmark.

! Writing image to STDOUT do i=1,npts do j=1,npts print *,log( sqrt(zRe(i,j)*zRe(i,j)+zIm(i,j)*zIm(i,j)) + 1.) enddo enddo

end program mandel

Qualitative comparison tableTable 1 below summarises the qualitative aspects mentioned in the previous sections.

Explanations for the table columns are:

Language: the name of the language.• Version: the version number of the language used in the benchmark test.• Flags: compilation flags or command line switches used in the benchmark test.• High-level: whether the language is a high-level, array-oriented, numerical calculation language ornot.

Syntax: the consistency of the syntax for the language statements and availability of arraymanipulation functions to avoid loops on array indices.

Math and I/O functions: availability of mathematical functions and scientific file format readingfunctions.

Price: free software or highly priced.•

Language Version Flags High level Syntax Math andI/O

Price

Issue 18

102 Qualitative comparison table

functionsC gcc 3.3.5 20050117 (pre-release) -O3 No Bad Bad Free

FORTRAN77 gcc version 3.3.5 20050117(pre-release) -O3 No Bad Bad Free

PDL 2.4.1 None Yes Good Fair FreeIDL 6.2 linux x86 m32 None Yes Fair Good High

MATLAB 7.1.0.183 (R14) Service Pack 3 -nodisplay-nojvm Yes Fair Good High

Octave 2.1.64 (i686-Suse-Linux) None Yes Fair Good FreeTable 1: Qualitative evaluation of the different languages.

BenchmarksBenchmarks are a tricky business

Benchmarks are a tricky business. This is specially the case for matrix oriented languages like the ones shownhere.

Explicit loops through matrix indices or if-statements should be avoided, since these statements cansometimes make the code much slower.

Most of the functions of these languages are very high-level ones, which perform several more or lesscomplex tasks. Choosing some functions over others that globally provide the same numerical result can havea relatively high impact in the benchmark. A clear example is the implementation of the equivalent of thePDL clip function in MATLAB and Octave. Depending on the implementation adopted, one language wasfaster than the other. In this article, the solution that seems more natural to MATLAB programmers wasadopted, but this technique, as seen in figure 3, gives some advantage to MATLAB. Whereas, the othersolution (not shown here) gave Octave a slight advantage. Another example is the loop order in the C andFORTRAN languages. If the loop order of the matrix indices (i and j) is reversed a significant performancepenalty is obtained.

In any case, this benchmark can serve the purpose of giving an order of magnitude of the execution speeds ofeach one of the languages, revealing whether they are comparable or not.

The system used was a PC with an Intel Pentium 4 processor running at 2.8GHz, with a cache size of 1024Kband 512MB of RAM. The operating system was SuSE Linux 9.3 (i586) with kernel version2.6.11.4-21.15-2mp.

In this benchmark, I have run the exact code that has been shown in the listings provided in this article, takinginto account the following comments:

Since these are number-crunching languages it seems reasonable to test them with big arrays. Toobtain better accuracies in the benchmarks we have iterated the Mandelbrot algorithm many times.Thus, the benchmarks were done with $npts=2000 and $niter=1000. This effectively meansthat the benchmarks are done on 2000 x 2000 arrays and 1000 iterations.

1.

The plotting routines were not included in the tests, only the number-crunching part. As highlighted inthe comments in the code listings, the last lines of the code, which plot the graph, were commentedout in the benchmarks.

2.

To measure the execution time the time command was used. The final result shown in figure 3 is thesum of the system plus user time. To make the comparisons similar, in the case of C and FORTRAN,compilation times of the code has also been added to the final benchmark time. In any case, becauseof the long time spent in the 1000 iterations, this compilation or start-up time for any of the languagestested is really negligible compared with the total time.

3.

The particular version of languages and compilation flags is shown in table 1.4.

Issue 18

Benchmarks 103

Figure 3: Benchmark showing execution times of the calculation of the Mandelbrot fractal. Numberof points is set to 2000 (effectively 2000 x 2000 matrices) and number of iterations 1000 (npts=2000and niter=1000 in the text)

ConclusionHigh-level, matrix-oriented languages are a useful tool to develop projects with heavy numerical calculationsor which require scientific plotting. With them it is relatively easy to obtain fast development cycles. Thisfeature has been illustrated by generating the Mandelbrot fractal.

The qualitative comparison of several of these types of languages (PDL, IDL, MATLAB and Octave) can bestbe seen in table 1. Needless to say that such a comparison is very subjective.

The benchmarks on the examples (see figure 3) provided here show that some high-level, array-orientedlanguages like IDL or PDL, when properly coded to avoid array index loops and if statements, are only aboutthree to four times slower than the faster, low-level languages like C or FORTRAN77. MATLAB and Octaveperform similarly and they are clearly slower than IDL or PDL.

PDL wins hands down. It provides nearly the same or better capabilities than other more expensiveproprietary solutions

From my personal point of view, PDL wins hands down. It provides nearly the same or better capabilities thanother more expensive proprietary solutions. In particular, the mathematical and I/O functions provided byPDL are nearly equivalent to the ones from proprietary solutions and, in the case of array manipulation andlanguage syntax, PDL is better. This comparison has no colour when price is considered, free vs. expensive.With PDL you will certainly never get a message like “No license available to run this software”, not tomention the risks of basing your programming projects on the decisions of the owners of the proprietarylanguages.

BibliographyPDL webpage

PDL for the impatient.

The PDL book

IDL webpage

MATLAB webpage

Octave webpage

Issue 18

104 Bibliography

Biography

Xavier Calbet (/user/42" title="View user profile.): Xavier Calbet (xcalbet AT googlemail DOT com) is along time free software user who started using Linux distributions in the ancient times when Slackware had tobe installed using tens of floppy disks. He is currently working on his two pet projects: a meteorological fieldand satellite image display system, SAPO (http://sourceforge.net/projects/sapo), and the best available freenumerical computer language to date, PDL (Perl Data Language) (http://pdl.perl.org/).

Copyright information

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU GeneralPublic License, Version 2 or any later version published by the Free Software Foundation. A copy of thelicense is available at http://www.gnu.org/copyleft/gpl.html.

Source URL:http://www.freesoftwaremagazine.com/articles/cool_fractals_with_perl_pdl_a_benchmark

Issue 18

Bibliography 105

Issue 18

106 Bibliography

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

A revolutionary idea for tomorrow’s PCs

Can our PCs be re-organised for greater usability?By Matthew RoleyPCs are complex due to underlying hardware organisation. Consequences of this include difficulty inmodifying or upgrading a PC, bloated operating systems and software stability issues. Is there an alternativethat wouldn’t involve scrapping everything and starting over? I will describe one possible solution with bothits benefits and drawbacks.

What (most) users wantWhat do you want from your computer? This is quite an open question, with a large number of possibleanswers. Computer users can generally be categorised between two extremes. There are those who just wantto type documents, write email, play games and look at porn—all the wonderful things modern PCs makepossible. They want their computer to work like their TV/DVD/Hi-Fi, turn it on, use it for purpose, and thenturn it off. If something goes wrong they’re not interested in the why or how, they just want the problemresolved. At the other end of the scale there are those who love to tinker, to dig into the bowels of theirmachine for kicks, to eke out every last ounce of performance, or to learn. If something goes wrong they’llread the documentation, roll up their sleeves and plunge back in.

Where do you as a user belong on this scale? As a Free Software Magazine reader you’re probably nearer thetinkerer end of the spectrum (and you’re also probably asking, what does any of this have to do with freesoftware. Well, bear with me). The majority of users, however, are nearer the indifferent end of the scale, theyneither know nor care how a PC works. If their PC works for the tasks they perform and runs smoothly, all iswell—if it doesn’t, they can either call up an IT helpline or twiddle their thumbs (usually both). It’s easy todismiss such users, many problems that occur on any system are usually well documented or have solutionseasily found with a bit of googling. Is it fair to dismiss such users? Sometimes it is, but, more often than not,you just can’t expect an average user to solve software or hardware problems themselves. The users inquestion are the silent majority, they have their own jobs to do and are unlikely to have the time, requisiteknowledge or patience to troubleshoot; to them documentation, no matter how well indexed or prepared, istedious and confusing. They don’t often change their settings and their desktops are crammed with icons.They are the target demographic of desktop operating systems. Ensnared by Windows, afraid of GNU/Linux,they were promised easy computing but have never quite seen it. Can an operating system appeal to theseusers without forcing everyone into the shackles of the lowest common denominator? Can developers makelife easier for the less technically oriented, as well as themselves, without sacrificing freedom or power? Canwe finally turn PCs into true consumer devices while retaining their awesome flexibility? I believe we can,and the answer lies (mostly) with GNU/Linux.

This article loosely describes an idealised PC, realised through changes in how the underlying hardware isorganised, along with the consequences, both good and bad, of such a reorganisation. It is NOT a HOW-TOguide, you will not be able to build such a PC after reading this article (sorry to disappoint). The goal is to tryand encourage some alternate thinking, and explore whether we truly are being held back by the hardware.

The goal is to try and encourage some alternate thinking, and explore whether we truly are being heldback by the hardware

The problem with PCs and operating systemevolution

Issue 18

The problem with PCs and operating system evolution 107

So what are the problems with PCs that make them fundamentally difficult to use for the average person. Theobvious answer would probably be the quality of software, including the operating system that is running onthe PC. Quality of software covers many areas, from installation through everyday use to removal andupgrading, as well as the ability to modify the software and re-distribute it. A lot of software development alsonecessitates the re-use of software (shared libraries, DLLs, classes and whatnot) so the ability to re-usesoftware is also an important measure of quality, albeit for a smaller number of users. Despite their differentapproaches, the major operating systems in use on the desktop today have both reached a similar level ofusability for most tasks, they have the same features (at least from the users point of view), similar GUIs, eventhe underlying features of the operating system work in a similar manner. Some reasons for this apparent“convergence” are user demand, the programs people want to run, the GUI that works for most needs and thedevices that users want to attach to their PC to unlock more performance or features. While this is evidentlytrue for the “visible” portions of a PC (i.e. the applications) it doesn’t explain why there are so manyunderlying similarities at the core of the operating systems themselves. The answer to this, and by extension,the usability problem, lies in the hardware that the operating systems run on.

Am I saying the hardware is flawed? Absolutely not! I’m constantly amazed at the innovations being made inthe speed, size and features of new hardware, and in the capability of the underlying architecture toaccommodate these features. What I am saying is there is a fundamental problem in how hardware isorganised within a PC, and that this problem leads to many, if not all, of the issues that prevent computersfrom being totally user friendly.

There is a fundamental problem in how hardware is organised within a PC, which leads to many, if notall, of the issues that prevent computers from being totally user friendly

The archetypal PC consists of a case and power supply. Within the case you have the parent board whichforms the basis of the hardware and defines the overall capabilities of the machine. Added to this you have theCPU, memory, storage devices and expansion cards (sound/graphics etc.). Outside of the case you’ve got ascreen and a keyboard/mouse so the user can interact with the system. Cosmetic features aside, all desktopmachines are fundamentally like this. The job of the operating system is to “move” data between all thesevarious components in a meaningful and predictable way, while hiding the underlying complexity of thehardware. This forms the basis for all the software that will run on that operating system. The dominantdesktop operating systems have all achieved this goal to a large extent. After all, you can run software onWindows, GNU/Linux or Mac OS without worrying too much about the hardware—they all do it differently,but the results are essentially the same. What am I complaining about then? Unfortunately, hiding theunderlying complexity of the hardware is, in itself, a complex task: data whizzes around within a PC atunimaginable speed; new hardware standards are constantly evolving; and the demands of users (and theirsoftware) constantly necessitate the need for new features within the operating system. The fact that anoperating system is constantly “under attack” from both the underlying hardware and the demands of thesoftware mean these systems are never “finished” but are in a constant state of evolution. On the one hand thisis a good thing, evolution prevents stagnation and has got us to where we are today (in computing terms,things have improved immeasurably over the 15 years or so that I’ve been using PCs). On the other hand, itdoes mean that writing operating systems and the software that runs on them will not get any easier. Untildevelopers have the ability to write reliable software that interact predictably with both the operatingsystem/hardware and the other software on the system, PCs will remain an obtuse technology from theviewpoint of most users, regardless of which operating system they use.

How do operating systems even manage to keep up at all? The answer is they grow bigger. More code isadded to accommodate features or fix problems (originating from either hardware, other operating systemcode or applications). Since their inception, all the major operating systems have grown considerably in thenumber of lines of source code. That they are progressively more stable is a testament to the skill andthoughtfulness of the many people that work on them. At the same time, they are now so complex, with somany interdependencies, that writing software for them isn’t really getting any easier, despite improvementsin both coding techniques and the tools available.

Device drivers are a particularly problematic area within PCs. Drivers are software, usually written for aparticular operating system, which directly control the various pieces of hardware on the PC. The operatingsystem, in turn, controls access to the driver, allowing other software on the system to make use of thefeatures provided by the hardware. Drivers are difficult to write and complicated, mainly because thehardware they drive is complicated but also because you can’t account for all the interactions with all the

Issue 18

108 The problem with PCs and operating system evolution

other drivers in a system. To this day most stability problems in a PC derive from driver issues.

The devices themselves are also problematic from a usability standpoint. Despite advances, making anychanges to your hardware is still a daunting prospect, even for those that love to tinker. Powering off, openingyour case, replacing components, powering back on, detecting the device and installing drivers if necessarycan turn into a nightmare, especially when compared to the ease of plugging in and using say, a new DVDplayer (though some people find this tough also). Even if things go smoothly there’s still the problem ofunanticipated interactions down the line. If something goes wrong the original parts/drivers must bereinstated, and even this can lead to problems. In the worst case, the user may be left with an unbootablemachine.

The way PCs are organised, with a parent board and loads of devices crammed into a single case, makes themnot only difficult to understand and control physically, but has the knock on effect of making the software thatruns on them overly complex and difficult to maintain. More external devices are emerging and these help abit (particularly routers) but don’t alleviate the main problem. An operating system will never make itphysically easier to upgrade your PC, while the driver interaction issues and the fact that the operatingsystems are always chasing the hardware (or that new hardware must be made to work with existing operatingsystems) means that software will always be buggy.

Powering off, opening your case, replacing components, powering back on, detecting the device andinstalling drivers if necessary can turn into a nightmare

If we continue down the same road, will these problems eventually be resolved? Maybe, the people workingon these systems, both hard and soft, are exceptionally clever and resourceful. Fairly recent introductions suchas USB do solve some of the problems, making a subset of devices trivial to install and easy to use.Unfortunately, the internal devices of a PC continue to be developed along the same lines, with all theinherent problems that entails.

We could build new kinds of computer from scratch, fully specified with a concrete programming model thattakes into account all we’ve learned from hardware and software (and usability) over the past half century.This, of course, wouldn’t work at all, with so much invested in current PCs both financially and intellectuallywe’d just end up with chaos, and no guarantee that we wouldn’t be in the same place 20 years down the line.

We could lock down our hardware, ensuring a fully understandable environment from the devices up throughthe OS to the applications. This would work in theory, but apart from limiting user choice it would completelystrangle innovation.

More realistically, we can re-organise what we have, and this is the subject of the next section.

Abstracted OS(es) and consumer devicesWhat would I propose in terms of reorganisation that would make PCs easier to use?

Perhaps counter intuitively, my solution would be to dismantle your PC. Take each device from yourmachine, stick them in their own box with a cheap CPU, some memory and a bit of storage (flash or diskbased as you prefer). Add a high-speed/low latency connection to each box and get your devices talking toeach other over the “network” in a well defined way. Note that network in this context refers tohigh-performance serial bus technology such as PCI Express and HyperTransport, or switched fabricnetworking I/O such as Infiniband, possibly even SpaceWire. Add another box, again with a CPU, RAM andstorage, and have this act as the kernel, co-ordinating access and authentication between the boxes. Finally,add one or more boxes containing some beefy processing power and lots of RAM to run your applications.Effectively what I’m attempting to do here is turn each component into a smart consumer appliance. Eachdevice is controlled by its own CPU, has access to its own private memory and storage, and doesn’t have toworry about software or hardware conflicts with other devices in the system, immediately reducing stabilityissues. The creator of each device is free to implement whatever is needed internally to make it run, fromhardware to operating system to software; it doesn’t matter, because the devices would all communicate overa well-defined interface. Linux would obviously be a great choice in many cases; I imagine you could run thekernel unmodified for many hardware configurations.

Issue 18

Abstracted OS(es) and consumer devices 109

What are the advantages of this approach? Surely replacing one PC with multiple machines will make thingsmore difficult. That is true to some extent, but handled correctly this step can remove many headaches thatoccur with the current organisation. Here are just some of the advantages I can think of from this approach(I’ll get to the disadvantages in the next section).

Testing a device is simpler, no need to worry about possible hardware or software conflicts, as long asthe device can talk over the interconnect, things should be cool

Device isolationEach device is isolated from all the others in the system, they can only interact over a well defined networkinterface. Each device advertises its services/API via the kernel box. Other devices can access these services,again authenticated and managed by the kernel box. Device manufacturers ship their goodies as a singlestandalone box, and they of course have full control over the internals of said box, there are no other devicesin the box (apart from the networking hardware and storage) to cause conflicts. Each device can be optimisedby its manufacturer, and there’s the upside that the “drivers” for the device are actually part of the device.Testing a device is simpler, no need to worry about possible hardware or software conflicts, as long as thedevice can talk over the interconnect, things should be cool. Note that another consequence of this is thatinternally the device can use any “operating system” and software the manufacturer (or the tinkering user)needs to do the job, as well as whatever internal hardware they need (though of course all devices would needto implement the networking protocol). Consequently, integrating new hardware ideas becomes somewhatless painful too. Additional benefits of isolation include individual cooling solutions on a per device basis andbetter per device power management. On the subject of cooling the individual devices should run cool throughthe use of low frequency CPUs and the fact that there isn’t a lot of hardware in the box. As well as consumingless power this is also great for the device in terms of stability. Other advantages include complete autonomyof the device when it comes to configuration (all info can be stored on the device), update information (again,relevant info can be stored on the device), documentation, including the API/capabilities of the device (guesswhere this is kept!) and simplified troubleshooting (a problem with a device can immediately be narroweddown, excluding much of the rest of the system, this isn’t the case in conventional PCs). Another upside isthat if the device is removed it would not leave orphaned driver files on the host system. Snazzy features suchas self-healing drivers are also more easily achieved when they don’t have to interfere with the rest of thesystem (the device “knows” where all its files are, without the need to store such information).

Many architecturesDevice isolation means the creator can use whatever hardware they desire to implement the device (aside fromthe “networking” component, which would have to be standardised, scalable and easily upgraded). RISC,CISC, 32 bit, 64 bit, intelligent yoghurt, whatever is needed to drive the device. All these architectures couldco-exist peacefully as long as they’re isolated with a well defined communication protocol between them.

No driver deprecationAs long as the network protocol connecting the boxes does not change the drivers for the device should neverbecome obsolete due to OS changes. If the network protocol does change, more than likely only thenetworking portion of the device “driver” will need an update. Worst case scenario is if the network“interface” (i.e. connector) changes. This would necessitate a new device with the appropriate connection ormodification to the current device.

Old devices can be kept on the system to share workload with newer devices, or the box can beunplugged and given to someone who needs it

No device deprecationDevices generally fall out of use for two reasons: a) lack of driver support in the latest version of the operatingsystem; and b) no physical connector for the device in the latest boxes. This problem would not exist becauseas mentioned in “No driver deprecation” above the driver is always “with” the device and can always beconnected through the standard inter-device protocol. Old devices can be kept on the system to share

Issue 18

110 Device isolation

workload with newer devices, or the box can be unplugged and given to someone who needs it, the new usercan just plug the box into their system and start using the device, much better than the current system offarting around trying to find drivers and carrying naked expansion cards around and stuffing them into alreadyovercrowded cases. As users upgrade their machines it is often the case that some of their hardware is notcompatible with the upgrades. For example, upgrading the CPU in a machine often means a new motherboard.If a new standard for magnetic storage surfaces, very often this requires different connectors to those presenton a user’s motherboard, thus necessitating a chain of upgrades to use the new device. Isolated devicesremove this problem. When a device is no longer used in a PC it is generally the case that it is sold, discardedor just left to rot somewhere. Obtaining drivers for such devices becomes impossible as they are phased out atthe operating system and hardware level, and naked expansion cards are so very easily damaged. In thissystem there would be no need to remove an old device, even if you have obtained another device that doesthe same job. The old device could remain in the system and continue to do its job for any applications thatneeds it, and taking some load from the new device where it can. As long as there is versioning on the deviceAPIs there is no chance of interference due to each device having self-contained device drivers. Devices canbe traded easily, they come with their own device drivers so can just be plugged in and are less likely to bedamaged in transit. One of the great features of GNU/Linux is its ability to run on old hardware; this would becomplimented greatly by the ability to include old hardware along with new in a running desktop system,something that would normally be very difficult to achieve.

SecuritySecurity is a big issue and one which all operating systems struggle to fulfil for various reasons. While mostoperating systems are now reasonably secure keeping intruders out and user data safe is a constant battle. Thissystem would potentially have several advantages in the area of security; the fact that the Kernel is aself-contained solution, probably running in firmware, meaning overwriting the operating system code, eitheraccidentally or maliciously would be very difficult if not impossible, and would likely require physical accessto the machine. For the various devices, vendors are free to build in whatever security measures they see fitwithout worrying about the effect on the rest of the system. They could be password protected, keyed to aparticular domain or whatever to prevent their use in an unauthorised system. Additional measures such astamper proofing on the container could ensure that it would be extremely difficult to steal data without directaccess to the machine and user account information. Of course, care must be taken not to compromise theuser’s control of their own system. There are several areas of security (denial of service attacks for example)where this system would be no better off than conventional systems, though it may suffer less as the networkdevice under attack could be more easily isolated from the rest of the system. In fact it would be easier toisolate points of entry into the system (i.e. external network interfaces and removable media); this could beused to force all network traffic from points of entry through a “security box” with anti-virus and othermalware tools, allowing for the benefits of on-demand scanning without placing a burden on the main system.It is likely that a new range of attacks specific to this system would appear, so security will be as much aconcern as it is on other systems and should be incorporated tightly from the start.

Despite the introduction of screw-less cases, jumper-less configuration and matching plug colours,installing hardware remains a headache on most systems

Device installationDespite the introduction of screw-less cases, jumper-less configuration and matching plug colours, installinghardware remains a headache on most systems. With for example a new graphics card, the system must bepowered down and the case opened, the old card removed and the new one seated. Then follows a reboot anddetection phase followed by the installation (if necessary) of the device driver. Most systems have madeheadway in this process, but things still do go wrong on a regular basis, and often the system must still bepowered down while new hardware is installed, and if things go wrong it can be very difficult to work outwhat the exact problem is. By turning each device into a consumer appliance, this system would allow for hotswapping of any device. Once power and networking are plugged into the device the device wouldautomatically boot and be integrated into the “kernel”. No device driver installation would be necessary as allthe logic for driving the device is internal to the device. If the Kernel is unable to speak to the device over thenetwork this would generally signify a connectivity problem, a power problem or a fault with the device itself.Because devices are wrappers for “actual” devices there is no need to touch the device’s circuitry, soremoving risk of damage as can happen with typical expansion cards and also removing the danger of electric

Issue 18

No device deprecation 111

shocks to the user.

Increased performanceThis is admittedly a grey area, true performance changes could only be checked by building one of thesethings. Latency over the network between the devices will be a bottleneck for performance, the degree ofwhich is determined by the latency of whatever bus technology is used. Where performance will definitelyincrease though, is through the greater parallelism of devices. With each device having its own dedicatedprocessor and memory there will be no load on the kernel or application boxes when the device is in use(except for message passing between the boxes, which will cause some overhead). It should also be easier toco-ordinate groups of similar devices, if present, for even greater performance. In the standard PCarchitecture, device activity generates interrupts, sometimes lots of them, which result in process switching,blocking, bus locking and several other performance draining phenomenon. With the interrupt generatinghardware locked inside a box the software on the device can make intelligent decisions about data movinginto and out of the device, as well as handling contention for the device. More performance tweaks can bemade at the kernel level; per device paging and scheduling algorithms become a realistic prospect, instead ofthe one size fits all algorithms necessarily present in the standard kernel.

Device driver developmentIt’s easier to specify a kernel, list of modules and other software in a single place (on the device), along withupdate information and configuration for the device, than it is to merge the device driver either statically ordynamically into an existing kernel running on a system with several other devices and an unknown list ofapplications.

With device isolation it should be a lot simpler to build features that rely on that device, without forcingtoo much overhead on the rest of the system

FeaturesWith device isolation it should be a lot simpler to build features that rely on that device, without forcing toomuch overhead on the rest of the system. For example, a box dedicated to storage could simply consist of anext3 file system that could be mounted by other boxes in the system. On the other hand, you could build in anindexing service or a full database file system. These wouldn’t hog resources from the rest of the system asthey do in a conventional PC, and would be easier to develop and test. Experimentation with new technologieswould benefit due to the only constraint for interoperability with the system being the device interconnect(which would be specified simply as a way of moving data between devices), developers could experimentwith new hardware and see the results in-situ on a running system (as opposed to having to connect potentiallyunstable hardware directly to a parent board with other devices). Users could pick and choose from a limitlessarray of specialised appliances, easily slotted together, which expose their capabilities to the kernel andapplications. Without a parent board to limit such capabilities the possibilities literally are endless.

AccessibilityThis is still a difficult area in all major operating systems, mainly because they are not designed from theground up to be accessible. Most accessibility “features” in current operating systems seem like tacked onafterthoughts. I’m not sure if this is to do with the difficulty in incorporating features for vision or mobilityimpaired users or just whether a lot of developers think it’s not worth the hassle accounting for “minorities”,or maybe they don’t think about it at all. The fact that the population as a whole is getting older means thatover the next few decades there are going to be many more “impaired” users and we should really be makingsure they have full access to computing, as things stand now it is still too difficult for these users to performgeneral computing, never mind such things as changing hardware or programming. I see a distributed devicearchitecture as being somewhat beneficial in this regard, apart from making hardware easier to put togetherfor general and impaired users, the system is also conducive to device development, with the possibleemergence of more devices adapted for those who need them. The many and varied software changes such asystem would require would also offer a good opportunity to build accessibility into the operating systemfrom the start, which certainly doesn’t seem to be the case with current systems.

Issue 18

112 Device installation

The ability to upgrade the processing power of a machine in this way is just not possible with aconventional PC organisation

ApplicationsThe actual programs, such as email, word-processing and web browsers would run on the application boxesdescribed earlier. To re-iterate, these boxes would generally consist solely of processors, memory and storageto hold the paging file and possibly applications depending on overall system organisation. More hardwarecould be included for specialised systems. All hardware and kernel interactions take place over the deviceinterconnect, so applications running on one of these boxes can do so in relative peace. Because devices in thesystem can be packaged with their own drivers and a list of capabilities it should be fairly easy to detect andmake use of desired functionality, both from the kernel and other devices. Another advantage would be theability to keep adding application boxes (i.e. more CPU and RAM) ad-infinitum; the kernel box would detectthe extra boxes and automatically make use of them. The ability to upgrade the processing power of amachine in this way is just not possible with a conventional PC organisation.

Figure 1: Rear view of an imaginary distributed PC

Figures 1 and 2 show front and back views of a mock-up of a distributed PC, mimicking somewhat the layoutof a stacked hi-fi system. While this is a workable and pleasing configuration in itself there are literallyendless permutations in size and stacking of the components. The figures also illustrate the potential problemswith cabling. Only one power cable is shown in the diagram, but there could be one for every box in thesystem unless some “pass-through” mechanism is employed for the power (again employed in many hi-fisystems). The data cables (shown as ribbon cables in the diagram) would also need to be more flexible andthinner to allow for stacking of components in other orientations. Could the power and networking cables becombined without interference? The boxes shown are also much larger than they’d need to be, for manycomponents it would be possible to achieve box sizes of 1-3 inches with SBC or the PC/104 modulesavailable today. The front view also shows an LCD display listing an audio track playing on the box; thishighlights another advantage in that certain parts of the system could be started up (i.e. just audio and storage)while the rest of the system is offline, allowing the user for example to play music or watch DVDs withoutstarting the rest of the system.

Issue 18

Accessibility 113

Figure 2: Front view of an imaginary distributed PC

So, we have a distributed PC consisting of several “simplified” PCs, each of them running on differenthardware with different “conventional” operating systems running on each. Upgrading or modifying themachine is greatly simplified, device driver issues are less problematic and the user has more freedom in the“layout” of the hardware in that it is easier to separate out the parts they need near (removable drives, inputdevice handlers) from the parts they can stick in a cupboard somewhere (application boxes, storage boxes).What about the software? How can such a system run current applications? Would we need a newprogramming model for such a system?

There are many possibilities for the software organisation on such a system. One obvious possibility isrunning a single Linux file system on the kernel box, with the devices mapped into the tree through theVirtual File System (VFS). The /dev portion of the tree would behave somewhat like NFS, with fileoperations being translated across the interconnect in the background. Handled correctly, this step alonewould allow a lot of current software to work. An application requesting access to a file would do so via thekernel box, which could translate the filename into the correct location on another device, a bit of overheadbut authentication and file system path walking would be occurring at this point anyway. Through themapping process it would be possible to make different parts of a “single” file appear like different filesspread throughout the file system. Virtual block devices are a good way to implement this, with a single fileappearing as a full file system when mounted. This feature could be utilised to improve packaging ofapplications which are generally spread throughout the file system, I’ve always been of the belief that anapplication should consist of a single file or package (not the source, just the program). Things are just somuch simpler that way (while I’m grumbling about that, I also think Unicode should contain someprogrammer specific characters; escaping quotes, brackets and other characters used in conventional Englishis both tedious, error prone and an overhead, wouldn’t it be great if programmers had their own delimiterswhich weren’t a subset of the textual data they usually manipulate?).

There is no shortage of research into multicomputer and distributed systems in general, again all veryrelevant

Software would also need to access the features of a device through function calls, both as part of the VFS andalso for specific capabilities not covered by the common file model of the VFS. Because the API of eachdevice, along with documentation, could easily be included as part of the devices “image” linking to andmaking use of a device’s API should be relatively simple, with stubs both in the application and the deviceshuttling data between them.

A programming model eminently suitable for a distributed system like this is that of tuple spaces, I won’t gointo detail here, you can find many resources on Google under “tuple spaces”, “Linda” and “JavaSpaces”).Tuple spaces allow easy and safe exchange of data between parallel processes, and have been used already inJINI, a system for networking devices and services in a distributed manner pretty similar to what I’mproposing, and both Sun (who developed JINI) and Apache River (though they’ve just started) have coveredmuch ground with the problems of distributed systems; most of their ideas and implementation would bedirectly relevant to this “project”. The client/server model, as used by web servers could also serve as a goodbasis for computing on this platform; Amoeba is an example of a current distributed OS which employs thismethodology. There is no shortage of research into multicomputer and distributed systems in general, again

Issue 18

114 Applications

all very relevant.

I’m being pretty terse on the subject of running software, partly because the final result would be achievedthrough a lot of research, planning and testing; mainly because I haven’t thought of specifics yet (important asthey are!). The main issue is that applications (running on application boxes) have a nicer environment withinwhich to run, free from device interruptions and the general instability that occurs when lots of high speeddevices are active on a single parent board. I’m also confident that Linux can be made to run on anything, andthis system is no exception. I’m currently writing more on the specific hardware and software organisation ofa distributed PC, based on current research as well as my own thoughts; if I’m not battered too much for whatI’m writing now I could maybe include this in a future article. Of course, if anyone wants to build one of thesesystems I’m happy to share all my thoughts! None of this is really new anyway; there’s been a lot of researchand development in the area of distributed computing and networked devices, especially in recent years.Looking at sites such as linuxdevices.com shows there is a keen interest among many users to build their owndevices, extending this idea into the bowels of a PC, and allowing efficient interoperation between suchdevices, seems quite natural. With the stability of the Linux kernel (as opposed to the chaos of distros andpackaging), advances in networking and the desire for portable, easy to use devices from consumers I believethis is an idea whose time has come.

The platinum bulletAt this stage you may or may not be convinced of how this organisation will make computing easier. Whatyou are more likely aware of is the disadvantages and obstacles faced by such a system. In my eyes, the threemost difficult problems to overcome are cost, latency and cabling. There are, of course, many sticky issuesrevolving around distributed software, particularly timing and co-ordination; but I’ll gloss over those for thepurposes of this article and discuss them in the follow-up.

The three most difficult problems to overcome are cost, latency and cabling

Obviously giving each device its own dedicated processor, ram and storage, as well as a nice box; is going toadd quite a bit to the price of the device. Even if you only need a weak CPU and a small amount of RAM todrive the device (which is the case for most devices) there will still be a significant overhead, even before youconsider that each device will need some kind of connectivity. For the device interconnect to work well we’retalking serious bandwidth and latency constraints, and these aren’t cheap by today’s standards (Infinibandswitches can be very expensive!). Though this seems cataclysmic I really don’t think it’s a problem in thelong term. There are already plenty of external devices around which work in a similar way and these aregetting cheaper all the time. There are also the factors that it should be cheaper and simpler to develophardware and drivers, which should help reduce costs, particularly if the system works well and a lot of userstake it on. Tied in with cost are the issues of redevelopment. While I don’t think it would take too much effortto get a smooth running prototype up, there may have to be changes in current packages or some form ofemulation layer to allow current software to run.

The second issue, latency, is also tied up quite strongly with cost. There are a few candidates around with lowenough latency (microsecond latency is a must) and high enough bandwidth to move even large amounts ofgraphical data around fairly easily. The problem is that all of these technologies are currently only seen inHigh Performance Computing clusters (which this system “sort of” emulates, indeed, a lot of HPC would berelevant to this system) and cost a helluva lot. Again this is a matter of getting the technology into themainstream to reduce costs. Maybe in ten years time it’ll be cheap enough! By then Windows will probablybe installed in the brains of most of the population and it’ll be too late to save them.

Interconnecting several devices in a distributed system will involve a non-trivial amount of cabling, with eachbox requiring both power and networking cables as well as any device specific connectors. Reducing and/orhiding this, and making the boxes look pretty individually as well as when “combined” will be a major designchallenge.

Another possible problem is resistance, people really don’t like change. The current hardware organisation hasbeen around a long time and continues to serve us well, why should we rock the boat and gamble on anuntested way of using our computers?

Issue 18

The platinum bullet 115

Integration of devices on a parent board was a practical decision at the time it was made, reducing the cost andsize of PCs as well as allowing for good performance. With SBC (Single Board Computers), tiny embeddeddevices and cheap commodity hardware, none of the factors which forced us down this route still apply. Linuxdoesn’t dictate hardware and even though this system would give more freedom with regards to hardware itdoes require a change in thinking. A lot of work would also be needed to build this system (initially) and thebenefits wouldn’t be immediately realisable in comparison to the cost. My main point though is that, once thebasics are nailed down, what we’d have is an easy to use and flexible platform inclusive to all hardware (evenmore so than Linux is already). Interoperability would exist from the outset at the hardware level, making itmuch easier to build interoperability at the software level. With such a solid basis, usability and ease ofdevelopment should not be far behind. The way things are going now it seems that current systems areevolving toward this idea anyway (though slowly and with a lot of accumulated baggage en-route). One of thefirst articles I read on FSM was how to build a DVD player using Linux; this is the kind of hacking I want thissystem to encourage.

Imagine a PC where all the hardware is hot-swappable, with drivers that are easily specified, modifiedand updated, even for the average user

Welcome to the world of tomorrowWith Linux we have an extremely stable and flexible kernel. It can run on most hardware already and cangenerally incorporate new hardware easily. The organisation of the hardware that it (and other operatingsystems) runs on however, forces a cascade effect, multiplying dependencies and complexities between devicedrivers and hence the software that uses those devices. The underlying file paradigm of Linux is a paragon ofbeauty and simplicity that is unfortunately being lost, with many distros now seemingly on a full-time missionof maintaining software packages and the dependencies between them.

Imagine a PC where all the hardware is hot-swappable, with drivers that are easily specified, modified andupdated, even for the average user; a system where the underlying hardware organisation, rather than forcingeverything into a tight web of easily broken dependencies, promotes modularity and interoperability from theground-up. A system that can be upgraded infinitely and at will, as opposed to one which forces a cycle ofboth software and hardware updates on the user. A system truly owned by the user.

The Linux community is in a fantastic position to implement such a system, there isn’t any other singlecompany or organisation in the world that has the collective knowledge, will or courage to embrace anddevelop such an idea. With the Kernel acting as a solid basis for many devices, along with the huge amount ofcommunity software (and experience) that can be leveraged in the building of devices, all the componentsneeded for a fully distributed, Linux based PC are just “a change in thinking” away.

What would be the consequences if distributed PCs were to enter the mainstream? Who would benefit andwho would suffer? Device manufacturers would definitely benefit from greatly reduced constraints asopposed to those currently encountered by internal PC devices. Users would have a lot more freedom withregards to their hardware and in many cases could build/modify their own devices if needs be, extending theidea of open source to the hardware level.

Large computer manufacturers (such as Dell) could stop releasing prebuilt systems with pre-installedoperating systems and instead focus on selling devices with pre-installed drivers. This is a subtle butimportant distinction. One piece of broken hardware (or software) in a pre-built desktop system usually meansa lot of talking with tech-support or the return of the complete system to the manufacturer to be tested andrebuilt. A single broken device can be diagnosed quickly for problems and is much less of a hassle to ship.

What would be the impact on the environment? Tough to say directly, but I suspect there would be far fewer“obsolete” PCs going into landfill. With per device cooling and power saving becoming more manageable insimplified devices things could be good (though not great, even the most energy efficient devices still damagethe environment, especially when you multiply the number of users by their ever-growing range ofpower-consuming gadgets).

A single broken device can be diagnosed quickly for problems and is much less of a hassle to ship

Issue 18

116 Welcome to the world of tomorrow

Big operating system vendors could lose out big-time in a distributed Linux world. In some ways this isunfortunate, whether you like them or not those companies have made a huge contribution to computing in thelast couple of decades, keeping pace with user demand while innovating along the way. On the other hand,such companies could start channelling their not inconsiderable resources into being a part of the solutionrather than part of the problem. It might just be part of the Jerry Maguire-esque hallucination that inspired meto write this article, but I’d really love to see a standardised basis for networked devices that everyone wouldwant to use. I think everyone wants that, it’s just a shame no-one can agree on how.

Biography

Matthew Roley (/user/38650" title="View user profile.):

Copyright information

Verbatim copying and distribution of this entire article is permitted in any medium without royalty providedthis notice is preserved.

Source URL:http://www.freesoftwaremagazine.com/articles/a_revolutionary_idea_for_tomorrow_s_pcs

Issue 18

Welcome to the world of tomorrow 117

Issue 18

118 Welcome to the world of tomorrow

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

How to build squid authentication helpers

Build your own authentication helper using the language of yourchoiceBy Edmundo CarmonaHave you ever tried to figure out how to make Squid authenticate users according to your own exotic rules?Users are in a DB? Are you using an ActiveDirectory? Users/passwords are authenticated by a java class?Everything is possible. Here I intend to explain how to make your own custom authentication helpers so youcan develop your own routines for your own requirements.

SquidSquid is such a wonderful HTTP cache server. It’s stable, fast, highly customizable, and you barely notice itwhen it’s working (oh and did I say it’s free as in freedom?).

It comes with a number of authentication helpers, but there are times when these helpers are not enough.Sometimes you have authentication requirements exotic enough that make those default helpers useless.

The needSuppose you have to do a little checking: you have users/passwords in a MySQL DB table. To make it a littlemore exotic, passwords are not directly stored, but MD5s instead. Suppose that you also want the allowedusers to be listed in a text file in your file system and, finally, make an LDAP request to see if there’s an itemin the directory that matches usernames by the field named “thisCrazyField”. If all that fails, theuser/password can be the pair “foo/bar” (a backdoor… just in case you want to see some things that are betterleft anonymous in the Squid logs!). I am sure no default helper will be able to pull it off.

Before you waste more brainpower trying to figure out when your boss is going to fire you because youcouldn’t find a way to make this authentication scheme work with Squid (or any other HTTP cache solutionfor that matter), you should know that you can make a stand-alone program that can tell if a user is permittedto go through or not. Easy!

Authentication helpersWhat a helper does (even a default one) is very simple: it reads username/password pairs from Standard Inputone pair at a time in a single line of text, and writes a single line of text to Standard Output that either says“OK” (for a user that can go through) or “ERR” (in case of problems)—that’s it. The helper has to repeat thisaction in an endless cycle. Username and passwords are encoded using the character encoding described inRFC 1738 (section 2.2) and are separated by a white space.

What a helper does (even default ones) is very simple

Say I want to make a helper in PHP that will check if the user/password is one of the following pairs:

hello/world• foo/bar•

Here’s the PHP code:

Issue 18

Authentication helpers 119

<?if (! defined(STDIN)) { define("STDIN", fopen("php://stdin", "r"));}while (!feof(STDIN)) { $line = trim(fgets(STDIN)); $fields = explode(' ', $line); $username = rawurldecode($fields[0]); //1738 $password = rawurldecode($fields[1]); //1738 if ($username == 'hello' and $password == 'world') { fwrite(STDOUT, "OK\n"); } else if ($username == 'fo' and $password == 'bar') { fwrite(STDOUT, "OK\n"); } else { // failed miserably fwrite(STDOUT, "ERR\n"); }}?>

That’s it! I’ve just created a PHP-based Squid helper. Feel free to use any tool you want, be it bash, python,Perl or any other language you like. The only requirement is that the language is able to read from thestandard input and write to the standard output (if you want to use bash, be careful to avoid making passwordsvisible with a ps ax).

Testing your masterpieceNow comes the testing part. You have to act the same way Squid would have to: start the script and interactwith it passing username/password pairs. If it outputs “OK” or “ERR” as wanted, then your helper is done.Here’s a demonstration of the helper I just made:

$ php squid_helper.phphello worldOKfoo barERR

Oops! “foo/bar” is not okay. Go to the source code of the helper. See what’s going on? I wrote =='**fo**' instead of == '**foo**'. Correct it in the source code and try all over again:

$ php squid_helper.phphello worldOKfo barERRfoo barOKother thingsERRcool!ERR

Great job! Now we know that the script really authenticates the way we want to. Our helper is ready to beused together with Squid.

Configuring SquidYou have to edit /etc/squid/squid.conf and add these lines, in the "OPTIONS FOR EXTERNALSUPPORT PROGRAMS" section:

auth_param basic program /bin/php your_script_locationauth_param basic children 20

Issue 18

120 Configuring Squid

auth_param basic realm Username and passwordauth_param basic credentialsttl 5 hours

What these lines tell Squid is:

program: how to run your helper? If it’s an executable in itself, just call it; if it needs another interpreter, thenprovide all the things to make it run. In my case, I need the PHP interpreter (unless I make the scriptexecutable and provide the interpreter with a shebang line).

children: this is the number of processes that Squid will have to do concurrent authentications for all theclients. If you set too low a number and authentications are coming in too quickly, Squid will have to wait fora helper to finish an authentication cycle before trying with the next key pair. In my case, I’m creating 20helpers.

realm: this is the text that will be shown to the user in the authentication window.

credentialsttl: this tells Squid how long an already authenticated user/password pair will be valid withoutneeding to ask a helper to re-authenticate (remember the children option? Keep this in mind). In environmentsthat change passwords too often, don’t set this parameter too high.

After that, you have to use one access rule to be able to tell authenticated users from “plain” users.

acl AuthenticatedUsers proxy_auth REQUIRED

And, finally, add a rule to permit these users to go through in the "ACCESS CONTROLS" section:

http_access allow AuthenticatedUsers

Restart Squid or ask it to reload the new configuration.

Once the new configuration is working, you should be able to see as many children processes of yourauthentication helper as you told Squid to use (even if no client is using Squid right now) by typing ps ax.

In an organization where I previously worked, I created a PHP script that authenticates users against anActiveDirectory by following this “recipe”:

If the user doesn’t provide the “realm”, the script adds it (so users can write REALM\username or plainusername).

One LDAP connection is created using the provided user/password to “bind”.

If the connection is established (which means the user does exist in the directory and the password is correct),then the script checks if the user is a member of one group created in the directory named (strangely enough)Internet. For that, it makes a query like this (making sure the $username has been stripped of theREALM\ part before the query, because it’s not a part of the sAMAccountName field):

(&(sAMAccountName=$username)(memberOf=CN=Internet,DC=OURDOMAIN,DC=ORG))

If the query result is empty, unfortunately the user has been rejected (because he/she doesn’t belong into theInternet group).

That’s it.

Any resource you want to use is okay

ConclusionAny resource you want to use is okay as long as the language you use to make the helper supports it. Just

Issue 18

Conclusion 121

remember that all Squid will provide you with is the username and the password.

Enjoy!

Biography

Edmundo Carmona (/user/17" title="View user profile.): Edmundo is a Venezuelan Computer Engineer. He isworking as a Freelance Java Developer in Colombia since very recently. He has also been a GNU/Linux userand consultant for several years. After years of being retired from music, he's working right now to regain hisclassical flute skills.

Copyright information

This article is made available under the "Attribution" Creative Commons License 3.0 available fromhttp://creativecommons.org/licenses/by/3.0/.

Source URL:http://www.freesoftwaremagazine.com/articles/authentication_with_squid

Issue 18

122 Conclusion