Monday, September 22, 2008

Way of the Penguin

Linux.

That's an interesting word. Have you heard of it? Maybe you have. Maybe it's floating around somewhere in the back seat of your subconscious, lurking in the shadows. You know it's there, you've heard of it, but you just don't know what it is, or what it looks like. Or maybe you have. In a lecture somewhere, perhaps. Or maybe you've read about it online. You know, that operating system. The free one. You do know it's an operating system right?


Tux, the Linux mascot,
tends to hide in the shadows

Well, anyway, if you said yes, you'd be wrong.

Technically, "Linux" is the kernel of the operating system, first written by Linus Torvalds when he was a student, back in 1991. But hey, we don't want to nit-pick, so for the purposes of this post, we'll just use "Linux" to generically refer to that whole group of OSes that use Linux as its kernel. You might have heard of some of them before, Ubuntu, Fedora, Debian, openSUSE... any one ring a bell? Or hey, you might even be running Linux on your computer right now. If so, good for you!

The thing is, not many people are using Linux at this point in time. Correspondingly, not many people have even heard about it, much less used it. As such, Linux is still out there, lurking at the fringes, and sometimes peeking its head out a little. Unfortunately, Linux still isn't really what you might call "mainstream" at this point, and what this means, is that a large majority (including even SoC students) of the population is unfamiliar with Linux, and what it is, or what it looks like or what it can do. And we all know people are afraid of what's unfamiliar to them.

So tell you what. Let's use this post to bring Linux out into the light. Don't be afraid, Tux won't bite.

Maybe I'll start off with a little myth that I've heard about Linux in general. Mention Linux to Joe User on the street and you'll probably get the opinion that Linux is only for geeks and technical users. They say it's difficult to use command line based, and all around user unfriendly. Does that scare you? An OS that is "techical"? Wait, which faculty did you say you were from again? Oh, the School of Computing. The School of Computing? And you're afraid of getting your hands dirty with technical details? All right, in my next post, I'll let the Dentistry students know to stop looking at teeth, all right?


Compiling software on Linux.
Who's afraid of the big, bad terminal?


Jokes aside though, that's outright wrong. Today, Linux-based OSes have progressed to a stage where their graphical user interfaces (GUI) are as, if not more, user friendly than either of the other two market-leading OSes. People tend to judge on appearances, hence, how good or bad something looks, determines what people think of it. Granted, earlier versions of Linux might have been seriously butt-ugly, but not any more. Allow me to show you what I mean.



This is Linux
Screenshot by STAR_LIGHT2007 on Flickr





And so is this
Screenshot by enlightener on Flickr





Oh, and this too
Screenshot by Vulturo on Flickr




Guess what this is. Definitely Linux.
Screenshot by Filip Knežić on Flickr

(For more eye candy goodness, check out Flickr)


Ugly? Command line only? Difficult to use? Really?

Well, of course, eye candy alone does not make a good operating system. What's the use of looking good if you don't have the substance to back it up, right? People often ask me, "So, what's so good about Linux anyway? How does it compare to Windows, or OS X?" Usually, they're worried about ease of use, and more importantly, compatibility with the other OSes. For students, it's usually worries about being able to use Linux for their assignments, whether its able to handle the Microsoft document formats and so on. I tend to use myself as an example most of the time in my replies. I've survived four years in NUS, including one year spent abroad, and I've never had any problems with submitting assignments or reports of any kind. Most Linux distributions come with the requisite software out of the box to get almost anything you'd want done. OpenOffice churns out documents and reports, GIMP does decent image editing, and Pidgin handles all your instant message needs without breaking a sweat. Oh and just for the Computing students, you'll be delighted to know that it's almost ridiculously easy to set up a development environment for your favourite programming language and/or framework in Linux. Java? Check. C/C++? Check. Python? Ruby (on Rails)? PHP? Perl? Erlang? Checkcheckcheckcheckcheck. Apache, Tomcat, Postfix, MySQL? Oh yes, indeed. Oh, and did I mention that even the most basic text editor provided in most Linux distributions has support for syntax highlighting and auto indentation for code?


Download what, ah?

I hear this most often during development projects. When we're about to begin coding, friends who are using other operating systems (especially the one developed in Redmond), usually start by running around the web downloading all sorts of packages from vendors' websites to get themselves going. All right, we need the MySQL server and MySQL Administrator from here, PHP from here, Apache from there.. and so on. And then of course, sometimes there's the "Eh, you got Dreamweaver? Can lend me? Got crack?" And once they've got them all downloaded, we start the installation doubleclick-yesyesyes-doubleclick-yesyesyes-doubleclickdoubleclick..

