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

Page 1

Issue 16



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

Issue 16 By admin PUBLISHED: 2007-02-05 Wow! We're up to Issue 16 of Free Software Magazine. And it comes with a big change - it's online only! It still brings you a wealth of fine articles: Davide Carboni hacks your living room in "A media center based on GNU/Linux", Mitul Limbani phones in a detailed howto for Asterisk in "Asterisk, the easy way", Alan Berg blasts away another game review in "Vega Strike", and Jon Peck helps us all with our iPods in "Managing your iPod without iTunes"... and of course much more! Enjoy. This issue is only available online Source URL: http://www.freesoftwaremagazine.com/issues/issue_016

Issue 16

1


Issue 16

2


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

Paper is dead - has PDF followed suit? By Tony Mobily PUBLISHED: 2007-02-07 Note: Tony will not address comments made to this editorial. Please refer to his blog entry for more information. When I was 14, I bought my first computer magazine. Yes, I was a late starter! What I found amazing was that, after buying my first issue, I understood pretty none of what I had read. There were terms like CPU, RAM, protected mode, driver… I had simply no idea. I was partially excused: we are talking almost 20 years ago, and back then many of those terms weren’t as popular as they are now. Six months (and six issues) later, I realised that I was finally able to read that first magazine cover to cover and actually understand (nearly) everything. I finally had the vocabulary and the information to “get it”—and it felt great! A little while later, I started advising all of my friends that they should buy and read magazines about their interests, if they were serious about them (a lot of them, as it turned out, were!). When they asked me why, I would answer: because you need the vocabulary, you need to know what’s going on in your field. Magazines were really important. The world’s magazine market was booming, and publishers were undoubtedly happy. Then, the internet came. The shift was significant. Everybody knew it, but nobody was able to predict where it would all end up. Would contents become a per-pay privilege even on the internet? Would individuals start competing against multimillionaire companies and eventually kill them? The war between bloggers and established journalism is under everybody’s eyes. What is clear, is that paper magazines—once the cultural centre and virtual community of many topics—have become more and more irrelevant. The paper magazine market has been slowing down significantly. People are not buying magazines as much—they are browsing the web. People are not paying for ad-infested magazines—they are reading online articles and occasionally clicking on ads. At the beginning of the revolution, the PDF format was considered the bridge between the paper and the online world. Adobe did something very smart when they released the full PDF specifications (and then, later on, did something very stupid when they tried to keep for themselves the “enhancements”, but that’s another story). With PDFs, you could publish something electronically, and be sure that it would look exactly the same as it would look on paper. Many people believed that most of the paper magazines would simply turn into PDF ones, sold on the net. That step obviously (luckily?) didn’t happen. At the end of the revolution, very few PDF magazines actually existed. Why? Well, the world took an entirely different direction, in terms of contents and revenue—a direction that steered away from PDFs. Today: • Most income with online information comes from online banners. Although it is possible to publish clickable banners in PDF files, it’s not straightforward and it’s not the “norm”. • Publishing in HTML format is very easy, and it doesn’t require any composition efforts. Forget about Pagemaker, Quark XPress, and so on. • Most of the time, it’s actually easier to read information from a web site than a PDF file, since PDFs often require horizontal scrolling and are more awkward to read.

Paper is dead - has PDF followed suit?

3


Issue 16 • Web sites end up in a person’s bookmark or RSS feeds. PDF files end up in some obscure folder and forgotten about. • PDFs are much better in terms of printing. However, not many people seem to be willing to print their PDFs. • PDFs tend to be big, monolithic files, whereas web sites are made up of smaller pages. Big monolithic files are every web server’s enemy. • It’s easy to point to a specific web page. It’s not straightforward to do so with PDFs—and even if you do, you will have to download the full PDF document to read a specific page • Google doesn’t index PDF files very well. It’s hard to get decent pageranking if your web site based on information stored in PDF files. • PDF is fantastic for distributing application forms (for example for banks etc.). However, you can hardly make money by distributing application forms… • Did I mention that composition is expensive? Abobe could have addressed a lot of these problems very easily. For example, they could have offered a more straightforward, standard way of publishing banners in PDF files, allowing even Javascript (and therefore allowing Google banners). They could have offered templates for this, as well as published ways of making sure that there was no need for double scrolling while reading a document. Now, it’s too late—and admittedly, even if they had done all of the right things, the web would have probably won anyway. As you’ve probably already noticed, we have ourselves given up on releasing Free Software Magazine in PDF format. As far as we are concerned, PDF is gone—at least from our web site. We will probably still allow people to download the PDF files of the old issues. However, now we can focus more on the contents, and less on composition and distribution of big, clumsy files. The world has changed significantly. Magazines used to be the cultural centre of every possible topic—and they used to sell well. Today, the internet is slowly but surely taking the place of magazines—and taking more and more advertising money away from paper publishing. Paper—as well as PDF—is now a thing of the past. Web sites are gaining importance—at full throttle. Publishers need to adapt—and need to do it fast. The alternative, is to painfully become irrelevant and fade away.

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

Copyright information Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. Source URL: http://www.freesoftwaremagazine.com/articles/editorial_16

4


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

Freeing an old game Relicensing UMoria By Ben Asselstine PUBLISHED: 2007-03-12 Do you remember that old game that you used to play all the time? Do you still play it? It probably isn’t free software. Do you wish it was? Sometimes writing a clone of a game is a lot of work compared to the amount of work it takes to relicense one. Here is a story about how one group of people are going about freeing the game known as “Moria”.