Linux users, comparatively, and contrary to common belief, simply need to point and click their way through a GUI, selecting the packages they want installed, hit Apply, and then sit back and let the machine download, install and configure the necessary software, all at one go. That's the best bit about using Linux and its related software, really. Thanks to the distributions' huge software repositories (stores of software packages usually maintained by the distribution's maintainers), Linux users are able to find almost any bit of software they need to get their job done with almost indecent ease. A sampling of the repository I'm looking at lists about 25,000 software packages, all of which can be installed via a simple point-and-click GUI.


Screenshot of the Synaptic Package Management GUI on Ubuntu Linux

And not only do you get easy access to loads of software, because software packages downloaded from the official repositories are digitally signed, you can rest assured that whatever you are downloading is reliable and trustworthy, and not riddled with spyware and what-not. Furthermore, because we're all about Free (as in speech) software, all the software packages found on the repository are unencumbered by restrictive licensing and are therefore great candidates for redistribution and sharing. No worries about hunting down cracked license keys there.


How to connect, ah?

Apart from being friends to programmers, Linux distributions also play nicely with remote servers. I once took a module in which we had to deploy our projects onto the Solaris Zones provided by SoC. Now, anyone who's worked with one of these Zones before, will know that just about the only way in to manage the files on the Zone is via ssh. Now that's all well and good until you realise that you'll need to edit the files on the Zone. How might you do this then? Should you copy the file onto your harddrive, edit as required, then copy it back to the Zone? That's all and good for a single file, but remember, you're dealing with an entire project here. Or perhaps, you could use one of the built-in editors in the Zone's environment and just edit them on the Zone itself. Anyone remember vi? Either way, such scenarios are too complex and aren't too appealing to most of us. Especially when we've got a deadline hanging over our heads, and two other projects due at the same time.

Thankfully, for those of us who need to deal with files on remote servers, there is a solution. Most Linux distributions offer a way to seamlessly mount a remote server such that it appears as just another directory in the file system. From there, copying and moving files between different machines is as easy as transferring them between two directories. Drag and drop easy, in fact. What's more, since the remote server is now represented like a local directory, code editors can now seamlessly open, edit and save remote files just as easily as they would local files. To the programmer, apart from a slight lag due to network latency incurred while saving the file, the fact that the file actually resides on a different machine is entirely transparent. What's more, most of the common network protocols are supported. You could just as easily mount a remote server over SSH, as you can FTP, as you can Windows file sharing and even WebDav. This of course means you save loads of time simply by not needing manually manage your files. Oh wait, did I copy that over? Maybe I should just copy it over again. Oh wait, do I have the latest version? You get what I mean.


Right-click menu showing option to edit a file
on a mounted remote server (simulated using a virtual machine)



Drag and drop copying of files from one
remote server to another


So how?

As you can see, there are indeed advantages of using a Linux system, as compared to other more "mainstream" operating systems. Of course, these are only two features, out of a host of many, many more, far too many to ever cover in a single blog post. However, the point of it all, at least, is to show that Linux is at this time, a viable alternative to the other OSes you find on the market. A large majority of people are afraid to venture into the unknown, and as a result, miss out on giving things like Linux a try. Now that I've introduced a few features of a Linux system that I find handy, perhaps you might find that you'd like to give it a try as well. As they say, don't knock it till you try it, you never know, you might like it!

Anyway, Linux really isn't a new thing to the computing world. Since its birth in 1991, it's been steadily growing in terms of functionality, stability and usability (and all other forms of -ity's). While you might not see it often on the consumer desktop at this point, it's handy to know that Linux has now become the server operating system of choice for a number of goverment agencies worldwide. The list includes the Swedish Armed Forces, the Government of Switzerland and the Government of Japan. The city governments of Berlin and Munich in Germany also announced that it plans to use Linux on all their desktops. The National Security Agency (NSA) and the National Aeronautics and Space Administration (NASA) in the USA also use Linux in their operations. And of course, the (most likely!) largest Linux user of all, Google.

Like it or not, Linux and other free and open source technologies are slowly gaining ground. For the pragmatic folk, if you're looking for a job in the tech industry after graduation, you know what you should be brushing up on. For the rest of us, it's always good to gain a little more exposure to available technologies instead of being locked into a proprietary monoculture, oblivious to anything else.

--
There are a number of ways to get started with Linux, and the easiest of which is via a LiveCD. A LiveCD is simply a Linux installation on a bootable CD. Just boot off the CD, and when that's done, you'll be running Linux. Not to worry though, LiveCDs won't touch the existing data on your harddrive, and the Linux environment you see is only temporarily loaded in memory. Take the time to explore the system, play around with the applications and take the time to get comfortable. When you've seen enough, all you need to do is to reboot your computer, remove the LiveCD, and you'll find yourself back where you started. One of the more popular Linux distributions, Ubuntu, provides a LiveCD for download. Should you wish to install Ubuntu on your computer, the live environment has a handy Install icon on the desktop that you can click to initiate the installation process. Needless to say, as with any other major operation on your computer, back up your data safely before you commence the installation process.

For more resources on Linux in NUS:
--
Notes:
  • With the exception of the screenshots taken from Flickr, all screenshots taken on Ubuntu 8.04 Hardy Heron.
  • If you'd like to reuse the screenshots from Flickr, I've linked them to their Flickr page where you can find licensing information
  • Screenshots used were licensed under forms of the Creative Commons license that allow reuse and have been attributed to their owners.

- Ruiwen

2 comments:

Anonymous said...

Anyone used to read 'Gamebooks'? There was a series known as the "The way of the Tiger", i think it is a 6 part series... /NG

Unknown said...

that is so coooool!! :]