Introduction People are often attracted to games before they are attracted to the free software movement. This means that many free software enthusiasts are addicted to non-free games. This is what turns some people to free software—the inability to see how a game works, or the inability to legally share it with friends. In the 1980s, a game called Moria was created at the University of Oklahoma by Robert Alan Koeneke. It was an improved version of “Rogue”, a very popular ascii-text dungeon crawling game. James E. Wilson eventually came along and ported it to C on UNIX (from Pascal on VMS), and created UNIX Moria, or just “UMoria”. The unfortunate thing about UMoria is that it was released under a non-free software license, and the software continues to be non-free today. Although the license allows anyone to see the code, it is not free software due to restrictions in the license. This is considered an unfortunate situation by many who remain in the Moria community, and over a year ago we set out to relicense Moria with a free software license. For this to happen, each of the copyright holders must relicense their contribution. A private mailing list and a public website as well as an IRC channel (#moria on freenode.net) were established to assist in the effort.

Figure 1: Moria running on GNU/Linux in gnome-terminal

Why give Moria a free software license? Why? Because… • Freeing Moria will give it a wider audience because it can be distributed with GNU/Linux distributions. This encourages new bug submissions and patches. As a result of new collaboration the software improves and lives longer. • It will help the free software enthusiast feel better about playing the game.

Why give Moria a free software license?

5


Issue 16 • Freeing Moria also stems the flow of non-free software downstream in games like Angband and its many variants.

Figure 2: Where Moria fits into the family tree of Rogue-like games

Identifying and locating contributors Identifying copyright holders is much different from locating them. A copyright holder is anyone who contributed to the codebase. Because Moria is such an old project, the vast majority of recorded email addresses no longer work. And, because it has not been kept in a public version control system like CVS, it is even less clear who the contributors were. It is critically important to define your list of copyright holders accurately and completely, along with descriptions of their contributions. This took many hours of researching the codebase and USENET posts. Once you’ve determined that a contributor is a copyright holder, it’s time to locate them. This can also require endless hours of researching email addresses, and sending emails. UMoria has 26 copyright holders. Of the 25 people we have contacted so far, every one of them has agreed to relicense their contribution. We searched the web and searched through many old USENET posts to identify and locate contributors. A contributor was even contacted on the telephone (imagine their surprise—“Hello, you’re not going to believe this but I’m calling about a computer game called Moria that you contributed to 10 years ago…”). One contributor had even changed his name making him especially hard to find. Another person contributed to Moria prior to a crucial year in US Copyright Law that required all copyright holders to state their name with a year and a copyright symbol. A large amount of time was spent sending emails asking if this was so-and-so who contributed to Moria. There were many bounced emails because the addresses were invalid or inboxes were long full. Once in a while, we would find the person we were seeking and we would celebrate. Usually the person was very pleased to hear from another Moria fan. Many contributors expressed fond memories of the game and were thankful that someone still cared about their contribution. Some others could barely remember contributing.

Getting contributors to relicense After being contacted, each contributor was given the choice of the putting their contribution under the auspices of the GNUGeneral Public License or putting their contribution into the Public Domain. Unfortunately the GPL was an unacceptable choice to some of the contributors. A boilerplate license declaration was sent to every contributor, and was augmented with the date, and a description of their contribution to UMoria. The contributors verified the statements, typed out their names in the space provided and sent them back via email.

6

Getting contributors to relicense


Issue 16 Here is what our GPL boiler declaration looked like: I <your name here> hereby release my contributions to UMoria (which includes <contribution here>) under the terms of the GNU General Public License (“GPL”) (version 2). It may be redistributed under the terms of the GPL (version 2 or any later version). I do so on <today’s date>. In hindsight, a version of the software should appear in the boilerplate declaration. We still lack one final contributor who is especially hard to find because he has a common name. If anyone reading this article knows a “Brian Johnson” who likes to do computer programming and was old enough to add “GNU/Linux support” to Moria in 1992, please have him contact me.

Update In October of 2007 the final contributor, Brian W. Johnson was contacted and he agreed to put his contributions under the GPLv2+. He was located by telephoning the Talented Youth Math Programme at the University of Minnesota, and asking for some basic personal information. They broke the rules for the right reasons and divulged that he went on to get a PhD at the University of Chicago. From there it was a simple matter of contacting his thesis advisor, who provided an email address where Brian could be contacted. Brian responded right away, and confirmed that he played Moria in the early 90s on an early version of Debian GNU/Linux. It was disturbing when Brian said he did not remember contributing source code to Umoria! However after Brian examined the source code, some old memories were refreshed and he remembered making a contribution after all. He has since blogged about the experience. All of the license declarations have been given to the maintainer of UMoria (David Grabiner) and it has been confirmed that the next version of UMoria will be released under the GPLv2+! It is very satisfying to see how other games on the Roguelike tree are trying to change their licenses to be Free Software licenses. Perhaps inspired by the relicensing of UMoria, the Angband project has made great strides in it’s own relicensing effort. At last count they only need to find two more contributors! To follow their progress visit go to rephial.org. Keep up the great work!

Conclusions Although freeing Moria has been a more difficult task than originally expected, it has also been a rewarding experience. When we started we were a team of 2, and now we’re a team of 7! I would encourage anyone to try and relicense their favourite old game. It consists mostly of emailing someone and asking them if they’re the person in question, and then emailing them back the boilerplate. If you colloborate with a bunch of friends, it can be a lot of fun. You’ll also meet the people who made your favourite game, which can also be a nice experience. I look forward to the near future when Moria is finally free software.

Thanks There are a lot of people who need to be thanked. I want to thank all of the Moria contributors who helped in this effort so far. And I’d especially like to thank the people who did the researching, emailing, telephoning or who just helped to keep spirits high: Lars, Ben H, Barry, Antoine, Ben S, and Eli the Bearded. Thanks to SourceForge for hosting our free-moria project. Also a very special thanks go to the staff at the University of Minnesota Talented Youth Math Programme for breaking the rules for the right reasons.

Biography Ben Asselstine (/user/34804" title="View user profile.):

Thanks

7


Issue 16

Copyright information This article is made available under the "Attribution" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by/3.0/. Source URL: http://www.freesoftwaremagazine.com/articles/freeing_an_old_game_moria

8

Thanks


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

Involving the community: my podcast experience Community and freedom By Jonathan Roberts PUBLISHED: 2007-02-21 I recently started a new podcast where people like you and me have the chance to put questions to key people in our community. While doing that I discovered some aspects of our community that I feel are often over looked in the drive to find new users.

Why I did it For those of you who don’t know, I recently put together a new podcast where people like you and me had the chance to put questions to a panel of key players from the world of free software. I’m afraid I can’t claim to know where the idea came from anymore, but what I do know is that after having the idea, and seeing it to fruition, I’m really pleased I had it! To be honest, however, it was one of those things that occurs to you and you think “yeah, great” but never really believe it will happen; this time, I thought the idea was a good one and decided to give it a shot. So, I went about finding the email addresses of some people I thought would be interesting to hear speak and dropped them a note explaining my idea. Something surprising happened too: they replied. More than that, they were happy to take part! Something surprising happened too: they replied. More than that, they were happy to take part! Initially, I thought it was a good idea simply because I always enjoy reading interviews and hearing people talk passionately (and knowledgeably!) about a subject I’m interested in. Add to that, the format of ordinary people asking the questions works really well on the BBC radio show Any Questions. After getting the replies, though, and reading some of their comments in the messages I started to realise that it could be more than just an interesting listen. It was an opportunity for those of us who usually struggle to make contributions elsewhere in the community—whether due to a lack of time, lack of technical knowledge (as is often my situation!), lack of confidence or any other reason from a myriad of possibilities—to ask a quick question and get some feedback from those right at the centre of our community. It was also an opportunity to rediscover the principles that underlie everything we do in the free software world: to rediscover the importance of freedom.

The good times… There is, in my opinion, something special about free software: I started using GNU/Linux about a year ago now and all the way through my transition from proprietary software there has been a huge number of people willing to support me however they could. I saw this attitude reflected once again in the generous responses from the guests, who, despite busy schedules, family commitments and, in one case, a hangover, gave up their time to talk on a show being put together by a gap year student with no previous experience! This sense of community is, in actual fact, only half of why I think free software to be special; I had only considered the other half, until recently, marginally important. This “other half” is freedom. I’d always thought the terms “open source software” and “free software” to be interchangeable, but while in the initial stages of preparation Richard Stallman pointed out to me the difference between these two terms. “OK” I thought, and I investigated a little and found that this is the case. I still failed, however, to see why the difference is important—why freedom is important.

The good times…

9


Issue 16

Figure 1: GNU’s head While making the actual recording, though, this began to change: Richard Stallman’s suggestion that he was influenced by growing up in the United States in the ’60s demonstrated to me how free software links so strongly with values of fundamental importance to us all; Jeremy Allison’s door handle analogy is a clear practical example of why these freedoms are important; also, Jeff Waugh’s comments that he loved having a community out there “creating fantastic stuff” with free tools highlighted, for me, how freedom is at the very centre of our community.

…and the bad Of course, in putting this together it wasn’t all generous responses and grand realisations of the importance of freedom: I had my fair share of times when I panicked about getting enough questions to ask the guests; fears that nobody would know about it, or that nobody would want to listen. On a few occasions, I blamed the community for these moments, but in all honesty, it was me who was responsible. I thought it would be easy: I would post to Digg and Slashdot, lots of traffic would be driven to me and questions would be plentiful! I was wrong. The internet is a very big place and starting something new on it was never going to be easy. The free software community, though, came through for me once again (as it had all those other times when I needed to set up printer networking, figure out how to record a VoIP conversation etc etc!). Free Software Magazine put up a blog post about it, Linux Format put it on their front page news section, people responded in forums, mailing lists and IRC, and, in the end, we got some great questions to make, in my opinion, a great show. The moments when I did blame the community, though, opened my eyes to some things, which I don’t think I’d ever have considered otherwise. All that I know about the ideals and philosophy behind free software—until recently—had been based on hearsay, on piecing together little bits of information I found here and there. This had on some occasions resulted in misconceptions. More importantly, however, it had prevented me from gaining a deeper appreciation of why free software is so important, about why the community is the way it is and about how freedom is at the core of everything we do. Freedom is at the core of everything we do

Moving on from here I suppose my point is this: we want to expand the numbers of people using free software because the software itself is really good, but this isn’t our strongest selling point, nor our most significant. As much as we’d rather not admit it, proprietary software isn’t bad (in quality terms); where it fails is in the lack of freedoms it gives to its users, the very place we are strongest. The next time you’re trying to convince someone to try GNU/Linux, tell them the door handle story, tell them about DRM and point them in the direction of GNU’s philosophy links—help them to understand. In doing so, they’ll discover not just great software, but a welcoming and knowledgeable community, who care passionately (and with good reason too!) about freedom. Perhaps, even take the time to do these things yourself, or to listen to the discussion in the podcast and

10

Moving on from here


Issue 16 remember why we all love this community.

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

Copyright information Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. Source URL: http://www.freesoftwaremagazine.com/articles/involving_the_community_my_podcast_experience

Moving on from here

11


Issue 16

12

Moving on from here


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

Play and touch-type with TypeFaster Learning how to type can be fun! By Nelson Berg PUBLISHED: 2007-03-28 In this fast and over active world of computers, there is only one thing that seems to remain slow and underrated. I see it at school, with my fellow students; I see it with my friends. At home, I spot the same thing with my mom, and my dad and even my younger brother. It is the keyboard! In this article you will learn how to use TypeFaster to yes type faster!

Introduction TypeFaster is a Windows specific free software game that teaches you how to, you guessed it, type faster. Within the bounds of 20 dedicated lessons and one game, you will learn how to type with all of your fingers (not just two of them). Adults are not the only ones who can benefit from using TypeFaster; kids and very old-fashioned teachers can also learn how to type, and in a playful way that will engage. If you are not convinced, imagine how much time that it will save throughout your entire life! My best guess calculation is: currently you could easily write over 3000 words per week through a combination of emails, projects at work or school, chatting with friends via IRC etc. That works out at over 10 million words typed throughout a 65 year typing life (ages 10 through to 75). Now if you type at only 20wpm that is a whole year of just typing. If you just double your typing speed to 40wpm, you can have 6 months of your life back. TypeFaster is the nicest way to learn how to type You can play it by yourself (in single user mode), with others (in multi user mode, sharing the same computer) or even choose the “teacher support” mode (designed for use in schools). Within the game, each member of your family or class can have their own account. The settings and progress of each user will be stored, so you can check your own progress… and your mother’s! The Multi user with teacher support is designed for use in schools. It must be installed in one location: for example, in a shared network folder.

Installation TypeFaster is free software; you can download it from SourceForge. The game file is not very big (it’s just 6.53MB), and it’s available in numerous languages: French, English, German, Japanese, and many others. Warning : Sadly, At the time of writing the program works only under a Windows environment Once you run the installer, press “I agree” and then press “Next”.

Installation

13


Issue 16

Figure 1: The install wizard Press “Browse”; you will see a list of options; click on “desktop”. Press “Next” to choose “single user”, “many users” or “teacher support”. Click on “Install”. You are done! You will see an icon with the words TypeFaster on your desktop click on the icon and the program will start.

Figure 2: The folder

My first impressions Lesson one (figure 3) is quite simple: there are only a few letters that you need to type; only in the lesson named “common words” will you start seeing actual words. Each lesson takes about five or ten minutes. Lesson one is just for beginners. After starting, on top of the page, you see a 0%; when you write a few words, it goes up to 1% and so on. Once you achieved 100%, you go to lesson two. You will also see how many mistakes you have made, and how long it took you to get to 100%. In lesson two, more letters come to the screen. As the lessons continue, more and more letters are added until you are typing with the whole keyboard and all of you fingers. When you suddenly feel the need for more excitement you can click on “play a game”

14

My first impressions


Issue 16

Figure 3: Game one of two

The game When you suddenly feel the need for more excitement you can click on “play game”: a game will appear. You are given three “lives”. The goal is to type the right words in the given amount of time; as the speed increases and more difficult words enter the zone, you may end up with one less life. (This will definitely test your stress capacity and ability to work under pressure!) I am sure kids will like the game (figure 4) because there is more action: when you’ve typed a word, a rocket will destroy the word and then another word will appear.

Figure 4: game two

Conclusions At first, I thought the game would be a real bore. However, once I started to type faster and faster, I began to really like this approach. The game is quite simple. If you see a letter turning red, you press that letter on the keyboard. Usually another letter turns red, and sometimes the same letter needs to be pressed twice. The trick is not to stop pressing the red letters. What could be added to this game? Well, when you finish a lesson, it would be nice to get a surprise. In addition, when you complete lesson one to lesson 20, you could be “clapped”, or receive a gold star of some sort. In addition, the first game is a bit of a bore. So, I would advise the maintainer to make the first game little less boring! By spending 3 hours on gaming my speed went up by about 10%. I am 10: I must have saved hundreds of hours or days of my future life. Just think how many more games I can play in that time! [Victorian father

Conclusions

15


Issue 16 comments: Games, games. Give the kids good solid accountancy packages I say!] You can also play nice competitions with your schoolmates, friends and little brothers and sisters. If you’re a teacher, I encourage you to use this program with your students: it is indeed the nicest way to learn how to type faster. Have much fun, let your fingers learn efficiency and TypeFaster.

Biography Nelson Berg (/user/81" title="View user profile.): Nelson Berg is an intelligent and aggressive game player and seven days a week ten-year-old son of Alan Berg (/user/8) In his spare time he performs brain surgery and works for a secret organization that protects the world and sometimes the Universe.

Copyright information Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. Source URL: http://www.freesoftwaremagazine.com/articles/play_and_touch-type_with_typefaster

16

Conclusions


Issue 16

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

The free Tron Universe—Armagetron Advanced reverberations By Alan Berg PUBLISHED: 2007-03-26 After all these years, I still remember the sounds and primary colours associated with the climatic lightcycle scene in the 1982 Walt Disney film TRON. As the noise-ridden cycles raced to certain destruction, synthetic electronic reverberations could be felt throughout the whole audience and my bones at the cinema. Sure, since my long forgotten childhood there were a couple of well-made arcade games. However, nothing really forced those memories to the fore until my elder son played Armagetron Advanced and smashed my virtual existence into all kinds of ugly jelly shapes at great speed via my house net. This article will explain installation and the basics of game playing. I hope you get as much fun out of what, at first glance, looks too simple to be true OpenGL game. Sit back, turn your 5.1 speakers on, set the sub woofer up high, and vibrate violently as you duck and weave to certain victory or the shadow of defeat. Health Warning: Hum—being prodded by a stick—please do not turn your woofer volume up so high as to damage your hearing or generate violence from your nearest and dearest… not that I’ve ever done it, nor am I still limping from the almost fatal mistake.

Installation Armagetron is a free software project licensed under the GPL. The game being based on the OpenGL framework runs fluidly on most platforms including Windows, Linux, and Mac variants. Note: Obviously, I naturally assume that you have a live connection with the internet. Visit the project’s home page and download to your home directory the current and most suitable package. Commands similar to the following should deploy (run these commands in the same directory where you downloaded the game’s file): chmod 700 armagetronad-0.2.8.2.1.i686-generic-linux-gnu.package ./armagetronad-0.2.8.2.1.i686-generic-linux-gnu.package

A dialog will appear that will ask you for the administrator password. After filling in, the system will deploy the package system wide for all users and create a menu item under “games”. You will have installed “Armagetron Advanced”, the advanced and now official version of the popular game.

The free Tron Universe—Armagetron

17


Issue 16

Figure 1: Armagetron Advanced Home

Winning the local race It sounded so simple. Steer a digitized lightcycle around an enclosed arena. Force the slightly-crazed AI competitors to crash violently into the generated walls that you so carefully leave behind your cycle’s exhaust. Achieve victory, fame and a lasting control over your own computer. So simple, no challenge you may think. How can artificial outwit the living persona of TRON, the man they call the hard straight liner. Okay, no one has called me that, but maybe they will. Well, try riding the light yourself. The pain is still fresh in my scorched fingertips. Therefore, my elder son is better. I don’t care. It sounded so simple… Let’s start with a straightforward race: you, Captain Brave Heart or Queen Cool, against a slow moving AI with low intelligence. Then we are going to zap up the IQ of the AI monsters, the number of self same monsters and speed of the game. Finally, how about racing against other online misfits and chatting at the same time. Before playing for the first time, if you are similar to me (sorry to insult you) and like to use arrow keys for steering your lightcycle steed, instead of letters such as ‘z’ and ‘x’ then you will need to modify your player settings. To start the games in Ubuntu select the menu item Application→Game→Armagetron. After the splash screen has finished making you wait, you will find yourself looking at the main display options. At this point, select Player Setup/Player 1 Settings and change the name to your online pseudonym. Names similar to “Zot The Remorseless” or “The Man With The Porsche” are standard conventions. Being bori— sorry, sane—I chose Alan. To modify the keyboard settings select Input Configuration as shown in figure 2. To change settings press the Enter key over the relevant entry and then assign a key by pressing it. Move through the key bindings via the arrow key and, when you’re done, press the Escape key three times to find yourself back at the main menu.

18

Installation


Issue 16 Figure 2: Input Configuration To start your first game select Game/Local Game, at this point you will find yourself in a grid with one other cycle. The grid is large and the opposition is as stupid as always. Hey, if they weren’t stupid, then they would be riding tanks. You won’t get too much pleasure from this level. However, it does give me a chance to describe some basic features and allow you to build your familiarity. This is always a good idea before spilling your virtual ego over your elder son’s shoes. Firstly, you need to know about grinding. If you get very near to the wall generated by the opposition or your self you will start to accelerate. The grinding invokes images of sparks flying from the side of your lightcycle as the cycle grinds the walls. The main advantage of grinding is that you can overtake and then try to force the opposition to crash. Therefore, your main navigation tools are left, right, brake and grind. Once you have mastered these basic skills you are ready for the big time. Chatting is possible and even useful when playing as a member of a team. However, like chatting on a mobile while driving a car with the baby in the back, I would advise against it. Anyway, taunting might be fun, but I find winning more addictive. To change setup while playing, press Escape and the main configuration options will appear. In single player mode, the game very politely sleeps while you are busy fiddli— sorry fine-tuning. Back to the chase. After getting used to one enemy of humanity, it is time to take four of the AI’s on and split the screen so that you can view the world from the your perspective at the same time as one of your enemies. Split screens are excellent for playing a game live locally against one or more of your competing friends/evil doers. It is a great joy to share the same keyboard and fight to the death, though my sons are a little too efficient for my liking. All this positive resonance is enhanced by the modern trend of 20 inch or greater wide screen TFT monitors. Split screens are excellent for playing a game live against one or more Firstly, add extra AI to push your alleged talent to the highest levels. Once in game press the Escape key and choose Change Game/Game Setup, select AI Payers and choose the number 4 to start with. Next, artificially pump up the generic IQ of your adversaries via the obviously named option AI IQ. Notice that you may also change the game type here as well. Last Man Standing makes sense as the game stops when only one human is left. Free style just keeps going and going until all humans are dead. To split the screen (figure 3) to function effectively for two local human players (player 1 and 2) return to the main menu via the Escape key and then select Player Setup/Viewports: Horizontal splits. If you wish to be specific about which player is presented where then you should try out the Assign Ports option.

Figure 3: Screen grab of split screening in action (just before I crashed) By now you should be able to play locally, kill your friends, well, up to three of them, and know when to swipe the keyboard away at crucial moments. Sure big monitors help, but a little aggression and threats about pocket money seem to get me on the winning side of the local competition.

Winning the local race

19


Issue 16 Sure big monitors help, but a little aggression and threats about pocket money seem to get me on the winning side of the local competition

Networked fortressing Strong and cool, certain in your foolishness you are now ready to face the bitter reality of online highly competitive grinding. However, before doing so I would recommend reading the details on your cereal box and visiting the official WIKI and absorbing the basic skill building section. Now let the games begin. From the main menu select Network Game/Internet Game. Choose a server whose description looks vaguely interesting and start playing. If one of the human players is misbehaving then there are two extra options to deal with the situation, in game press escape to get to the menu. You will now notice (figure 4) the Police option, which allows you to vote to kick a player out of the game or silence their insistent and rude chatting.

Figure 4: The Police menu is extra for networking games

Final Comments From what seems such a simple game, as soon as you add such elements as split screens and online gaming, the play evolves to the addictive. I particularly like the physical interaction of using one keyboard with a couple of competitors/sons and the noise made by the sub woofers of my cheap and reliable 5.1 speaker set. I can never get too much of the powerful atmospheric low-level hum of the oncoming lightcycles. Moving forward you may consider hosting your own server or trying out the different server patches and thus game plays. For the budding artists customizing the look and feel with moviepacks is a necessity. Giving back to the community can only improve the whole. Enjoy, have fun, and do not become too humiliated.

Resources and further reading Armagetron Advanced homepage Armagetron Advanced WIKI Building your skill set Download page Tournaments

20

Resources and further reading


Issue 16

Biography Alan Berg (/user/8" title="View user profile.): Alan Berg Bsc. MSc. PGCE, has been a lead developer at the Central Computer Services at the University of Amsterdam for the last eight years. In his spare time, he writes computer articles. He has a degree, two masters and a teaching qualification. In previous incarnations, he was a technical writer, an Internet/Linux course writer, and a science teacher. He likes to get his hands dirty with the building and gluing of systems. He remains agile by playing computer games with his kids who (sadly) consistently beat him physically, mentally and morally. You may contact him at reply.to.berg At chello.nl

Copyright information This article is made available under the "Attribution" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by/3.0/. Source URL: http://www.freesoftwaremagazine.com/articles/gltron_armagetron

Resources and further reading

21


Issue 16

22

Resources and further reading


Issue 16

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

The lazy user’s guide to OpenOffice.org Writer Create and manage large documents in OpenOffice.org By Daniel Escasa PUBLISHED: 2007-03-14 All hail the lazy, for they will find the most efficient way to work a computer in general, and a word processor in particular. In this article, I’ll look at three lazy writer’s tricks that can relieve you of most of the drudgery involved in creating a fairly large document in OpenOffice.org Writer (henceforth, OOo Writer or simply Writer).

Make the computer do most of the work A word processor such as Writer is “bloated” for a reason—it has features that save you a whole lot of work. Of course, masochists or uber-workaholics might hate these features, but the lazy user can’t imagine life without them. These are the three things I’ll show you how to do: • create a title page, • create a table of contents, • and change the page numbering styles …the lazy way, of course.

Creating a title page I’ll create a title page where the title lands in the middle of the page. This title page might also include author information—either just below the main title, or right at the bottom of the page. Start with a blank page. If you’re adding a title page to an existing document, you’ll have to insert a new page before the first one. If you were workaholic or masochist, you would then type in the title, set its character and paragraph attributes, then hit the Enter key until it “looks” centered. Masochists or uber-workaholics might hate these features, but the lazy user can’t imagine life without them But you’re lazy and more sensible. So, you draw a text box anywhere on your blank page—its size doesn’t matter, because you can always adjust it later to fit your title. Use Insert→Frame to do this, type your title into the text frame, then resize as necessary. Once you’re happy with your title, you’re ready to center it on the page. Right click on the text frame, select Frame, then choose Center from the Horizontal drop-down list, then Entire page from the to drop-down list. Also choose Center from the Vertical drop-down list, and Entire page from its corresponding to drop-down list (as shown in figure 1).

Creating a title page

23


Issue 16

Figure 1: Centering the title This should give you some idea of how to place an author frame at the bottom right of the page, which I will leave as an exercise for the reader.

Creating a table of contents Once your document is long enough—say, upwards of 10 pages—it may be time for a table of contents to help your reader out. You can create a table of contents from an outline of your document, or from paragraph styles that you select—e.g., Heading or Heading 1. With Writer and, I suspect, MS Word and other modern word processors, you can create hyperlinks to your outline. So, when a reader clicks on a section heading in the table of contents, the program will move the cursor to that heading. For instance, if you click on the text “Planning the Migration” in figure 2 (take note that it’s got a blue underline), Writer will move to Chapter 5—which just “happens” to be titled “Planning the Migration”.

Figure 2: A sample table of contents While I’m on the subject of outlines, you’ll notice that the sections and subsections are numbered. Again, I told Writer to put those numbers in. The cool thing about it is that if I insert a level-one outline item (say, between “Degrees of migration” and “Planning the migration”), the latter will be renumbered 5, and its sections 5.x and 5.x.y. Even cooler is that it’s not that hard to create a numbered outline—Tools→Outline Numbering did it. That’s just a bit of setup upfront to save tons of manual work. To create the table of contents, first move the mouse cursor to the start of the document, then Insert→Indexes and Tables, then click on Indexes and Tables. Below the Create from pane, check the Outline box, then click on the ellipsis (…). The Outline Numbering dialog box should come up (figure 3). Select 1-10 and click OK. If you want to create hyperlinks, click over to the Entries tab, click on the empty box to the left of the E and click on Hyperlink, then click on the empty box after the E and click on Hyperlink again. Click OK to create the table of contents.

24

Creating a table of contents


Issue 16

Figure 3: Setting up the table of contents The computer can do so much for us if we only let it I should mention that Writer doesn’t automatically update the entries in the table of contents. If you inserted a new section between 5 and 6, for instance, or typed in enough text in section 5 to cause a page renumbering, the table of contents wouldn’t reflect the changes. Not to worry, Writer will do it for you, you just have to ask nicely—just right-click anywhere within the table of contents, then click Update index/table.

Changing page numbering style A long document’s preface or foreword will come after the Table of Contents and its pages numbered with lower-case Roman numerals (i, ii, iii, …). After that comes the main body of the document, numbered with Arabic numerals (1, 2, 3, …). Here’s how to do it. First, insert a new page. Use Insert→Manual Break (as shown in figure 4), then Page Break, and be sure to change the Style to Default. You can’t use the Ctrl-Enter keyboard shortcut because if you do, you’re stuck with the No Style option. Also set the page number to 1. We should learn more about what our software can do for us so we can apply our hard work to things that really matter

Figure 4: Inserting a manual page break Next, format the page so that page numbers are lower-case Roman numerals: select the Page tab and select i, ii, ... from the Format drop-down list (as shown in figure 5). Also make sure that either your Header or Footer is on (depending on where your page numbers should be) by clicking on the appropriate tab and checking the relevant box. Type in your preface.

Changing page numbering style

25


Issue 16

Figure 5: Setting the preface page numbers When you’re done with the preface, it’s time to go back to Arabic numeral page numbering: force another page break with Insert→Manual Break, then Page Break, and be sure to change the Style to Default, and the page number to 1. Also set the page number format to 1, 2, 3, ....

Conclusion The computer can do so much for us if we only let it. I believe we work too hard at times, taking 20th or even 19th century habits into the 21st. We should learn more about what our software can do for us so we can apply our hard work to things that really matter.

Biography Daniel Escasa (/user/53" title="View user profile.): Daniel Escasa is a freelance writer and consultant with over 20 years employing what others might call â… oddball technologyâ… . He also dabbles in music and, lately, in theater. More of that, and other miscellany, at his blog (http://www.descasa.i.ph/).

Copyright information This article is made available under the â… Attribution-NonCommercial-Sharealikeâ… Creative Commons License 2.5 available from http://creativecommons.org/licenses/by-nc-sa/2.5/. In addition, I'd appreciate it if anyone reproducing this on their site let me know about it. Source URL: http://www.freesoftwaremagazine.com/articles/the_lazy_user_s_guide_to_openoffice_org_writer

26

Conclusion


Issue 16

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

Configuring a Linux home internet gateway How to justify to your spouse adding another Linux box to your home network By John Calcote PUBLISHED: 2007-03-05 My family is hooked on Windows. I’ve thought about trying to coerce them into switching to GNU/Linux, but the very thought of what I’d have to put up with for the next year just makes my head ache. I’m not talking about software maintenance issues. I’m talking about trying to defend my position time and time again as they complain that they can’t run their favorite games or applications. Telling them to change their favorites is like spitting into the wind—it’s sort of masochistic. I love Linux though, and so this opposition doesn’t stop me from wanting to setup a Linux machine at home. I upgrade my wife’s computer in the study about once every couple of years, and often my kids’ machines get a parts upgrade from the old machine at the same time. Recently, however, I found I had enough spare parts to put together an entire machine, so I took the opportunity to replace my LinkSys router with a custom Linux router. In this article, I’d like to describe this process because it was more difficult for me than it probably should have been—mostly for lack of clear instructions.

Internet packet routing basics Routers are to computer networks as local post offices are to the mail system. Your local post office accepts mail destined for your entire city or region in large bundles. Postal workers sort letters and packages in those bundles into smaller bundles by neighborhood. Post men and women deliver those smaller bundles to individual homes. At the same time, they pick up outgoing mail from mail boxes and deliver it back to the local post office where it’s sorted into large bundles destined for specific regions. These bundles are sent to regional distribution centers where they’re divided up into smaller bundles and forwarded to local post offices. The entire process starts over again. This system is very efficient, and works equally well with routers on the internet. Much like letters routed through local and regional post offices, at the lowest level, all internet traffic takes the form of data packets routed from one machine to another through local and central internet packet routers. Like letters and packages, each packet has a single source address and an ultimate destination address. Along the route from source to destination, packets also pick up intermediate router addresses. Router software uses complex algorithms that analyze final destination addresses to determine the next router on the shortest path from source to destination. Each router adds a new address to the packet, and then forwards it to the next router along the path. At the lowest level, all internet traffic takes the form of data packets routed from one machine to another Want to try an interesting experiment? Open a terminal window and type this command (you may need to change to super-user mode with the “su” command on some GNU/Linux distributions): $ traceroute www.freesoftwaremagazine.com

Internet packet routing basics

27


Issue 16 If you’re on a Windows machine you can type this command for a similar result: c:\> tracert www.freesoftwaremagazine.com

On my Linux box at home, the output looks something like this (I’ve removed the DNS names and the usual third try timing column to make it fit the column width): traceroute to 209.249.12.148, 30 hops, 40 bytes 1 66.119.135.193 11.132 ms 12.877 ms 2 66.119.143.201 12.666 ms 22.760 ms 3 66.119.143.254 35.802 ms 35.900 ms 4 66.119.143.250 43.826 ms 42.775 ms 5 66.119.132.129 43.261 ms 40.864 ms 6 64.213.22.185 54.872 ms 52.741 ms 7 67.17.67.154 62.346 ms 60.723 ms 8 64.125.12.85 66.086 ms 94.429 ms 9 64.125.30.169 63.305 ms 60.672 ms 10 64.125.30.178 82.155 ms 77.522 ms 11 64.125.29.46 99.565 ms 97.170 ms 12 64.125.29.190 92.608 ms 90.122 ms 13 64.125.28.69 114.682 ms 119.342 ms 14 64.125.28.130 126.578 ms 127.490 ms 15 209.249.9.126 124.585 ms 125.836 ms 16 209.249.12.148 122.755 ms 119.974 ms

The traceroute (or tracert) command causes each router in a complete path from source (your machine) to destination (the address you specified on the command line) to return a message to your machine, which is then interpreted and displayed. The millisecond values in the two columns following the router address are the round-trip timing values for each of two trips to that router. On Linux, a -n option will remove the DNS names, and a -q option allows you to specify a number of trips (the default is usually three). Using -q1, for instance will show only the DNS name, IP address and one round-trip timing value. The traceroute command makes use of a routing protocol referred to as ICMP, which is an acronym that stands for Internet Control Message Protocol. It’s interesting to note that ICMP doesn’t provide direct support for this sort of trace functionality. Years ago, inventive network programmers, in an attempt to create debugging tools for IP networks, made use of ICMP error responses to essentially trick routers into returning enough information to the sender to learn the path taken from the local host to the specified destination, as well as the round trip time required for each router to return the test message. This is the primary job of a router—to determine algorithmically the most efficient path to the final destination, and thus the next router or host in the path, and then address and forward data packets accordingly.

Firewalls, physical and ethereal When I was young, my father owned a shoe store in a small town in Iowa. One year, he moved down the street to a larger building and I was given the job of remodeling the old building in preparation for selling it. As I stripped the internal walls out from the building, I found that the brick and mortar walls that stood between my father’s old building and the buildings on either side were shared walls—the same wall was used by adjacent buildings. They were fairly thick—maybe 18 to 24 inches—but more interestingly, they rose well above the roofs of either building—about 2 to 4 feet higher. The building roofs were attached to beams set deep into the sides of these walls. I asked the old carpenter working with me why these buildings were built this way, rather than just having the roofs built on top of the walls. He told me about firewalls. A firewall is designed to protect the buildings on either side of a burning building. If a fire breaks out in a building, the fire can’t (without great difficultly) get past the firewall to the buildings on either side. The wall itself is thick enough to provide protection from structural damage that might otherwise be caused by the heat of the fire, and high enough above the roofs of the buildings on either side to keep the flames from jumping from roof to roof. Network firewalls protect individual hosts or private networks from internet users with malicious

28

Firewalls, physical and ethereal


Issue 16 intent Often routers closest to individual sending or receiving hosts provide additional functionality to protect local network resources from malicious attackers on the internet. It’s a statistical truth about humanity that the larger the group of people in a community, the more probable it is that someone will attempt to hurt or steal from others for selfish reasons. Since we can’t change the basic nature of humanity (at least not overnight), we have to protect the innocent, and that’s exactly the purpose of a network firewall. Like the literal firewalls between the store buildings in my home town, network firewalls protect individual hosts or private networks from internet users with malicious intent.

Public vs. private networks Back in the day, everyone had a piece of the internet pie, so to speak. What I mean is that in the early days of the internet, when there were few users and even fewer hosts, each host was assigned a public IP address on the internet. This meant that any host on the internet could connect with or send data to any other host on the internet. The trouble is there are too many computers on the internet today. Each computer—no each network interface card (NIC) in each computer—must have a unique IP address. An IP address is commonly displayed as a 4-part number, where each numeric part holds an 8-bit value—enough space to hold any decimal values between 0 and 255, and the parts are separated by periods: 66.123.55.63

Ultimately, however, this is just a format for display, and underneath the covers computers just treat these addresses as single 32-bit values. With just a little math, we can see that the hard limit on the number of available addresses is 2 to the 32nd power, or about 4 billion addresses. I called it the hard limit—the fact, however, is that the IP addressing scheme involves breaking this 32-bit value into ranges designed for various other uses such as broadcast, multi-cast and address ranges that are simply unusable because of the semantics of the scheme. Over the years, some additional infrastructure has been added to the original addressing scheme to allow address ranges to be allocated to large, medium and small governments, institutions and companies. To support this concept of address classes, a network mask specifies which bits of a 32-bit address are to be considered the network address, and which bits are to be seen as the host address within the specified network. IP addresses are commonly divided into three classes: A, B, and C. Class A addresses use only the first 8 bits as the network number, giving the owner 24-bits of node number to play with—that’s a LOT of nodes—2 to the 24th power nodes is around 16 million nodes. As a result, very few class A addresses exist today. Class B addresses use the first 16 bits as the network number and the last 16 bits as the node number. This still leaves about 65000 node addresses. Only the largest companies own class B addresses, and often they are inherited by companies during corporate acquisitions—they become a very valuable asset at the bargaining table. Class C addresses use the first 24 bits as the network number, and the last 8 bits as the node number. This leaves only 256 node addresses, which is fine for small companies, and middle-sized companies can often obtain several class C addresses to meet their needs, because there are theoretically about 16 million class C addresses, minus a few million whose ranges are reserved for class A and B addresses. Today, it’s quite common for Internet Service Providers (ISPs) to assign a class C address of say 45.119.145.37 to a customer, with a standard class C network mask of 255.255.255.0. This means exactly what you’d expect it to mean—that all 24 bits in the first three values of the address (45.119.145) specify the network number, while the last 8 bit value (37) indicates the host number within this network. Later, the Classless Inter-Domain Routing (CIDR) system was devised to allow network addresses and network masks to be specified in a single string value. The above network address and network mask would be displayed in CIDR format as: 45.119.145.37/24

Public vs. private networks

29


Issue 16 Again, this means exactly what you’d expect—that the first 24 bits of the address indicate the network number, and the remaining 8 bits represent the node number. Simple, huh? But all of this overhead means that there are actually far fewer addresses available for general public consumption than a raw 32-bit value might suggest, and the fact is that around 1998, as public consumption of internet addresses began to explode the world started to run dangerously low on 32-bit addresses. There have been several suggestions for how to solve this problem over the years. The first solution presented to the Internet Engineering Task Force (IETF) was a scheme where the entire addressing system for the internet was to be upgraded from 32 to 128 bits. This scheme is called IPv6, since it would be the 6th revision of the Internet Protocol to be designed and implemented (the currently implemented version is 4, sometimes called IPv4. Version 5 was an experiment that never really went anywhere). IPv6 was well designed and well implemented, but it’s been an uphill battle to get everyone to modify network software to work with an entirely new scheme—from the lowest framework components to the highest-level network-enabled applications. Network address translation expanded the usefulness of IPv4 well into the foreseeable future In the meantime, a new scheme was presented by hardware manufacturers. This scheme is called Network Address Translation or NAT. Using NAT, router appliance manufacturers like Cisco designed into their hardware the ability to translate internet addresses into private network addresses. The people who invented this scheme then requested from the Internet Assigned Numbers Authority (IANA) a single class B address (192.168.0.0/16) to be reserved for private networks. This scheme allows a single host (the router) to represent, with just one public IP address potentially hundreds of hosts within the private network. And all private networks could share the 192.168.0.0/16 class B address. Network address translation expanded the usefulness of IPv4 well into the foreseeable future.

So what’s that little blue box doing anyway? With all of this background behind you, you’re now ready to understand what that little blue LinkSys, D-Link or other brand box is doing between your internet connection and your home network. In fact, it’s just a special kind of network router, sometimes called a gateway, because it not only provides routing functionality, it also provides a firewall and network address translation capabilities. In addition, it often provides a small 4 or 8 port hub (sometimes called a concentrator or switch), as well as parallel or USB connections for your printers. Finally, these devices can also provide wireless network (WiFi) access. Wireless devices include palm-pilots and pocket PC’s, cell-phones, laptops, and even printers these days. It seems like everything has WiFi built in—even your son’s Nintendo DS has a built-in WiFi card so he can play with his friends over the internet from his pocket gaming device! Finally, these appliances also generally provide filtering software so you can filter certain traffic to or from certain nodes on your network. In my home, I have a single wired computer with access to the internet—the one in my study. The kids’ computers don’t have internet access. They can access shared files and printers on the home network, but they can’t access the internet. Let’s face it—there’s a lot of garbage on the internet, and I want to protect them from this stuff till they’re old enough to make those decisions for themselves. I’m sure I’m not the only one who feels this way. They can use the internet for school research, emailing their friends and even for fun, but only in the most public place in the house, where I can monitor things. Well, that’s a lot of potentially configurable stuff in a box with no switches or dials on it! How do you plug in your ISP provided network address, default gateway and domain name server (DNS) information? Why, these gateways even have a little web server built into them. You just connect your computer to one of its ethernet ports, open a browser and enter http://192.168.x.y (your product’s instructions will tell what values to use for ‘x’ and ‘y’) and presto! you’re looking at the firmware configuration pages for your router. What you really need is a router implemented entirely in software… Basically, these little appliances are sort of all-in-one devices. The problem is that while they may do almost everything, they don’t often do much of it really well—and sometimes the feature that’s missing or poorly implemented is the one you really wanted. They’re cheap enough (60 to US$100) that you can always go out

30

So what’s that little blue box doing anyway?


Issue 16 and buy a different one if your current device doesn’t do exactly what you want, but there are two problems with this approach. First, the software services they provide are generally not advertised in detail on the specification sheets, so you really don’t know what you’re getting till it’s too late. And second, none of these gateways offer everything you probably want, so it’s always a compromise in one way or another. What you really need is a router implemented entirely in software, so you can program it the way you want without the limitations inherent in an appliance. Interestingly, the LinkSys appliances actually run an embedded version of Linux internally. Because Linux and GNU/Linux are released under the General Public License (GPL) LinkSys must, by law, release the source code for their Linux based operating system to the public. And in fact, they do just this. You can go to the LinkSys website and download the entire source code for the modified embedded Linux system they install in their routers. LinkSys also provides complete (albeit a bit cryptic, unless you’re in the know) instructions for compiling this source code into a ROM image that you can then upload into your LinkSys router through it’s web interface. Since Linux provides excellent router software, other vendors have also followed a similar path for their appliances. Well, that’s one way of doing it, but let’s be honest here—you really have to know what you’re doing to program new features into your LinkSys router, and who has the time for this sort of activity anyway? Well, that’s the point of this article—to show you how to configure an old PC as a Linux router and firewall, so you can use the features of GNU/Linux to make your router and firewall do just what you want them to do—without a lot of programming.

Collecting the hardware First let me tell you what I had, and then I’ll tell you what I replaced it with. I had a LinkSys gateway with four 10/100 ethernet ports and a wide area network (WAN) port for connecting to my service provider—in this case, a broadband antenna on my roof. Your ISP connection might just as easily come from a cable modem connection provided by your local cable provider, or a DSL modem provided by the phone company. The first thing you need is an old PC. Any Intel Pentium-class machine running 500 MHz or better is good enough. I found that my Linux distro of choice (OpenSuSE) required at least 512M of RAM, as well—not to run, mind you (Linux can run in 32K of RAM), it’s the silly installation program that requires all the memory. The motherboard on my old PC had a built in 10/100 ethernet card—plenty of speed for my WAN connection. This card became my external interface—the card that I connect to the roof top antenna. One thing to be aware of is that your broadband, DSL or cable modem device may look and feel to the network more like a computer than a concentrator. The physical difference between computers and concentrators is in the way the ports on these devices are wired. The 8-wire port used by ethernet is technically called an RJ-45 connector. There are two ethernet RJ-45 connector wiring standards in the US, commonly called types A and B. Type A is used by AT&T, and Type B is widely used by everyone else. These wiring standards are logical inverses of each other. That is to say, the transmit wires on one standard are the receive wires on the other. A type A device must be connected to a type B device in order for communication to happen properly—you can tell if you’ve connected two type A devices to each other if the green signal LED on the back of the ethernet card doesn’t light up. The orange transmit LED may blink if the computer is attempting to send on that card, but if the green LED is off, it’s a sure sign that the connection is incorrect. Ethernet cables are wired straight through, such that each wire in the cable is connected to the same pin number on either end. This is sometimes called a straight or normal cable. Cables can also be wired such that one end is type A and the other end is type B. These are called “cross-over” cables, because they allow two devices of the same type to be connected directly together. If your broadband antenna, DSL or cable modem looks like a type A device (NIC) then you’ll need a cross-over cable to connect it to your Linux router’s WAN port. The simplest procedure is to just have a cross-over cable on hand as you hook up your new router, and pay attention to the green lights on the NICs. Swap cables as necessary to make everything work. Most newer concentrators today are auto-sensing devices, which means you can plug either type A or type B devices into a concentrator port, and it’ll just figure out which standard you’re using. This feature allows you to cascade concentrators in order to expand the number of ports you have on your network without requiring a cross-over cable. Many older computers, NICs and concentrators, however, really do care which one you use.

Collecting the hardware

31


Issue 16 Older concentrators are wired as a type B connection, while older NICs (including those often built into motherboards) are of type A. A router requires at least two network cards to be an effective firewall, so I bought another NIC. The network card in my main home computer is actually 1000Base-T—a gigabit card. Since I needed a new concentrator anyway (recall that my previous concentrator was built in to the LinkSys box) I now had an excuse to upgrade my home network from 100Base-T to 1000Base-T. Okay, I admit, I was just dreaming here. How often am I really going to need that kind of speed between any two of the three wired computers in my house? WiFi machines like my laptop don’t count—remember, they’re limited by the WiFi link speed, which is much slower—even by the fastest WiFi standards today. The fact is, I like to play, and hardware is fairly cheap these days. But if you have access to some free or almost free 10/100 equipment, you might want to stick with a 100Base-T concentrator. You can get concentrators in 4, 8, 12, 16, or 24 port configurations. Four port routers are good enough for most home networks, but if you’ve wired your home the way I did with a port in every room, or if you’re setting up a small business network, you might want to consider at least an 8 port device just so you don’t have to swap wires when you decided to use a wall outlet you haven’t used for a while. I bought a NetGear 8-port 1000Base-T ethernet concentrator (US$69.00 at Amazon) and a NetGear 1000Base-T NIC (US$25.00 at Amazon)for the internal card in my Linux router. I also still needed WiFi in my home. I bought a NetGear WiFi antenna (US$110.00 at Amazon—you can get these for a lot less, but I had had WiFi “dead spots” in my house, and wanted to make sure a new unit would not have this trouble) that plugs into any slot in my concentrator. As an option, you can always buy a concentrator with WiFi built in. I chose to buy them separately because I like to be able to replace or upgrade things now and then, and I didn’t want to have to spend a lot on each upgrade to get all of the features of an all-in-one device. Besides, buying separate components allows me to place my WiFi antenna in a more central location in my house, rather than in the wiring closet in the basement where the router and concentrator are located.

Figure 1: Ethernet card MAC address label You might want to write down the ethernet MAC address from your network cards before installing them. You can usually find this number printed on a sticker on the card itself, as shown in figure 1. The generally accepted canonical format of this ethernet MAC address would be: 00:08:B5:B3:23:44

Hardware manufacturers tend to string the entire value together and remove any leading zeros. The reason for this is that the colon-delimited format is a nicety designed for human readability and data entry. As far as the hardware is concerned, it’s just one long number. It becomes much more apparent why you want to make a note of the MAC address if you have two cards of the same make installed in your router. You won’t be able to tell them apart in the network device configuration dialog except for the MAC address. With one of them known, you’ll at least be able to determine which card is which. Even when the cards are significantly different externally, they might still use the same chip-set, and thus the same driver. The driver name and MAC address is what you’ll see in the dialog, not the brand or manufacturer name.

32

Collecting the hardware


Issue 16

Configuring the system I installed Linux in the usual way. Make sure you add the “networking” category of packages to your software choices during installation. You’ll need a good chunk of the features in these packages, and you’ll want some of the others, such as the DHCP server. After initial installation, you can configure services through the SuSE Linux configuration system—YaST. (Don’t ask me what that stands for—I’d guess “Yet Another…” something.) Fedora has its own methods, but all distributions use the network device configuration dialog paradigm. While our distributions of choice might be different, the concepts will be the same. Figure 2 shows the YaST main dialog with the Network Devices option highlighted.

Figure 2: OpenSuSE YaST Network Devices panel Both network cards were automatically detected and drivers for these cards were installed during the installation process. However, the way Linux detects hardware at each boot of the system, you could just as well install the operating system before installing the second network card. All detected network cards show up as either configured or not configured in the network device configuration dialog (see figure 3).

Figure 3: OpenSuSE YaST Network Devices configuration dialog OpenSuSE has a nice firewall package called SuSE Firewall. The firewall configuration option is found in OpenSuSE under the heading of security—not network services. The security option is shown in figure 4. Configuring a firewall is not as difficult as it may seem at first. Firewall software classifies each accessible segment of a network according to potential threat. Most firewalls have at least two classes: “Internal”—meaning trusted, and “External”, meaning untrusted.

Configuring the system

33


Issue 16

Figure 4: OpenSuSE YaST Security Services and Users configuration dialog A common third classification is referred to as “Demilitarized”, which is often used by gamers to get around common game connectivity issues caused by firewall security. Properly setting up a demilitarized zone generally requires a third network card in the router. Devices in the demilitarized zone (DMZ) exist outside of the firewall, and are thus unprotected. Nothing of value should be kept on these machines, as external users with malicious intent will be able to get into them with ease. Multiple machines can be installed into the demilitarized zone by connecting a multi-port concentrator to the router’s DMZ NIC. Figure 5 shows the firewall configuration dialog with the interface configuration option selected. Configure the card connected to your external ISP connection as “external”. Initially, all inbound connection attempts will be stopped, keeping malicious attackers from gaining access to your network resources. Configure the card connected to your internal network concentrator as “internal”. This will allow computers on your home network to communicate freely with external public services. They can communicate freely with each other as well, but this is because they are connected to one another directly through the internal concentrator, and not because of any particular router configuration.

Figure 5: OpenSuSE YaST Firewall Interfaces configuration dialog While you’ve got this dialog open, select the “Masquerading” option from the option tree on the left. This will modify the dialog to look like the one in figure 6. Masquerading is a term used by GNU/Linux that refers to network address translation. Recall that this is the feature that allows the computers on your internal network to have private IP addresses on the reserved class B 192.168.0.0/16 network. You will want to enable masquerading so you don’t have to pay your ISP for multiple external addresses.

34

Configuring the system


Issue 16

Figure 6: OpenSuSE YaST Firewall Masquerading (NAT) option configuration dialog Figure 7 shows the YaST Network Services configuration panel. From here you’ll choose the “Router” option to configure the machine as a router. This produces a dialog similar to that shown in figure 8. The router configuration dialog allows you to specify your default gateway—this is the public IP address of another router on the external network, and is supplied by your ISP. Often, the last part of this IP address will be 1 or 254, though this is not a hard and fast rule. If your ISP insists that you use a DHCP provided public address, then the default gateway will be provided through DHCP, as well.

Figure 7: OpenSuSE YaST Network Services panel The router configuration dialog also allows you to specify one other significant item: IP Forwarding. IP Forwarding should be enabled because your machine is in fact a router. You want to allow packets to be forwarded from one network interface card to another within your machine (subject to the firewall rules, of course).

Configuring the system

35


Issue 16 Figure 8: OpenSuSE YaST Router configuration dialog Configure your external network card with the IP address, network mask and default gateway provided to you by your ISP, as shown in figure 9. Your ISP will also provide you with two or three DNS server addresses. Make sure you configure these DNS addresses here as well by clicking on the “Hostname and Name Server” button under “Detailed Settings”. This will open a sub-dialog like that shown in figure 10.

Figure 9: OpenSuSE YaST Network Address Setup dialog You may need to configure the external card to use dynamic host configuration protocol (DHCP) on your provider’s network. This works just as well, but will disable your ability to configure public services on your router. I’ll cover these in more detail later. For now, just be aware that there are two ways to configure your public network card, dynamically using DHCP, or statically with a public or private IP address given to you by your ISP. Generally, when you are using DHCP, you will not have to configure DNS server addresses, as DNS server addresses can also be configured through DHCP.

Figure 10: OpenSuSE YaST Hostname and Name Server dialog Configure your internal network card with a static private address. I used 192.168.2.1, but any pair of values will do after the 192.168 portion. Whatever the third, or subnet value (1, 2, 10, 15, etc), I like to use 1 or 254 as the last value so I can remember it easily. (Why 254 and not 255—the last valid 8-bit value? Zero and 255 are reserved for special purposes in IP networks. Zero can’t be used because it confuses router software looking for CIDR specifications and network masks—it actually works sometimes, but it’s not worth the trouble of debugging the problem when it doesn’t work. The value 255 is reserved for broadcast address values.) You might also want to configure a DHCP server at this time, and set it up to hand out additional private addresses to the machines on your internal network. Configuring a DHCP server is not always the smooth process that it probably should be, so just be aware that you don’t need to do this. You can configure each machine on your private network with static IP addresses also. Since my LinkSys gateway provided this feature for me, and I was trying to duplicate this functionality, I added a DHCP server, but you may want to

36

Configuring the system


Issue 16 do things differently. By setting up remote administration, you will be able to disconnect the keyboard, mouse and monitor from your router once you have it configured the way you like Now would also be a good time to configure remote desktop administration on your router. Modern GNU/Linux remote administration is implemented with VNC (Virtual Network Computing), which allows you to open a window on another machine that contains a virtual desktop for your router. By setting up remote administration, you will be able to disconnect the keyboard, mouse and monitor from your router once you have it configured the way you like. You can just put the box in the wiring closet or basement and forget about it. Later, when you want to change configuration options on your router, just connect to it using VNC and it’s like you’re sitting in front of it. Remote administration is found under “Network Services” category in OpenSuSE YAST. Basically, you just need to turn it on. If you’re using Windows on the machine you’ll be using to access your router’s VNC desktop, then you’ll need to download a VNC client for Windows. The Real VNC free package is as good as or better than any I’ve found, and is written by the folks who invented the VNC protocol.

Filtering The discussion of DHCP brings us to the last feature of my LinkSys gateway that I wanted to emulate—filtering. I don’t mean web content filtering as much as internet access filtering, although content filtering packages are available for installation on a Linux box, and this is one possible way to allow the kids access to the web, without worrying too much about what they see. I still worry however, even with content filtering because I know how content filters work—they’re either too restrictive, making the web experience frustrating at best, or they’re too loose, which is worse than useless because it provides users with a false sense of security, and they become cavalier about what they enter into search dialogs. But back to access filtering. The primary reason I wanted to use Linux as my gateway was because my LinkSys box allows me to turn on or off the ability for specified computers to access the internet through my router—either all the time or during specified time periods. It even allows me to block certain sites. But it doesn’t allow me to deny all access except certain sites. As I mentioned earlier, my kids’ machines are Windows machines. Windows tends to die slowly if constant downloadable updates are not applied to the operating system. Basically, I would like to grant access to microsoft.com for system updates, and to apple.com for my kid’s iTunes programs, but then deny access to everything else. With GNU/Linux as your router, this sort of thing can be done. It’s fairly complicated, and can’t generally be done with graphical tools from the desktop, so I’ll leave it as an exercise for you to figure out machine-specific filtering by IP address or domain. Here’s a hint—checkout the iptables package, which is the standard Linux 2.6 kernel IP filtering package. It’s very powerful, and is used internally for many reasons by both Linux kernel and user-space programs. The iptables filtering package can be configured to filter internet access through the router based on the machine’s hardware MAC address, so you can still use DHCP to assign IP addresses dynamically, while ensuring that your kids’ machines don’t end up with too much internet freedom.

Adding services to a publicly visible router If your ISP is kind enough to give you a publicly visible external static IP address, then you can really begin to play with your router. I setup a mail server on my router. This allows me to use my own registered domain in my email address at home. For instance, if your name is Fred Saberhagan, you might acquire the saberhagan.com domain (often you can buy this service from your ISP for a minimal fee, but if not, then go to http://www.whois.com for more information on purchasing a domain name). Then your email address could be fred@saberhagan.com. Another benefit of a publicly visible IP address is a web server. If you would like to administrate your own web server, you can enable Apache2 on your GNU/Linux router. Don’t forget, that your firewall is blocking nearly all inbound connections through the external network card on your router. You’ll have to go back into your firewall configuration dialog, and specifically add “smtp” for your mail server to the list of allowed connection types (smtp—simple mail transfer protocol—is actually a Unix service name, that implies a

Adding services to a publicly visible router

37


Issue 16 particular port number, in this case 25—the standard port number for email servers using the smtp protocol). Opening a port in a firewall need not be viewed with fear if you understand the potential dangers You can also add “http” and “https” for your web server. But be careful, the more ports you open up, the more vulnerable to attack you make yourself. Don’t take this to mean that you shouldn’t open these ports. They provide access to the services you want to make available to the public. Opening a port in a firewall need not be viewed with fear if you understand the potential dangers. If you want to provide a public service such as a web server, the idea is to find out how web servers can be attacked and protect yourself with proper access control management, not to fear it like you might fear some unknown virus strain. Every public web server on the internet has the potential to be hacked. But the owners of (most of) these sites are well aware of what attackers can do to their web site, and they’ve configured security for their site such that they are comfortable with the risk level. The Apache manual will help you out with the security learning curve. Another service that can be opened in your firewall is remote desktop management—you can get at your VNC connection from an external site also. This is a bit more risky, and so you should only do it if you really need to. Furthermore, VNC is fairly bandwidth intensive, and you may find the experience a bit slow from outside your fast home network. For my part, I use SSH (Secure SHell) to access my router remotely, but you will need to become very familiar with the GNU/Linux command line in order to appreciate this form of access.

Summary This is a lot of stuff to remember, and I had to discover it all the hard way—one Google search at a time. You can keep this article around as a quick reference guide. If nothing else, at least it gives you a list of topics, a set of keywords, and a starting point for each critical feature on your router. Like all fairly complex software configuration procedures, the devil, as they say, is in the details, and you’ll likely have your share of issues specific to the hardware and GNU/Linux distribution you’ve chosen, but at least you’ll have the advantage of knowing the direction you should face when you fire your guns.

Biography John Calcote (/user/28810" title="View user profile.): John Calcote has worked in the software industry for over 25 years, the last 17 of which were at Novell. He's currently a Sr. Software Engineer with the LDS Church working on open source projects. He's the project maintainer of the openslp project, the openxdas project, and the dnx project on sourceforge.net. He blogs on open source, programming and software engineering issues in general at http://jcalcote.wordpress.com.

Copyright information Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. Source URL: http://www.freesoftwaremagazine.com/articles/home_internet_gateway

38

Summary


Issue 16

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

Managing your iPod without iTunes Using free software to unlock your iPod's potential By Jon Peck PUBLISHED: 2007-02-26 While iTunes is a powerful application, it does have its limitations, mostly stemming from both Digital Rights Management (DRM) restrictions and the Recording Industry Association of America’s (RIAA) interest in preventing unauthorized copying of music, regardless of fair use and personal flexibility. The free software community believes that the ability to freely copy content you own between your iPod and a computer is a right, not a privilege. In this article, I’ll discuss how to fully manage the content on your iPod using completely free software. The free software community believes that the ability to freely copy content you own between your iPod and a computer is a right, not a privilege Other than purchasing content, what other base functionality of iTunes is commonly used? Copying content to your iPod, maintaining playlists, and subscribing to podcasts. If we’re switching applications, we don’t want to lose any basic functionality! I used a FAT formatted fourth generation 20 GB iPod Version 3.1.1 for testing, so I can’t attest to video functionality. I used Ubuntu 6.10 x86 for my test system, so any installation notes will apply to that context. By default, Ubuntu comes with Rhythmbox, which didn’t work properly with my iPod, so I just removed it.

iPod Managers There are three applications for managing the contents your iPod that rise to the top: gtkpod, Banshee, and Amarok. While gtkpod is primarily just an interface to the iPod, Banshee and Amarok are fully functional audio players. I’ll concentrate on iPod management rather than a full review of all their features.

gtkpod • Homepage: http://www.gtkpod.org/ • Version: v0.99.8 (09/24/2006) • Platform: All (GTK2) • License: GNU GPL v2

iPod Managers

39


Issue 16

gtkpod—Cross-platform iPod interface with a smart playlist editor gtkpod is a cross-platform interface for the iPod, with support for all iPods through the 5G and iTunes mobile phones. It features a smart playlist editor. I had no issues with the installation; no configuration was needed, and the iPod showed up correctly. The main view displays a comprehensive, sortable playlist editor. To use, you click the Read button to read the iPod’s iTunesDB, make your changes, then Sync. If you choose, you can also sync specific files, directories, or playlists. Copying music from the iPod to your computer is as simple as right-clicking and selecting “Copy Tracks to Filesystem”. The resulting files were nicely named based on the tags. I copied files by simply dragging and dropping the folder onto the gtkpod window. When I ejected the iPod and checked my changes, everything was there without corruption, and the newly copied files and playlists worked without issue. By default, gtkpod offers playback of files using XMMS. You can change the command under Preferences→Tools→Play. gtkpod also comes with a few system utilities. You can also normalize the volume level of your audio files, but as I trust the engineers and producers to set their levels appropriately (let’s not get into compression, that’s a rant unto itself), I wouldn’t recommend it for normal use. I tried it, and it seemed to work. Other useful utilities include a scan for orphaned and dangling files and a quick overview of disk utilization. Overall, I really like this utility because of its logical interface, ease of use, and lack of bloat.

Amarok • Homepage: http://amarok.kde.org/ • Version: 1.4.4 (10/30/2006) • Platform: GNU/Linux, Unix • License: GNU GPL

40

gtkpod


Issue 16 Amarok—GNU/Linux audio player with support for many audio devices Amarok is a GNU/Linux audio player. While developed initially for KDE, it’s currently desktop independent. One of its advantages is support for many audio devices, including iPod, iRiver, etc. Upon the first run, you’re given the opportunity to set up your library. Unfortunately, out of the box on Ubuntu 6.10, the iPod wasn’t detected, but a quick configuration change made all the difference: Settings→Configure Amarok→Media Device→Add Device→Plugin (Apple iPod), name (iPod), and mount point (/media/ipod). One of [Amarok’s] advantages is support for many audio devices, including iPod, iRiver… Copying music from the iPod is as simple as right-clicking and selecting Manage Files→Copy Track to Collection. As it adds files to Amarok’s library, the file is neatly named and placed in an appropriate folder (you’re given the option of which folder naming scheme you’d like). Copying to the iPod from your collection is similarly easy: right-click, Transfer to Media Device, select the Media Device and click Transfer. Amarok automatically checks for duplicate tracks, which is nice. The album cover function works quite nicely, fetching the image from Amazon or another external source. Playlists also work quite well. Overall, Amarok is a strong tool, and definitely worth considering if you’re looking for both iPod and Library management.

Banshee • Homepage: http://banshee-project.org/ • Version: 0.11.3 (12/09/2006) • Platform: GNU/Linux (GTK) • License: MIT

Banshee—GNU/Linux audio player that should work with iPods… but doesn’t live up to the task Banshee is an audio player for Gnome that has the ability to synchronize music with iPods. It’s more of a media manager, similar to iTunes. When first run, Banshee asks you to set up your Music Library. When I reached the main window, the iPod showed up automatically and no additional configuration was required. However, my iPod playlists didn’t show up… not the end of the world, but not good either. I copied tracks from the iPod by dragging them from the Banshee interface onto the desktop. However, the resulting file name was a bit wacky—Banshee just copied it directly from the iPod without renaming it based on the internal tags. Copying tracks from the Music Library to the iPod was similarly flawed; I dragged a single track, then the whole album, and ended up with a duplicate. When I synchronized, I lost an entire album that had been on the iPod that I hadn’t been working with! I suppose that the program tried to warn me: “Actions will alter or erase existing iPod contents and may cause incompatibility with iTunes!”. Fortunately, the duplicated track seemed to be intact.

Amarok

41


Issue 16 I ejected the iPod and surveyed the damage. The duplicate was there, and my album really had gone missing. There’s an iTunes Music Store plugin, which allows you to purchase music from the iTunes store. After the disappearing album, I opted not to try it. I removed Banshee and reinstalled gtkpod to try to fix things. I got a warning and a notice. The notice told me that a duplicate track had been detected and removed (good!). The warning was a bit more disturbing; “iTunesDB… does not match checksum in… iTunesDB.ext … gtkpod will try to match the information using MD5 checksums. This may take a long time”. The operation seemed to go quickly enough. Then I tried syncing; gtkpod failed to write to the artwork database, so now that was corrupted too. Also, when I checked the iPod files, it reported dozens of dangling tracks which it recommended for removal; when I did, I was left with only one song on the entire iPod. Good thing I prepared for this by backing everything up. While Banshee may be a good media manager, based on my experience, I can’t recommend it at all for managing your iPod.

Podcasts Podcasts… are actually just syndicated media files… you don’t need iTunes to retrieve [podcasts] Podcasts, while on the surface are a mysterious and trendy Web 2.0 creature, are actually just syndicated media files. While Apple has embraced podcasts and treats them like it was their idea, you don’t need iTunes to retrieve the content of a podcast; you can use any news reader. However, there is additional functionality to be gained by using an application specific to handling feeds. An aggregator is client software that monitors subscribed web feeds and downloads any new content. Here are just a few of the many podcatching clients.

Juice • Homepage: http://juicereceiver.sourceforge.net • Version: 2.2 • Platform: Windows, Mac OS, GNU/Linux (fork) • License: GNU GPL

Juice—The first and most common cross-platform podcatcher Juice (formerly iPodder) is the most common cross-platform podcast aggregator, and also considered the first. Currently, there’s no GNU/Linux version; their homepage recommends the iPodder fork PodNova instead. On first run, Juice had two default podcasts already subscribed (Adam Curry and news about Juice), but they can be removed. Overall, I found Juice very logical and easy to use; just add a feed and check for files. The downloaded files are neatly organized in the destination folder, ready to be transferred to your portable media device. You can leave Juice running in the background to continuously keep your subscriptions up to date.

42

Podcasts


Issue 16 If you’re using either Windows or Mac OS, I’d strongly suggest giving Juice a try; when in Windows, I used it on a regular basis.

gPodder • Homepage: http://perli.net/projekte/gpodder/ • Version: 0.8.0 (07/28/2006) • Platform: GNU/Linux • License: GNU GPL

gPodder—Copies podcasts directly to your iPod gPodder has the advantage of being able to copy podcasts directly to your iPod. You subscribe to podcast feeds using gPodder’s “channels”: simply paste the feed URL, select the content you’d like to download, and press the download button. By default, they’re added to the podcast playlist, so they’re considered actual podcasts by the iPod! An excellent feature that allows you to use the iPod’s full podcast functionality, such as remembering where you were. Under the Podcasts menu, you can both Sync to iPod and clean up iPod podcasts. On the downside, for each downloaded file, the artist field is overwritten with “gPodder podcast”, and it doesn’t look like that can be reconfigured. Overall, gPodder is an excellent program for managing your podcasts; it’s lightweight and clean, which I prefer.

BashPodder • Homepage: http://linc.homeunix.org:8080/scripts/bashpodder/ • Version: 1.2 (09/14/2006) • Platform: All (requires bash, wget and sed) • License: GNU GPL BashPodder brings the base functionality of an aggregator down to its barest essentials—just tell it what feed you want it to check and which directory to put the downloaded content in. Using the K.I.S.S. principle (Keep It Simple, Stupid), BashPodder consists of just three files: a crontab friendly script, an XML stylesheet, and a text list of feeds. There is a GUI available, but that kind of defeats the purpose of such a minimalistic approach. I like this no-nonsense approach: just paste the source URL into the feed list and the next time the script is executed, the feed will be checked and new content acquired.

Other iPod Managers There are other “free” iPod managers, some cross platform, others platform specific. Development on the plugin foo_pod for the audio player foobar2000 (closed source with a BSD API) has ended with feature

Other iPod Managers

43


Issue 16 completion for the 4G and no current plans for anything above. There’s a plugin for Winamp, which is being overshadowed by the recent inclusion of official internal iPod support. EphPod is closed source, and while it seems to work well for anything under a 4G, it hasn’t been updated in years. The manager Media Monkey comes in two flavors: a no-cost no-nags version, and a commercial version with additional functionality. However, it lacks essential features like duplicate checking. Visit the Wikipedia article Comparison of iPod Managers for a good roundup and comparison of these other utilities.

Firmware Replacement There’s another more drastic direction that you can take: replacing the iPod’s operating system. While not for the faint of heart (you run an extremely slim chance of bricking your player), you can completely unlock the potential of your iPod using free software. Replacing the iPod’s operating system can completely unlock the potential of your iPod

iPodLinux • Homepage: http://ipodlinux.org/ • License: GNU GPL iPodLinux is custom uClinux kernel with an interface named podzilla. Dozens of applications in the form of modules have been written to add functionality and value, including utilities like text keypads and screen locks, and games like chess and tetris. Using the Music Player Daemon (MPD), it supports MP3, FLAC, Ogg Vorbis, and AAC files. It’s under a state of constant development, but in my opinion it’s not a mature, stable application yet.

Rockbox • Homepage: http://www.rockbox.org/ • License: GNU GPL v2 Rockbox is a free and mature operating system/firmware replacement, and it’s not limited to just iPods—Archos, iriver, and iAudio devices are also supported. It plays back many formats, including MPEG audio, Ogg Vorbis, Musepack, AAC, AC3, FLAC, WavPack, Shorten, Apple Lossless, and WAV. It comes bundled with many applications and games, including Brickmania, Chess, Doom, Snake, Space Invaders, Game Boy emulation, and much more. The last time I was on a business trip, my flight was delayed, but the Rockbox applications helped time pass by much faster. Best of all, Rockbox has an excellent implementation of gapless playback built in by default. Neither iPodLinux nor Rockbox have official stand-alone installers, but if you follow their simple step-by-step instructions, you’ll be fine. Overall, because of its maturity, functionality, and support, I prefer Rockbox over both the official iPod firmware and iPodLinux.

Conclusion I currently use gtkpod when managing my iTunesDB, gPodder for subscriptions, and Rockbox when I want to completely liberate my iPod. Fortunately, there are many free tools and options for iPod management, so you should now be able to find your own balance between the functionality you crave and the interface you prefer.

Biography Jon Peck (/user/28223" title="View user profile.): Jon Peck is a Zend PHP 4 & 5 Certified Engineer and Staff Developer / System Administrator for ProZ.com. He writes a blog about technology and web programming at jonpeck.blogspot.com (http://jonpeck.blogspot.com).

44

Conclusion


Issue 16

Copyright information This article is made available under the "Attribution-NonCommercial" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by-nc/3.0/. Source URL: http://www.freesoftwaremagazine.com/articles/managing_your_ipod_without_itunes

Conclusion

45


Issue 16

46

Conclusion


Issue 16

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

Vega Strike My kind of fun By Alan Berg PUBLISHED: 2007-02-14 If you are tired of a purely blast or be blasted space fighter simulators, if you like making virtual money and a strong story line—and, yes okay, fighting your way from A to B in large virtual universes—then Vega Strike or one of its mods may be just the free software game for you. As Napoleon the 17th, I must admit that [Vega Strike](http://Vega Strike.sourceforge.net/) is based within a 3D universe similar to our own, but in a thousand or so years. I should know I was there! Jump drives exist and so too the familiar smell of politics, economics and tribal warring alliances. You may trade and upgrade your ships and fly and fight through a graphically rich environment. Missions are available and the story line does not have to be linear. Better still, this OpenGL application has extra flavors such as a Privateer universe and a Star Trek universe to explore. This OpenGL application has extra flavors such as a Privateer universe and a Star Trek universe to explore Politics is fun to follow from a distance, especially when you crank up the game and see a random start up poster subliminally filling your mind with random proganda to support one view point or another.

Figure 1: Have you the right mindset? And this is where I admit to my motivation for writing about Vega Strike. When I was younger, clever, and able to jump tall buildings, I always wanted a BBC computer. My long forgotten friend George had one of those exquisitely designed computers all to himself and he was always rubbing my face into my inferior and cheaper choice of the ZX81. Anyway, the BBC computer was arguably the best from its generation, a bit like comparing the style and grace of a modern Apple with the mediocre grey of a standard office PC. To cut a long story short, George insistently played Elite and I never had enough online time. Well, thank the stars for Vega Strike, which has similar characteristics to Elite. Finally, I can, at last, out bid George and waste my days away.

Vega Strike

47


Issue 16 Vega Strike has similar characteristics to Elite Now that the positive atmosphere is set, I’ll quickly show you how to install the game and we can dive into its immersive and addictive aspects.

Installing on Fedora Core 5 Installing Vega Strike is straight forward, but requires (at the time of writing) a direct download from the homepage of the project. As a system admin, you will need to update permissions so that the binary becomes executable, e.g. chmod 700 and then execute. As shown in figure 2, a screen will pop up and then you will need to decide if you want to accept the default settings. Being of a lazy nature, the default settings looked good to me, so I just agreed without resistance or careful thought.

Figure 2: Installation tab for Vega Strike Next, I ran vsinstall and a dialog appeared. After choosing your local machine’s optimum values, save and then run vegastrike from the command line.

Installing on Ubuntu The simplest point and click approach for Ubuntu (I’m using version 6.06 Dapper Drake) is to use the Add Applications feature, which you activate via the Applications→Add Applications option that by default sits at the top left hand corner of your desktop. Select Add/Remove application and you will see a basic dialog as shown in figure 3. Tick Vega strike from the games pane and apply. The package manager then asks you for an administrative password, then downloads, and automatically installs. Note you should now find a new Vega Strike menu option set under games. The whole effort from start to finish depends on your Internet bandwidth, but for me this was less than three minutes, not bad for such an excellent and free to use game. (Note: in older versions of Ubuntu the Add Applications feature is not quite as advanced as in Dapper Drake. If you have an earlier version you can either refer to Simple package management with Synaptic by Marco Marongiu or read on and use the command line.)

48

My kind of fun


Issue 16

Figure 3: The Synaptic Package Manager If you like the control of the command line then apt-get is a valid tool for package installation under Ubuntu. To update the packages available you should run: sudo apt-get update

Next you will need to search for the relevant packages: sudo apt-cache search vegastrike

And finally install: sudo apt-get install vegastrike

Yes, there is a Debian package for Vega Strike, but no RPM. This may be because I don’t have a required YUM repository or more likely it might be a difference in distribution details.

A super fast tour of the software I found Vega Strike to be a sensitive package with regard to my graphics cards. On the Fedora Core 5 distribution, with a graphics card built into the motherboard, the game was more than a bit sluggish. However, for my older and obviously wiser Radeon 9000 card, the game was spectacular fun. As is true for many compelling games a little bit of reading is required before properly starting the game. I found the basic tutorial gave the necessary momentum to get going. Therefore, unless you want to be very disappointed, read the tutorial for the prerequisite five minutes first. Okay then, perhaps ten minutes and a cup of coffee. I found Vega Strike to be a sensitive package with regard to my graphics card When you start the game for the first time I would recommend launching your spacecraft and setting out for a planet as explained in the tutorial. Note: “Shift + M” brings up the help box that details the basic key combinations. Once in the spacecraft after pressing “Shift + M” again you may cycle though the targets via the ‘T’ keystroke. After choosing the target you wish, press ‘A’ for autopilot. You will then have the so-called “SPEC” drive engaged. Pressing “Tab” fires the after burners and, when used in combination with the SPEC drive, it’ll get you places fast. The arrow keys maneuver the craft and the F1 to F8 keys allow you to view the situation from different camera angles. To dock get close to your target, announce your presence with keystroke ‘0’ and then dock with ‘D’. The more you play, the easier the game becomes. You can trade, go on missions, update your spacecraft, and so forth. The better the ship, and the longer you play, the more dangerous your enemies become. That’s the fun part.

Hints and first impressions If you have an ecologically friendly printer, I would consider printing out the manual from pages 63-80. For the first twenty minutes of your virtual life follow the tutorial instructions and become one with your secret

Hints and first impressions

49


Issue 16 evil self. Once you have navigated to the mining base and docked (figure 4). You are probably ready to go out and modify your own complex destiny. After playing the game for a couple of hours I relearned a childhood lesson, I really enjoy making large amounts of money and upgrading ships. The only minor downside was that the game occasionally froze for a good few seconds, though probably the issue was more to do with the status of my aged and senile computer as opposed to inherent issues in the software itself. Thus, once you have succeeded in a mission, remember to save your games.

Figure 4: Docking for the first time. I look forward to the next version of this product and hope that the development community is still active as the game has great potential to become a classic. The current release is version 0.43. I wonder what version 1.0 will look like. In conclusion, I can now hold my head in pride. The era of the ZX81 inferiority complex is over thanks to relaxing hours spent with the excellent OpenGL application Vega Strike.

Biography Alan Berg (/user/8" title="View user profile.): Alan Berg Bsc. MSc. PGCE, has been a lead developer at the Central Computer Services at the University of Amsterdam for the last eight years. In his spare time, he writes computer articles. He has a degree, two masters and a teaching qualification. In previous incarnations, he was a technical writer, an Internet/Linux course writer, and a science teacher. He likes to get his hands dirty with the building and gluing of systems. He remains agile by playing computer games with his kids who (sadly) consistently beat him physically, mentally and morally. You may contact him at reply.to.berg At chello.nl

Copyright information This article is made available under the "Attribution" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by/3.0/. Source URL: http://www.freesoftwaremagazine.com/articles/vegastrike

50

Hints and first impressions


Issue 16

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

Using Metalinks Simplifying the download process By Anthony L. Bryan PUBLISHED: 2006-03-07 Downloads can be much faster, more efficient, and simplified by using Metalinks, a new system which automates segmented downloading and checksum verification.

What is Metalink? Metalink is an XML format for downloads that lists mirrors, Peer-to-peer (P2P) links, and checksums. Metalink was designed to make typically advanced downloading features easier for everyone to use. Previously, gathering mirrors and manually adding them to download managers was time consuming and frustrating. Having access to more mirrors increases reliability, and speed, as multiple mirrors can be downloaded from at once. Using P2P lessens bandwidth costs for distributors such as OpenOffice.org and mirrors. Unfortunately, P2P can not be used in all situations because it is sometimes blocked (by offices, universities, and ISPs), so it is helpful to have regular mirrors to fall back on in these cases. I have a cable internet connection with a max download speed of 800k a second. Most of my download speeds are around 200k/sec though. Why? One server is feeding many people, and that’s all it can serve up. But, it’s still pretty fast, and fine for most downloads. There’s not much difference with waiting 1 minute or 4 minutes. If you want to get something bigger though, you start to notice the difference. Instead of taking 14 minutes to download an ISO, it can take 2 hours or longer. You don’t really know how fast or reliable a server is until you start downloading from it. Using a download manager, you can download a segment of each file from multiple servers at the same time. The segments are then added together when they have all finished. This lets you fully use your maximum download speed. (Download managers have other features like pausing and resuming downloads which are also helpful). Take a look at this page (figure 1). Similar to many download pages, it lists a bunch of mirrors:

What is Metalink?

51


Issue 16 Figure 1: Arch Linux mirror list This lists the mirrors in general. A Metalink will point to a specific file(s) on all the mirrors. It can list priority and location of the mirrors, so it’s easy to download from many of them at once, along with P2P like BitTorrent, ed2k, and magnet links. Metalinks can be found at http://www.metalinker.org and http://metalink.packages.ro/ as well as directly from OpenOffice.org, Arch Linux, PC-BSD, DesktopBSD, blag linux, StartCom Linux, Ubuntu Christian Edition, Berry Linux, redWall Firewall, and others.

Metalink Clients What is wxDownload Fast? wxDownload Fast is a multi-platform open source download manager (GUI), similar to other download managers and Metalink clients: GetRight on Windows and Speed Download on Mac OS X. wxDownload Fast is available on Windows and Linux. Like most download managers, it supports resuming and segmented downloading.

Figure 2: wxDownload Fast GUI Metalink client

Installing and running wxDownload Fast wxDownload Fast can be compiled from source. Binaries are available for Windows, Debian, and Ubuntu. wxDownload Fast can be integrated with Firefox via FlashGot.

Using wxDownload Fast: an example If you use wxDownload Fast with FlashGot, you can just click on a Metalink. Otherwise, you will have to copy the link, click New in wxDownload Fast, and then click OK to start downloading. wxDownload Fast will automatically process the Metalink and start downloading from the mirrors. Once the download has finished, it will verify the checksum automatically. You can let wxDownload Fast handle all of your downloads, not just Metalinks, so it’s pretty useful.

What is aria2? aria2 is an open source command line download utility with resuming and segmented downloading capabilities. It is similar to curl and wget, but not as general purpose. It also supports BitTorrent and uses low amounts of system resources. It’s great for downloading regular files, as well as Metalinks and torrents.

52

What is aria2?


Issue 16

Figure 3: aria2 command line Metalink client

Installing and running aria2 aria2 can be compiled from source. Binaries are available for a variety of platforms. It is available from the official Debian repository. For Ubuntu, you can download a package from http://www.raphink.net/ubuntu/ or adddeb http://raphink.net/ubuntu/ubuntu edgy main or deb http://raphink.net/ubuntu/ubuntu dapper main to your sources.list, depending on whether you are running Ubuntu 6.06 or 6.10.

Using aria2: an example aria2 usage is very simple. At the command line, you type: aria2c http://www.exampleURL.com/file.metalink

More advanced uses of aria2 Metalink also allows files to be designated for a certain language or Operating System (OS). Some download pages are a bit confusing for users. You have to select OS, language, and mirror location. Metalink eliminates the need to manually select OS, language, or location as these settings can be saved by the download application and reused for every download. Or in the case of aria2, the correct settings can be selected with command line options such as: aria2c URL --metalink-language=LANGUAGE Where LANGUAGE is en-US, de, it, fr, etc. aria2c URL --metalink-os=OS Where OS is Windows-x86, Linux-x86, Solaris-x86, MacOSX-PPC, etc. Take this Firefox 2.0 download page (figure 4) for example:

More advanced uses of aria2

53


Issue 16

Figure 4: Firefox download page It lists 41 languages and 3 OS choices for each, for a total of 118 download links (5 are missing). All of these could be condensed into ONE Metalink and also contain all the mirrors as well. Here’s how it works: One link, one click downloads for everyone. For instance, a Metalink for Firefox can list every OS and language combination and their mirror locations and checksums. Someone in Brazil that speaks French and uses Linux can click on the link and get the French Linux version from the local Brazilian mirrors. Someone in Japan that speaks English on Mac OS X can click that same link and get the English OS X version from the local Japanese mirrors. Once the download finishes, the checksum is automatically verified, without user interaction.

Conclusions As you can see, Metalink simplifies as many things about the download process as possible. From gathering mirrors, verifying checksums, to making download pages less cluttered and confusing, Metalink automates as much as possible. Look into downloading with Metalinks for a faster and simpler download experience.

Biography Anthony L. Bryan (/user/27105" title="View user profile.):

Copyright information Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html. Source URL: http://www.freesoftwaremagazine.com/articles/using_metalinks

54

Conclusions


Issue 16

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

MINIX: what is it, and why is it still relevant? An interview with Andy Tanenbaum By Alan Berg PUBLISHED: 2007-03-19 MINIX, as originated by Andy Tanenbaum, is an operating system that has its roots and heart in academia as a tool that teaches you how kernels really should work. Recently, however, with the advent of version three of this rock solid OS, the focus is on making a production ripe embedded distribution. Being POSIX compatible with a Kernel of 3800 lines of code and a unique approach to handling drivers, MINIX 3 is well worth the effort to review for readiness.

A very brief history Andy Tanenbaum first released MINIX 1 in 1987 as an appendix to the book, Operating Systems: Design and Implementation. MINIX rapidly became very popular, with a USENET newsgroup being formed with 40,000 readers within 3 months. One of these readers was Linus Torvalds, who went out and bought a PC just to run and study MINIX. He wanted some improvements, so he made them himself. Then he made some more, and eventually he realized that he had gradually converted MINIX into his own operating system, entirely free of the original code. MINIX 2 was released in 1997 with the next edition of Andy Tanenbaum and Albert S Woodhull’s book. MINIX 3 (current stable version 3.1.2) is now out and by no coincidence the book’s third edition. The OS has been released under a BSD license, which should, in theory, suit both commercial and educational markets. For the first time, there is a clearly stated emphasis on an industrial ripe Kernel for embedded applications. Hence, my motivation for writing this article. There is a clearly stated emphasis on an industrial ripe Kernel for embedded applications Trivia: the MINIX mascot is a Raccoon (figure 1), which, to me, seems to be a nice positive figure that can compete with Penguins in terms of cuddliness. Currently the MINIX website is quite active with 1400 visitors a day on weekdays. Better still: expect version 3.1.3 of MINIX released around the time you read this article. The new release will focus on greatly increasing the reliability (e.g., being able to survive and replace device driver crashes without the user even noticing).

A very brief history

55


Issue 16

Figure 1: MINIX Raccoon logo

A little technology For the most up to date technical information please visit the document section of the MINIX home. MINIX 3 is POSIX compatible, which implies that the OS has a set of standard interfaces. Practically speaking, this implies that porting a large swathe of software from other POSIX compatible systems, such as Linux, is straightforward. MINIX has already had 400 packages ported including X windows. MINIX 3 runs on 386, 486, or Pentiums or compatible CPUs, and can be installed on a system with as little as 50MB of disk space and 8MB of ram. Therefore, the distribution should run nicely on the laptop I first used ten years ago. Architecturally, MINIX is based on the concept of a microkernel where the device drivers live in user land. This is advantageous, as processes in user land do not have direct access to resources without first going through the Kernel and should not be able to crash the Kernel through misbehavior. This very strong toughening catches many failure paths that are present in the much larger monolithic kernels such as Windows or Linux. Further, this allows the Kernel to remain small and understandable by any experienced kernel programmer, the fewer lines of code that exist in the Kernel the less likely that bugs, security, or maintainability issues occur. Designed into the OS is a reincarnation server to restart device drivers if they have stalled or crashed. This feature is a rather nice self-healing process that you may want in your satellites and nuclear reactors. The main performance trade off is extra effort required for context switching from the Kernel to user land for device drivers, which decreases the performance when compared to monolithic Kernels. The question to answer then is whether the performance overhead of 5-10% is made up for by the elegant design’s enhanced reliability, readability, and maintainability. I personally suspect it is. The performance overhead of 5-10% is made up for by the elegant design’s enhanced reliability, readability, and maintainability

Interview with Andy Tanenbaum Andy Tanenbaum has many achievements (see his Wikipedia entry) including writing some excellent textbooks, teaching, and being the design guru behind MINIX.

Questions AB: Can you give a little background context of your role within the development process of MINIX3.

56

Interview with Andy Tanenbaum


Issue 16 AT: I am the guiding light and occasional disciplinarian. I try to keep our goal in focus—building a highly reliable system. My Ph.D students, Masters students, and professional programmers do the actual work. AB: MINIX has had a traditional role as a learning tool within University environments; do you have any idea about how widely MINIX is currently deployed? AT: I don’t think the book sales of the hardcover text version in English have ever dipped below 10,000 copies a year for 20 years, and it has been published in places like India in runs of 100,000. And the book has been translated into a dozen languages. The number of students who have studied MINIX in detail is surely north of half a million and still going strong. The www.minix3.org Website currently gets about 1100 to 1400 hits a day and there have been over 100,000 downloads of the CD-ROM image in the past year. Because it comes with the Berkeley license, industrial users who modify it for products don’t have to report back to us, so I don’t know much about use in embedded systems. AB: MINIX3 has been designed to be a production ripe OS for embedded and low resource computers. Is MINIX being taken up in industry at present? AT: MINIX 3 hasn’t been out there long enough to have acquired much of an industrial user base, and companies don’t have to tell us they are using it, so I don’t really know. AB: What do you see as the near future development goals of MINIX? AT: Making it self-healing, I think with version 3.1.3 it should be possible to start a long file transfer over the network, then repeatedly kill the disk driver and Ethernet driver to simulate driver crashes and have the transfer complete correctly with no errors, despite the drivers being automatically replaced on the fly during operation multiple times. Other systems don’t do quite as well when drivers crash (or are killed to simulate crashes). They go belly up instantly. AB: What do you see as the long-term goals of MINIX? AT: Demonstrating that you can build small, acceptably fast, highly reliable systems out of small, modular components. There you have it, an interview with Andy Tanenbaum and an OS built on the KISS principle. Now to install MINIX 3.

Installation MINIX 3 is downloadable as source and as a Live CD. After booting from the CD, the process of installing a disk is straightforward. However, the installation requires an extra partition. For demonstration purposes, I have, therefore, chosen to use a virtual machine QEMU and a pseudo partition contained within a specially formatted file. If you are as pleased as I am with the outcome, then you can always later repartition your real hard disk and perform the setup properly. A second advantage of having a partition stored within a file is that you can copy the file to other machines and use the virtualization player to run; thus allowing different setups, browsers, and test configurations. Further, as we move from a single process paradigm to multiple cores—where the cores reside not only traditionally in the CPU, but also in the graphics card and perhaps even the sound card—we can expect that, for Service Providers, multiple virtualizations may be the most efficient approach to consuming the maximum amount of resources with useful work per customer. The following instructions require 1GB of hard disk and 160MB of free memory. Note: I am spoiling myself here. It is viable to perform a setup with less resources; however, I am installing on a typical, if not slightly old PC, and am not trying to push forward a resource lean embedded environment. I have based the instructions on Ubuntu Linux 6.06; however, QEMU, being virtualization software, also runs stably on other OSes (MAC, Windows and, of course, other Linux and UNIX distributions). On the other OSes, after installing QEMU, the instructions shouldn’t change.

Installation

57


Issue 16 The two virtual machines I considered for use were QEMU and Bochs, both excellent free software tools of the trade. First, I tried QEMU out and the process worked first time without any errors or hassles; therefore, I never got around to trying out Bochs. I tried QEMU out and the process worked first time without any errors or hassles The QEMU emulator is GPLed under the circumstances that we are using it. However, there is a proprietary license associated with the accelerator pack. Without the accelerator pack the emulator runs between 5-10 times slower than the system that is being emulated. This slow down is not an issue for MINIX3 which is fast and has a small footprint. The approach I am taking is to download the bootable disc image from the official MINIX 3 website, create an empty virtual partition, boot up the image within the emulator, and populate the virtual disc via a standard setup. Finally, I’ll boot off the virtual disc via QEMU and play “Dungeons” a rather nice text based adventure, which I had much fun with as a student (and yes I am that old!). Note: At the time of writing the download links were working. If, in the meantime, the links fail, please visit www.minix3.org to get the CD image. In Ubuntu, with system administrator rights, you can install QEMU via the command line with the following command: sudo apt-get install qemu Do you want to continue [Y/n]?

The result of your action should be similar to: Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: bochsbios vgabios Recommended packages: debootstrap sharutils proll openhackware The following NEW packages will be installed: bochsbios qemu vgabios 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 3861kB of archives. After unpacking 10.4MB of additional disk space will be used. Do you want to continue [Y/n]?

If this approach fails then please visit the homepage of QEMU. After checking that you have enough disk space for the 1GB pseudo file system and the 250MB CD image, create a directory in your home directory. cd ~ mkdir minix3

Download the CDROM image, either via your web browser or via wget, from the MINIX 3 website and expand it into the minix3 directory. cd minix3 wget http://www.minix3.org/download/IDE-3.1.2a.iso.zip unzip IDE-3.1.2a.iso.zip

Make an empty virtual image with 1GB free. I chose 1GB so that I’d have room to install lots of packages and their sources. However, you maybe able to get away with around 100MB if you restrict yourself to an elite set of packages and no sources. qemu-img create minix3_1_2_a.img 1024M

The output should be similar to:

58

Installation


Issue 16 Formating 'minix3_1_2_a.img', fmt=raw, size=1048552 kB

In addition, the file minix3_1_2_a.img should now exist and it should be of the correct file size. Bootup the CD image inside the emulator: qemu -cdrom

minix3_1_2a_ide_build2.iso -boot d -hda minix3_1_2_a.img -m 160

Figure 2: MINIX 3 Live CD just after boot up Type setup and reproduce the answers to the following questions: Keyboard type? [us-std] - Press Return Ethernet card? [0] - Press Return Basic (M)inimal or (F)ull install? [F] - Press Return Press ENTER for automatic mode, or type 'expert' - Press Return

At this point, you should see the message: The following disk was found on your system: Disk [0]: /dev/c0d0, 1024 MB Free space (1023 MB) Enter the disk number to use: [0] - Press Return Enter the region number to use or type 'delete': [0] - Press Return Are you sure you want to continues? Please enter 'yes' or 'no': - Type yes How big do you want your /home to be in MB (0-953) ? [190] - Press Return 190 MB Ok? [Y] - Press Return Block size in kilobytes? [4] - Press Return

After formatting the pseudo partition and checking the partition’s new integrity, type: Shutdown

Startup with: qemu -cdrom

minix3_1_2a_ide_build2.iso -boot c -hda minix3_1_2_a.img -m 160

Login as root and create a root password from the command line via passwd. Type less from the command line. Oh no! the tool is not installed: less: No such file or directory

Okay, now we need to install some applications. The CD image contains 40 such packages. Your next action should be to type packman to run the package manager, and then press ‘3’ to list the packages on the CD. A list should appear similar to that shown in figure 3.

Installation

59


Issue 16

Figure 3: List of installable packages found on the CD Rom image Press ‘q’ to return to the original menu. Select ‘4’ to choose a package and ‘21’ for the less package. For some homework, install dungeons (package 11) and run it from the command line, within the game type info. The game was fun when I was a student all those long and wasted years ago. Perhaps, you will find it as fun.

Figure 4: Time to play in the dungeons

What to do next MINIX is fast, reliable (well I have never seen it crash or freeze) and, with a small footprint, is ideal for your old Pentiums or even 386s and 486s that might still be hanging around in your loft somewhere. MINIX is fast, reliable and, with a small footprint, is ideal for your old Pentiums or even 386s and 486s I would respectfully suggest that you try to get yourself onto the network and start using it. If you find any issues, report them back to the hard working development community via comp.os.minix. If you think that your favorite free software package or a device driver is missing, then why not join the development community and volunteer your time to build this lean-mean-operating-system-machine’s vocabulary of packages to a higher level? I suspect that you will learn some good practices on the way. Finally, if you wish to brush up on the theoretical constructs behind OS design with a MINIX 3 practical bias, then you may be interested in reading the updated classic Operating Systems Design and Implementation 3 edition by Andrew S. Tanenbaum and Albert S. Woodhull.

60

What to do next


Issue 16

Impressions Personally, I found MINIX 3 fun to play with. Installing it on an old PC was quick and painless. Boot up time is dramatically less than for Windows or Linux, partially because the Kernel is so lean and only a few servers are running. Being POSIX compatible and being able to run X Windows makes porting of GNOME or KDE (or Window managers, in general), viable and potentially straightforward. Though intended for the embedded marketplace, I don’t see any reason to not position MINIX as a viable OS that will later stand alongside Linux, FreeBSD and OpenBSD, etc., in audience recognition. I even positively contemplate the possibility of an ergonomic fit with embedded Apache, Tomcat and Java as an efficient internet application host. However, no doubt, that would depend on the performance hit of context switches from kernel space to user land due to the deliberate reliability design feature of placing drivers in user land. I don’t see any reason to not position MINIX as a viable OS that will later stand alongside Linux, FreeBSD and OpenBSD, etc., in audience recognition Finally, it is clear that the design of MINIX 3 brings new competitive ideas for enhancing reliability and maintainability to the fore. I hope MINIX 3 will stimulate the next generation of OS designers in the same way it has the previous.

Acknowledgments I wish to acknowledge the input of Andy Tanenbaum and the historically-seen rippling effects of his innovative design concepts on others.

Bibliography Bochs—http://bochs.sourceforge.net/ Document section of the MINIX website—http://www.minix3.org/doc/ QEMU—http://fabrice.bellard.free.fr/qemu/index.html MINIX homepage—http://www.minix3.org/ MINIX Live CD—http://www.minix3.org/download/ Operating Systems Design and Implementation, 3/E—http://vig.prenhall.com/catalog/academic/product/0,1144,0131429388,00.html POSIX—http://en.wikipedia.org/wiki/POSIX Vrije Universiteit Amsterdam—http://www.vu.nl/home/index.cfm Wget—http://www.gnu.org/software/wget/ Wikipedia entry for Andrew Tanenbaum—http://en.wikipedia.org/wiki/Andrew_S._Tanenbaum

Biography Alan Berg (/user/8" title="View user profile.): Alan Berg Bsc. MSc. PGCE, has been a lead developer at the Central Computer Services at the University of Amsterdam for the last eight years. In his spare time, he writes computer articles. He has a degree, two masters and a teaching qualification. In previous incarnations, he was a technical writer, an Internet/Linux course writer, and a science teacher. He likes to get his hands dirty with the building and gluing of systems. He remains agile by playing computer games with his kids who (sadly) consistently beat him physically, mentally and morally.

Bibliography

61


Issue 16 You may contact him at reply.to.berg At chello.nl

Copyright information Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. Source URL: http://www.freesoftwaremagazine.com/articles/minix

62

Bibliography


Issue 16

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

Asterisk, the easy way Undertanding the basics of the Asterisk (the free software phone system) By Mitul Limbani PUBLISHED: 2007-02-19 Did you know that it’s possible to build an entire telephony system centered around computers? One which is free of licensing costs too? Asterisk is a free software application written to do just that, and much more. Why? For the uninitiated, here’s why…

Wherever you go, your free software PBX follows! The telephony industry has been facing a real crisis since the last decade. While the computer industry has undergone a host of transformations since its inception a couple of decades ago, the century old telephony industry has had problems coping with new ideas and advances. The reason for this is the lack of innovative thinking among makers of proprietary technologies that constitute the chaotic mess that we call the telephone system. These systems suffer from all the drawbacks that inherently bug all closed, proprietary systems. The problems surface as these systems progress deeper into their life cycle. The problems caused are typical of closed proprietary systems. From interoperability and scalability problems to problems caused due to lack of foresight during designing, these problems usually warrant expensive remedies. The technology used in these proprietary systems is usually closed and usually remains unpublished. Add to it the expensive licensing fees for this “sophisticated” proprietary technology and it becomes a no-no for users such as home users and small business users who also want a sophisticated, flexible telephony solution but cannot afford the expensive price tags. The success of revolutions like GNU/Linux is attributed to combined efforts of the likes of Linus Torvalds and a pool of geniuses, academicians, hobbyists, and geeks worldwide. Nobody in the telephony industry wanted to build an open, clean, scalable and seamlessly inter-operable platform for telephony like the internet. Fortunately for us, someone from computer science did! Meet Mark Spencer and his brainchild, aptly christened “Asterisk”. Asterisk is the “” character that appears on a standard touch-tone telephone pad. This “” character represents a wild card character in the world of computer systems, meaning that it can represent anything from a single character to multiple characters. And this is precisely what Mark Spencer intended Asterisk to represent in the world of telephony—anything and everything. Asterisk not only encompasses what we can presently do with telephony but also whatever we may think of doing with it in future. It is a revolution in the making and is all set to transform telephony.

Get your facts right… So what exactly is Asterisk? Asterisk is a telephony platform that exists entirely in software. It is distributed under the GNU GPL (General Public License). This makes it possible for everybody to build and deploy their own customized professional telephony solution, from large corporations in search of a reliable ITSP platform to individuals who want to have their own PBX system. Asterisk was created by Mark Spencer, the founder of Digium (formerly Linux Support Services). Digium, a company founded by Mark Spencer is actively backing Asterisk. In fact, the purpose of creating Digium was largely for providing support services for the free software PBX. Today, Digium designs and

Get your facts right…

63


Issue 16 supplies hardware for interfacing Asterisk with a host of networks including PSTN and ISDN PRI. In compliance with free software tradition, community support for Asterisk is available through a host of portals including Digium’s support portal and a number of other websites like voipinfo.org which are powered by hordes of Asterisk enthusiasts and professionals. Community support is also available through FreeNode IRC channel where Asterisk developers and serious Asterisk geeks meet. Commercial support for Asterisk is available through Diguim and many other commercial establishments, some of whom are dedicated only to Asterisk installation and application development like Asterisk@Office.

How is Asterisk better than traditional telephony systems? Asterisk is built as a vast flexible software platform composed of a bunch of programs that can perform whatever functions you program them to do instead of a bunch of wires and circuits which perform fixed functions in their range of operation. This is the reason why Asterisk achieves a degree of flexibility which traditional telephony platforms cannot do, no matter how ambitiously designed they are. Due to its being a software program, Asterisk’s extensibility is almost infinite, limited only by the goals of its developers.

What can be done using Asterisk? The possibilities with Asterisk are unlimited. It can be used to build almost anything from a small home PBX to an ITSP (Internet Telephony Service Provider). With features that include voice mail, teleconferencing and call parking, Asterisk easily rivals the features of most modern PBX systems. Asterisk supports inter communications using protocols like the popular SIP or the newer IAX (Inter-Asterisk Exchange), H.323, MGCP, Skinny/SCCP and UNISTIM. To connect your PBX to the traditional PSTN (your telephone system) you can choose from a variety of options like traditional telephone lines, ISDN BRI lines, ISDN PRI lines and VoIP trunks from VoIP providers. Asterisk supports many popular codecs such as GSM, Ilibc, Speex, MP3, G.711, G.726, G. 723 and G729 for compression. Small businesses can set up Asterisk to have all features of a modern PBX at a fraction of the cost. Big corporations and businesses can build a PBX which can seamlessly connect their offices around the globe irrespective of their geographic locations.

What features of interest does Asterisk have for developers? Asterisk is a developer’s dream come true. It has in-built database AstDB, a Berkeley DB Version 1 database. You can also have Asterisk connect to traditional relational databases using AGI, a standard interface with which external programs can control Asterisk dialplan. AGI can be written using many programming languages, though the language of choice is Perl due to its prowess in text processing. Using Asterisk in conjunction with AGI, you can integrate Asterisk into almost any computer application you like. Such is the power of Asterisk.

Selecting hardware and OS for Asterisk Asterisk runs on Linux (preferably kernel 2.6 and above) with mostly any garden variety Intel X86 based CPU (I tested it with an old Intel Pentium II CPU running at 333 MHz with 128 MB of RAM and it seemed to work). But a powerful CPU like a Pentium 4 (preferably the multithreaded HT version or Dual Core) is recommended. The reason for this is that Asterisk may have to perform transcoding on incompatibly encoded streams (say GSM and MP3) in order to interlink them. This guzzles down a lot of CPU juice. Furthermore, the reason that Intel based CPUs are preferred is that not only do these CPUs have higher clock speeds (GigaHertz) but they have deeper pipelines. Such CPUs excel in operations such as encoding and decoding which have hardly any branching instructions that might require flushing of the CPU pipeline and hence make full use of the higher CPU speed. Asterisk has been known to work with Windows and MacOS X but with severely crippled functionality. We won’t discuss other platforms here.

64

Selecting hardware and OS for Asterisk


Issue 16

Installing Asterisk Note that you require root privileges to install and run Asterisk. To install Asterisk, you have to have some distribution of Linux installed on your machine. So far, Asterisk is known to work with Debian, Fedora, Gentoo, Mandrake, Red Hat, Red Hat Enterprise Clones, CentOS, Pie Box, Tao Linux, Whitebox, Slackware, SUSE and Yellow Dog. So here are simplified the Asterisk installation steps… Make a directory for asterisk and related sources, change into it using the cd command and proceed. # mkdir /usr/src/asterisk-src # cd /usr/src/asterisk-src

1. Download and install mpeg123—note that Asterisk is choosy about using the 123 version given below. This package is necessary to play MP3 files for features such as custom music on hold. This is an optional package but installing it is highly recommended. # # # #

wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz tar -zxvf mpg123-0.59r.tar.gz # cd mpg123-0.59r make linux make install

Make sure that mpg123 is in the /usr/bin directory. If not, create a symbolic link to it from /usr/bin/mpg123. 1. Download and install Zaptel—This step is necessary if you want to connect your PBX with TDM hardware, which is necessary to connect your PBX with the telephone system. This package is optional if you do not want to connect your Asterisk PBX to the PSTN (the telephone network). # # # #

wget http://ftp.digium.com/pub/zaptel/zaptel-1.2.9.1.tar.gz tar -zxvf zaptel-1.2.9.1.tar.gz cd zaptel-1.2.9.1 make clean ; make install

1. Download and install Libpri—Libpri is necessary if you want to connect your PBX system to ISDN PRI using the necessary hardware. This package is optional if you do not want to connect your Asterisk PBX with an ISDN PRI line. # # # #

wget http://ftp.digium.com/pub/libpri/libpri-1.2.3.tar.gz tar -zxvf libpri-1.2.3.tar.gz cd libpri-1.2.3 make clean ; make install

1. Download and install Asterisk—This will install the Asterisk PBX on your PC. # wget http://ftp.digium.com/pub/asterisk/asterisk-1.2.12.1.tar.gz # tar -zxvf asterisk-1.2.12.1.tar.gz # cd asterisk-1.2.12.1 # make clean ; make install ;Do the next if you want sample configuration files to be created. # make samples

That does it. In case you want to install the package Asterisk Addons, do the following. 1. Download and install asterisk-addons—This package provides MySQL support for Call Detail Records (CDR). Install it only if you want Asterisk to connect with MySQL. # wget http://ftp.digium.com/pub/asterisk/asterisk-addons-1.2.4.tar.gz # tar -zxvf asterisk-addons-1.2.4.tar.gz

Installing Asterisk

65


Issue 16 # cd asterisk-addons-1.2.4 # make clean ; make install

1. Download and install asterisk-sounds—This package contains professionally recorded sounds to use with Asterisk in addition to what are already provided. Installing this package is optional. # # # #

wget http://ftp.digium.com/pub/asterisk/asterisk-sounds-1.2.1.tar.gz tar -zxvf asterisk-sounds-1.2.1.tar.gz cd asterisk-sounds-1.2.1 make clean ; make install

Now that installation is done, you can test it by typing… # asterisk -vvvvc

This starts up Asterisk and provides you with the Asterisk Command Line Interface.

Structure of Asterisk Asterisk exists on your filesystem in the following directories: • /etc/asterisk—Asterisk’s configuration files, including the dialplans. • /var/lib/asterisk/astdb—AstDB file and following subdirectories… • /var/lib/asterisk/agi-bin—AGI scripts. • /var/lib/asterisk/firmware—Firmware for asterisk compatible devices. • /var/lib/asterisk/images—Images to be used with applications supporting images. • /var/lib/asterisk/keys—Authentication keys for public/private key authentication of peers. • /var/lib/asterisk/mohmp3—Music on hold files. • /var/lib/asterisk/sounds—Sounds such as voice prompts. • /usr/lib/asterisk/modules—Asterisk loadable kernel modules. • /var/spool/asterisk—Asterisk uses this directory for certain things that can be done using spooling. • /var/run—Process ID information on all active Asterisk processes. • /var/log/asterisk—Asterisk writes its logs in this location. • /var/log/asterisk/cdr-csv—Asterisk uses this directory to store call records.

Channels Channels are required for the obvious purpose of creating pathways for communication within the PBX and with the external world. Channels use communication protocols to inter-communicate. The commonly used protocols with Asterisk are SIP and IAX. SIP is arguably the most widely used VoIP (Voice over IP) protocol in the world. It started out as a simple and elegant idea but became bloated and cumbersome over the years. The major drawback of SIP is that it uses separate streams for signaling and data, which presents problems with firewalled systems. NAT traversal is also an issue with SIP but workaround solutions are in place to manage this issue. IAX (deprecated in favor of IAX2) is a brand new protocol developed by the creators of Asterisk is built taking into account all the mistakes of the past and hence is competing with SIP as the VoIP protocol of choice. Channels are written in the file sip.conf.

Asterisk configuration Now that you have installed Asterisk and got it to work, it’s time to start with the real stuff. I’ll now show you how to set up your PBX system as an intercom and interface it with the outside world in various simple but elegant configurations.

66

Asterisk configuration


Issue 16

Here are a few requirements before you begin Since you are developing a PBX, you will need terminals from which you can make and receive calls. You can use either hard phones (the ones that are normally used at home) or softphones (the ones that can be run on your PC). Hard phones are phones which are physically seperate entities like your ordinary, humble analog phone. There are two different ways in which hard phones can be used with Asterisk… • IP Phones: IP phones are digital phones which understand VoIP protocol and can make use of the Internet Protocol. IP phones are available in a wide range of pricing and feature sets that range from expensive brands to cheap Chinese alternatives. Branded IP phones from manufacturers like Snom are priced from US$200 onwards while the cheap Chinese instruments start from US$60 onwards. I have worked with Snom 200 and found to be packed with useful features, highly reliable and of excellent build quality. I have also tested the Chinese variants. Do get in touch with me to get some recommended ones. • Analog Telephone Adapters: Asterisk is a software system running on a digital computer and it cannot directly make use of analog phones. However, you can use devices called ATAs or Analog Telephone Adapters. ATAs understand IP and some VoIP protocol, say, SIP. It provides one or more RJ 11 connector(s) into which you can plug in one or more ordinary analog phone machines, depending on how many lines the ATA provides. ATAs can be configured using your computer’s browser, since ATAs usually have a web application running which lets you configure it. Soft phones are entities which exist in software. You can hold conversations using soft phones with help of a headset (headphone and mic). These are the cheaper alternative if you have a computer available in places which you want to connect using your PBX. Out of all the soft phones I tested, I found CounterPath’s X-lite to be the best free soft phone. You can download it from their website for your operating system. You can download X-lite for Linux, Windows and MacOS from the Xten website for free. I will be using SIP as my protocol of choice for my extensions and IAX as the protocol of choice for Asterisk interconnection. I assume that your Asterisk machine has the IP address 192.168.0.99 and that you have configured your firewall in order to unblock all traffic on SIP, RTP and IAX ports. Usually these port numbers are port 5060 to 5062 for SIP, 8000 to 20000 for RTP and port 4569 for IAX.

Configuring your hard/soft phones and ATAs To configure your hard/soft phones and ATAs, you need to open their configuration interface (the IP address of the ATA if you are using an ATA). You need to put the following details wherever they are asked for: 1. Domain: Put your Asterisk machine’s IP address here, for example 192.168.0.99. 2. SIP proxy: Put your Asterisk machine’s IP address colon separated with your Asterisk’s SIP port. For example, 192.168.0.99:5060. 3. Outbound SIP proxy: Put the SIP proxy for making outbound calls here. Usually this is same as the SIP proxy. For example 192.168.0.99:5060. 4. User name/Authorization user: Put the extension that you want to assign to the phone, provided that this matches the extension you will create while configuring Asterisk. 5. Password: The corresponding password of the user name that you entered. It is important that you correctly configure your hard phones for them to register with your Asterisk machine. Connecting to Asterisk Command Line Interface (CLI): Asterisk CLI helps you monitor Asterisk. To connect to it, go to your Linux shell and type… # asterisk -r

If Asterisk is running you should get a prompt which looks like:

Configuring your hard/soft phones and ATAs

67


Issue 16 hostname*CLI>

So, in this case: asterisk2*CLI>

You can stop Asterisk by typing at the Asterisk CLI: asterisk2*CLI> stop gracefully

You can start Asterisk by typing at your Linux shell: # asterisk -vvvvc&

The above will start Asterisk with verbosity level 4 and connect you to the CLI. To re-read the configuration files or “reload” Asterisk, type at the command line… # asterisk2*CLI> reload

After you start making changes to Asterisk’s configuration files, you may be required to refresh Asterisk for the changes to take effect. To do this, you can type “reload” at the Asterisk CLI. This should be enough for most changes to take effect. But at the time of major changes such as creating new extensions, I strongly recommend that you shut down Asterisk and start it again. In such cases, you type: asterisk2*CLI> stop now

at the Asterisk CLI and type: # asterisk -vvvvc

at the Linux shell prompt to start Asterisk again and reconnect to the CLI.

What is a dialplan? A dialplan is the logic that instructs Asterisk how to handle calls. The Asterisk dialplan exists purely in software and is predominantly written in the file extensions.conf. For instance, in the file extensions.conf: [incoming] exten => 1001,1,Dial(SIP/1001,18) exten => 1001,2,Congestion() exten => 1001,102,Busy()

Contexts—the file extensions.conf consists of blocks called “contexts”, indicated by square brackets [<context name>] and statements that start with exten=>. In the above example, the context “incoming” has a match in the file sip.conf, in the sense that there has to be extension 1001 in sip.conf that has the context “incoming” designated to it. This will direct Asterisk to send all the calls coming to SIP/1001 (sip extension 1001) to the extension “incoming” in extensions.conf. Example (in the file sip.conf): [1001]

68

What is a dialplan?


Issue 16 user = 1001 type = friend secret = 1234 host = dynamic callerid = 1001 context = from-sip-internal

Priorities—priorities are simply the ordering integers (or labels) that the exten=> statements have in order to decide the order of execution of the statements. In the first example, the ‘1’, ‘2’, and ‘102’ in the exten=> statements are nothing but priorities. Applications—the expressions of the form that you see in Dial() are calls to applications. When applications are called, they perform functions such as dial an extension, and connect it to the dialling channel, as in the above case. In a way, applications enable Asterisk to do different things after Asterisk has finished resolving the logic. So this is how you instruct Asterisk to handle incoming calls. But what about the calls going out? And what about the IVR system? For this, you need to build a simple customised dialplan that addresses all these questions. I will now look at this dialplan, and try to help you understand it in the simplest manner possible. Our dialplan will: • Create an intercom system to enable calls between internal callers. • Greet external callers with a welcome message and direct the caller on the basis of the response, thus building a preliminary Interactive Voice Response (IVR) system. • Provide outbound calling to the telephone system (assuming that you have a Digium OEM X100P or equivalent card installed and plugged with the telephone line). • Provide voicemail facility.

The prerequisites Here I’ll make use of the following parts of the Asterisk structure on the file system: • The SIP configuration file: /etc/asterisk/sip.conf • The extensions file (dialplan): /etc/asterisk/extensions.conf • The sounds directory: /var/lib/asterisk/sounds If you are looking for an X100P card, you can find it here, which is a thread dedicated to finding the hardware in India.

Creating SIP extensions Let’s dive into the configuration. Edit the file /etc/asterisk/sip.conf: pico /etc/asterisk/sip.conf

Here is the content: ;cut from here ; sip.conf - SIP configuration file [general] port=5060 ; Port to bind to (SIP is 5060) bindaddr=0.0.0.0 ; Address to bind to (all addresses on machine) disallow=all ; First, disallow all codecs, then allow codecs one by one allow=ulaw allow=alaw

Creating SIP extensions

69


Issue 16 context = from-sip-external ; Send unknown SIP callers to this context callerid = Home nat=yes ; Important if your Asterisk server and extensions are behind NAT qualify=yes canreinvite=no dtmfmode=rfc2833 [101] user=101 type=friend secret=1234 host=dynamic callerid = User-1 context=from-sip-internal [102] user=102 type=friend secret=1234 host=dynamic callerid = User-2 context=from-sip-internal [103] user=103 type=friend secret=1234 host=dynamic callerid = User-3 context=from-sip-internal [104] user=104 type=friend secret=1234 host=dynamic callerid = User-4 context=from-sip-internal ; upto here

I have created 4 SIP extensions above. Make sure to restart Asterisk in order for these changes to take effect. Here: • The “user” identifier is assigned to the extension that you wish to use with your phone. • The “type” identifier tells you whether the user is a “user” (takes incoming calls), “peer” (makes outgoing calls) or a “friend” (who does both). • The “secret” identifier is assigned the password for authenticating the user—this has to be accurately entered in the phone’s configuration settings for it to log on to the Asterisk server. • The “host” identifier tells Asterisk what kind of host you are dealing with and the value “dynamic” informs Asterisk that this host will register with our server. • The “callerid” identifier is the caller identification presentation string that you want to be seen for this caller. • The “context” identifier is the most important since this is what ties up the Asterisk SIP user with the dialplan in extensions.conf as mentioned above. Here, you have the value “from-sip-internal” assigned to “context”. This means that when Asterisk receives a call for 1001, it will look in the context “from-sip-internal” for the action to be performed. If it does not find the necessary context, it will simply exit with a “404 Not Found” code (unless you have configured it to handle such cases using a wildcard, which will be discussed at a later stage). So be careful. The SIP callers who are not registered with your server (that is, the external callers), are directed to the appropriate context based on the information provided in the general context in the sip.conf file—look at the sample given here and the rest is self-explanatory. Comments are denoted by a ‘;’ symbol— everything to the right of a semicolon is a comment.

70

Creating SIP extensions


Issue 16 You’ll need your hard/soft phones or ATAs, as mentioned earlier, properly configured and online in order to use the extensions that you have created. Remember to reload Asterisk so that the changes made to sip.conf can take effect. Go to the Asterisk command line interface (type asterisk -r from your Linux shell) and type: asterisk2*CLI>sip reload asterisk2*CLI> sip show peers

The extensions should get listed with their IP addresses if they have been configured properly. Now that you have everything working, here is the dialplan (run pico /etc/asterisk/extensions.conf:

; extensions.conf—the extensions configuration file [globals] OUTBOUNDTRUNK=ZAP/1 ; outbound calling trunk INTERCOM=SIP ; protocol for the intercom IVR-OPERATOR=0 ; IVR key for the operator OPERATOR=501 ; actual extension of the operator [incoming] include => internal [from-pstn] include => intercom exten => s,1,Playback(silence/1) exten => s,2,Background(welcome) exten => s,3,Background(enter-ext-of-person) exten => s,4, Background(or-press) exten => s,5, SayDigits(${ IVR-OPERATOR}) exten => s,4, Background(to-reach-operator) [intercom] exten => _5XX,1,Macro(dial,${INTERCOM},${EXTEN}) exten => ${IVR-OPERATOR},1,Macro(dial,${INTERCOM},${OPERATOR}) exten => 500,1,VoiceMailMain() ; Enabling voicemail at extension 500 include => rules [internal] include => intercom include => outbound-local [outbound-local] exten => _9XXXXXXXXX,1,Macro(dial,${OUTBOUNDTRUNK},${EXTEN}) exten => _2XXXXXXX,1,Macro(dial,${OUTBOUNDTRUNK},${EXTEN}) ; exten => _3XXXXXXX,1,Macro(dial,${OUTBOUNDTRUNK},${EXTEN}) ; exten => _5XXXXXXX,1,Macro(dial,${OUTBOUNDTRUNK},${EXTEN}) ; exten => _0.,1,Macro(dial,${OUTBOUNDTRUNK},${EXTEN}) ; STD /

; Mobile numbers MTNL Reliance Tata ISD numbers

; Emergency and special numbers exten => _1.,1,Macro(dial,${OUTBOUNDTRUNK},${EXTEN}) [macro-dial] exten => s,1,Dial(${ARG1}/${ARG2}) exten => s,2,Goto(s-${DIALSTATUS},1) exten => s,102,Goto(s-${DIALSTATUS},1) exten => s-NOANSWER,1,Voicemail(u${ARG2}@default) exten => s-BUSY,1,Voicemail(b${ARG2}@default) exten => s-CHANUNAVAIL,1,Playback(pbx-invalid) [rules] exten => t,1,Playback(connection-timed-out) exten => t,n,Playback(hangup-try-again)

Creating SIP extensions

71


Issue 16 exten => t,n,Hangup() exten => i,1,Playback(pbx-invalid) ; cut upto here

In the above dialplan: • The “globals” context—this is where global variable declarations are done in Asterisk. The variable assignment in the “globals” section is pretty simple—just variable names, an equals symbol and the value. • The “include” statement tells Asterisk to literally include the code in the context that follows the “include” keyword. • The Playback() application plays the file whose name it takes as an argument. These files are in GSM format—note that you have to exclude the .gsm extension of the filename. • Background() works similarly; Background() detects key presses and interrupts the playback to return the code of the key pressed (usually DTMF) to Asterisk; on the other hand, Playback() ignores any key presses and returns control to Asterisk only after it has finished playing a file. Note that DTMF means Dual Tone Multi Frequency—these are the tones that our modern telephone’s touch-tone dial pads produce. • The SayDigits() application does precisely what its name suggests— it plays the digits of the number that it takes as an argument. • The Dial() application is more difficult to explain than the previous applications mentioned. So, it deserves a section in its own rights.

The Dial() application Dial() dials the channel that it takes as an argument and bridges it with the active channel (the calling channel in the case of our dialplan). The Dial() application takes two main parameters as arguments (I will not cover the optional ones here)— the channel to dial and the time for which it has to keep trying before exiting. Dial() sets a certain environment variable DIALSTATUS on exit, which you can make use of in your dialplan. DIALSTATUS is set to <extension> -NOANSWER, if the called line does not answer, and <extension> -BUSY, if the called line is busy. It sets DIALSTATUS to <extension> -CHANUNAVAIL in the event that the channel does not exist. Besides this method, another behaviour of Dial() can be used, in which it takes control to the next priority in case the called line does not answer and to the Dial’s current priority + 101 if the called line is busy. There is one more property of Dial() that you should know about. It takes the control to extension ‘i’ (invalid) when invalid extensions are dialed and extension ‘t’ (timeout) when the caller takes an abnormally long time to respond. You may notice the ${<variable name>} notation used in many places—this is how you can recall values stored in variables. Wherever such notations are encountered, Asterisk simply replaces the value of the variable between the curly brackets. You must have also noticed that some notations in the dialplan begin with an underscore, ‘_’. The underscore informs Asterisk that the notation following it uses wildcards. Wildcards are symbols that can replace one or more, other symbols. In Asterisk, wildcard symbols that are present are listed below: • X—Matches any digit from 0 to 9. • Z—Matches any digit from 1 to 9. • N—Matches any digit from 2 to 9. • [15-7]—Matches any digit or range of digits specified. In this case, matches a 1, 5, 6, or 7. • . (period)—Wildcard match; matches one or more characters. For instance, the expression _X will match all one-digit numbers from 0 to 9. _2XXXXXXX will match all numbers beginning with the digit 2 (like our MTNL Mumbai and Delhi landline numbers) and _. will match everything. A word of caution here—make use of wildcards very judiciously and only after you are certain of the outcome.

72

The Dial() application


Issue 16 I have also made use of forms of code called “macros”. An Asterisk macro is a set of statements that can be invoked or called from anywhere in the dialplan. Macros are written in sections just like contexts and their names have to be preceded by the prefix macro-. Macros can take arguments. The macro arguments are denoted by ARG<num> where num is replaced by the argument number that is serially assigned by Asterisk, in the order of passing. Macros are called using the Macro() application. Priorities in the exten=> statements in the file extensions.conf are auto-incremented if the following priority is indicated by the symbol ‘n’ instead of a number. This saves the trouble of keeping track of priority numbers and manually changing all following priority numbering in case you change intermediate code. The extensions can also have labelled priorities— for instance, exten=> <some extension>, n(<label>), <do something>. Labelling extensions not only saves a lot of effort in case of changes, but also helps keep the code readable.

Voicemail Voicemail users are defined in the file voicemail.conf. Here too the file is sub-divided into sections: ;cut from here [default] 101 => 1234,User-1,user-1@somedomain.com 102 => 1234,User-2,user-2@somedomain.com 103 => 1234,User-3,user-3@somedomain.com 104 => 1234,User-4,user-4@somedomain.com ;upto here

I will only use and cover the “default” context of the voicemail file. The voicemail.conf file’s statements are of the form: mailbox => password,name[,email[,pager_email[,options] ] ]

I have made use of the VoiceMail() and VoiceMailMain() applications in the example dialplan in extensions.conf to incorporate voicemail. The VoiceMailMain() application does not take arguments, but provides prompts for users to enter a username/password combination to access their voicemail and to customise their voicemail response with something like a custom greeting. The VoiceMail() application takes the mailbox details as argument, which is in the form: Voicemail(<prefix><voicemail number>@<voicemail context>)

The “prefix” is an optional symbol that indicates to the VoiceMail() application which message it should play. If you supply the prefix ‘b’, Asterisk will play the “person busy” message, and if you supply ‘u’, Asterisk will play the “person unavailable” message.

Conclusion This should provide you with adequate information to read through the provided dialplan and understand it. You can look up more information on Asterisk on the internet—to help you understand this dialplan better and to build you own dialplans. The VoIP-info website is a mammoth resource on Asterisk and VoIP, and has exhaustive material on the mentioned topics. The Asterisk Book resource has a small concise task-oriented tutorial on Asterisk, which covers the basics; it also points you to useful resources on the web to accomplish the tasks at hand.

Biography Mitul Limbani (/user/26845" title="View user profile.): We have expertise in Asterisk installation, Asterisk configuration, Customized Asterisk Development, Dialplan programming, AGI scripting, manager api, IVR Designing. We have installed,configured and customized various opensource solutions based on Asterisk such as Vicidial , A2Billing , AstBill , FreePBX , TrixBox, etc. We have expertise in PHP,MySQL, AJAX as well.

Conclusion

73


Issue 16 Visit us today at : http://www.asteriskatoffice.com/ Send us your query on : http://www.asteriskatoffice.com/contact

Copyright information Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. Source URL: http://www.freesoftwaremagazine.com/articles/asterisk_the_easy_way

74

Conclusion


Issue 16

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

A media center based on GNU/Linux Hacking the living room By Davide Carboni PUBLISHED: 2007-02-12 When my DVD player stopped working, I definitively proved to myself (and to people I know) that if there is a simple and effective solution to a problem and a complex one which promises unpredictable results, I always choose the second option. Instead of buying a new DVD/DivX/MP3 player for the modest price of $40-50, I decided to build a home-made device that would allow me to record the TV, receive podcasts, view webtv, play games, and a lot of other things that I considered cool. So my modest adventure with Freevo, GNU/Linux and a lot other free software begins…

Introduction A media center is a special type of computer conceived for your living room rather than for your office. There are several models of media center available on the market and most of them are based on the Microsoft Windows Media Center Edition. Differently from a traditional personal computer, the interaction with a media center mainly flows through the remote control and the television screen. It is of course possible to add a wireless keyboard for writing text but most of the time a media center is used by one or more users enjoying content from separate sources such as DVD, Video CD, digital video cameras, FM radio, analog/digital terrestrial TV or satellite TV, network streaming and, of course, the local hard disk. Differently from a traditional personal computer, the interaction with a media center mainly flows through the remote control and the television screen

What hardware you need Assuming you want to build your own media center, the ingredients you need are of three types: hardware, software and connectivity. Your media center will gain a lot from a LAN connection which is useful for management tasks and for receiving media streams from the internet. Regarding the hardware the essential components are: motherboard, CPU, RAM, disk, video card with TV/OUT, audio card, TV/FM card, network card, CD/DVD player and a remote control with IR receiver. Of course you can add a lot of optional components like a DVD writer and USB memory readers. To build an effective system you need a minimum CPU power for video encoding/decoding. Buying an Intel Core Duo with 2GB of RAM is a viable choice, but in my experience you can save a lot of money reusing some old hardware. I’ve assembled a system with Pentium III processor with 320MB of RAM and I found that for video encoding/decoding this configuration is powerful enough. If you don’t have any old PC to cannibalize, you can buy a mobo/CPU/RAM for less than 100$ on eBay and get your system done. I’ve assembled a system with Pentium III processor with 320MB of RAM and I found that for video encoding/decoding this configuration is powerful enough GNU/Linux helps to make your old hardware run again. It’s always possible to optimize GNU/Linux, while Windows XP is too resource consuming. Another proprietary alternative for old hardware is, as usual, Windows 98, but would you venture to make it your OS? I wouldn’t. Thus, for my media center I’ve acquired

What hardware you need

75


Issue 16 the following: • Microstar mother board with Intel P3/800MHz • 320MB of RAM • Matrox Millennium graphics card G400 with dual head • A DVD/CD combo player • A PCI network card 10/100 I also added some special purpose components for the media center: • Technisat TS35 Remote control with IR receiver • Hauppauge WinTV GO tuning card

The distro the kernel and the screen Inside the galaxy of GNU/Linux I have chosen Fedora. The reasons behind this choice are absolutely disputable: my first Linux installation was a Red Hat 4 and I’m too lazy to evaluate other distros. About the screen, unless you want to buy a 26” VGA LCD you need to use your TV. Driving the TV out from the Linux kernel may cause some problems. First, you need a video card with TV out (this is obvious); second you need to activate the TV-out function in Linux (not so simple). After some searches on the net I discovered that among old cards, the Matrox Millennium G400 TV out setup is well documented. To use the G400 with TV out I needed three main tools: • kernel sources to be recompiled (sigh) • fbset • matroxset The TV out can be activated using the framebuffer device, and for this reason I needed to recompile the kernel. Recompiling the kernel is not a difficult task, but making the wrong changes in the configuration can cause your machine to become unbootable. This is not irreversible, because you can always reconfigure the system to boot from an older kernel, but this recovery may require some knowledge. Please refer to online documentation. In my kernel compilation I needed the followings settings: • Code maturity level options→Prompt for development… • Processor type and features→MTRR support • Character Devices→I2C support→I2C support • Character Devices→I2C support→I2C bit-banging interfaces • Character Devices→I2C support→I2C device interface • Character Devices→Matrox g200/g400 • Console drivers→Frame-buffer support→Support for frame buffer devices • Console drivers→Frame-buffer support→Matrox acceleration • Console drivers→Frame-buffer support→G100/G200/G400/G450 support • Console drivers→Frame-buffer support→Matrox I2C support • Console drivers→Frame-buffer support→G400 second head support You can find these settings in different positions depending on the version of the kernel you are recompiling. I’ve statically compiled every piece of the kernel that dealt with the Matrox card; however, doing so is not strictly necessary. After rebooting with the new kernel, I have configured the framebuffer devices in the following way: matroxset -f /dev/fb1 -m 0 # this disconnects fb1 from outputs matroxset -f /dev/fb0 -m 3 # this connects fb0 to both outputs matroxset -f /dev/fb0 -o 1 1 # this sets fb0 to PAL output

76

The distro the kernel and the screen


Issue 16 With these settings the dual head card sends the output signal to the TV. To adjust the screen resolution you can use the fbset tool. fbset -fb /dev/fb0 -xres 800 -yres 600 Now you get the TV PAL signal correctly generated and driven by the Linux kernel. As you can see, getting this card to work is not a trivial task and this is a common problem with Linux.

The tuning card The tuning card is the component which receives the TV radio signal from the aerial and makes audio/video available to the system. Tuning cards with BT878/BT848 chipset are well supported—keep this in mind if you have to buy a card. A great site to visit if you want to know more about Linux and TV is linuxtv [1]. In this site you can also find a large list of cards with BT878/BT848 chipset [2]. In my case, I’ve purchased (from eBay) an analogic TV board: Hauppauge WinTV Go. In Italy, analog terrestrial, digital terrestrial and digital satellite TVs are now available. Satellite TV broadcasters offer better TV shows, sport events and recent movies but they are quite expensive. The digital terrestial has not yet replaced the old analog system which still carries the main TV shows. Once you have plugged your tuning card into the system you can simply test it using tvtime (figure 1).

Figure 1: tvtime running under twm

The remote control You need a remote control for your media center. Although there are some solutions to control the system via bluetooth or wi-fi, I’m convinced that IR control is the best. So I’ve retrieved a Technisat remote bundled with a IR receiver to be plugged in the serial port (figure 2). To get an IR receiver like that you have two options: you can either build it yourself following the instructions available in several blogs, or you can buy a receiver already assembled. If you don’t have enough time to build your own homemade receiver, have a look here. To make your remote/receiver work with GNU/Linux you need to install the Lirc driver [3] which is packaged for the main distributions. In my installation I’ve installed: • lirc-lib-0.7.2-49.rhfc3.at • lirc-devices-0.7.0-1.rhfc3.at • lirc-0.7.2-49.rhfc3.at • lirc-lib-devel-0.7.2-49.rhfc3.at • lirc-kmdl-2.6.12-1.1378_FC3-0.7.2-49.rhfc3.at

The tuning card

77


Issue 16

Figure 2: Remote control and IR receiver to be plugged in the serial port Notice that lirc-kmdl-2.6.12-1.1378_FC3-0.7.2-49.rhfc3.at is good for my kernel because I have that exact version (2.6.12-1.1378). Once you have lirc installed you should find among your devices: /dev/lirc

or maybe /dev/lirc0

If the device is not listed in the /dev directory then there is a problem with the driver loading. To face this problem I typed: modprobe lirc_serial

and I got resource busy. Googling back and forth I found that the command: setserial /dev/ttyS0 uart none

was a good fix. Then by retyping: modprobe lirc_serial

I’ve successfully created the device /dev/lirc0. At this stage I launched: mode2 /dev/lirc0

and started to press the remote control buttons getting some printouts in the console: pulse space pulse space pulse space pulse space pulse space pulse space

871 839 848 840 848 839 848 90856 850 843 902 788

Bingo! My remote/receiver set was working. mode2 displays the features of the wave form received by lirc. If you prefer a graphical user interface you can use the xmode2 tool.

78

The remote control


Issue 16

Freevo Once you have the hardware working with GNU/Linux, you need a good front-end to control the media center. In the GNU/Linux world there are two options which differ mainly for the design choices and for the internal implementation: MythTV [4] and Freevo [5]. MythTV is a solid piece of software written in C++, while Freevo is a python wrapper which delegates a lot of work to external tools. For example, Freevo uses mencoder for TV recordings, xine for DVD playing, tvtime for watching and mame for videogaming. MythTV implements most of the media playing functionality itself and among its features it performs live TV time-shifting, allowing the user to skip commercials or to pause the show in case of phone ringing or roast burning. These two features would be enough for the average couch potato to choose MythTV. Nevertheless, Freevo is a very interesting and modular platform. This also allows beginner programmers to hack Freevo and to participate in the development. For these reasons, I decided to install Freevo. Freevo and MythTV are the two main platforms for PVR (Personal Video Recording) under GNU/Linux

Figure 3: Freevo running in my Linux box. The output PAL signal from the graphic card is sent to the TV. In this picture the screen resolution is not yet optimized as there is a black strip on the right side Freevo is packaged for mainstream distros and it is easy to install from sources too. The main dependencies are: • python2.4 • pygame • mmpython • egenix • twisted • libexif • tvtime • mplayer • xine • pylirc • lirc • xmltv • aumix • lsdvd Once installed and launched, Freevo shows a user interface with a very nice skin. From the menu you can activate the main functionalities like watching a video or setting a TV recording. Freevo also provides a web server, which is very useful for browsing the disk, working on media files, or setting new TV recordings from a laptop connected to your domestic LAN. It is especially useful to work on the system while the TV screen is busy with a movie or a game. Having Freevo connected to the LAN also allows you to receive podcasts, webcasts, and allows maintenance and any futher adjustment via SSH.

Freevo

79


Issue 16

TV recordings and XMLTV One of the main components of Freevo is the recordserver. It runs in background and is based on mplayer/mencoder. In the file local_conf.py, you have to set a number of options for mencoder to effectively record your favorite shows. An example of mencoder settings is shown below: VCR_CMD = ('/usr/bin/mencoder ' + 'tv:// -tv driver=v4l2:input=0'+ ':norm=PAL' + ':channels=%(channel)s' + ':chanlist=italy' + ':width=320:height=240' + ':outfmt=yv12' + ':device=/dev/video0' + ':adevice=/dev/dsp' + ':audiorate=44100' + ':forceaudio:forcechan=1:' + ' -ovc lavc -lavcopts ' + 'vcodec=mpeg4' + ':vbitrate=1500:' + 'keyint=10 ' + '-oac copy ' + '-ffourcc divx ' + '-endpos %(seconds)s ' + '-o %(filename)s.avi ')

No commercial/closed solution can give you the power and control to add and remove features like a GNU/Linux based media center The resolution of 320x240 is quite low. Nevertheless, the size of generated AVI files is quite big: about 1GB for less than one hour of TV show. The encoding may appear ineffective if you are used to encoding an entire movie in a single 700MB volume. But consider that, in this case, the encoding is performed on-the-fly while DVD to DivX/Xvid encoding is usually performed in two steps (and can therefore be much more efficient in terms of size). In Freevo you can schedule a future show for recording in two ways: manually saving date, channel and duration of the TV show, or by using the XMLTV listings. The first option is clumsy and tedious to do with your remote control (it is a little better using the web interface), while the second is much more user-friendly. XMLTV [6] is a toolset that grabs TV listings from the web and convert the information into a unified XML format. Grabbers are Perl modules which connect to various web sites (the data sources). XMLTV acts as an interface between the data sources and the applications. These are supposed to take the XML and present the listings through the most appropriate user interface.

Conclusion

Figure 4: My son loves Freevo!

80

Conclusion


Issue 16 I have successfully installed and integrated a podcast reader, a list of webtv, an email reader and the mame emulator Building a media center from scratch is a fun activity. In my box, I have successfully installed and integrated a podcast reader, a list of webtv that are browsed exactly like other media, an email reader and the mame emulator. It was an enjoyable exercise of design, practice and hacking. But, I won’t venture to say that it’s easy and inexpensive, because, even if you save money reusing some old computer components, you spend a lot of time reading docs and trying to get everything working. Moreover, the results I got were not at the same level as with an off-the-shelf media player. For instance, my G400 lacks some brightness, the screen resolution is not optimal, and every now and then the system crashes. Another negative remark is that my Freevo box is based on a common PC architecture; thus, the power consumption, the cooling system and boot time are affected. All these issues can be successfully addressed by buying fanless hardware specifically designed for multimedia computers (like Via EPIA motherboards, which come with native mpeg2/4 coding). The positive aspect is about features: no commercial/closed solution can give you the power and control to add and remove features like a GNU/Linux based media center. Furthermore, all of the above problems can be solved by further hacking the system or upgrading the hardware. And they have not prevented my family from being happily entertained through the use our home-made Freevo box.

Bibliography [1] http://linuxtv.org [2] http://linuxtv.org/v4lwiki/index.php/Cardlist.BTTV [3] http://www.lirc.org [4] http://www.mythtv.org [5] http://www.freevo.org [6] http://xmltv.org/wiki/

Biography Davide Carboni (/user/16" title="View user profile.): Davide Carboni holds a PhD in Computer Science. He is currently employed as "senior software engineerâ… at the Center for Advanced Studies, Research and Development in Sardinia (CRS4). His research interests are in the field of peer-to-peer systems, distributed computing, web applications, and agile software engineering. He runs his blog in http://powerjibe.blogspot.com (http://powerjibe.blogspot.com)

Copyright information Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. Source URL: http://www.freesoftwaremagazine.com/articles/a_media_center_based_on_gnu_linux

Bibliography

81


Issue 16

82

Bibliography


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.