Sunday, February 27, 2011

GUIs: Who Needs Them?

In early 2007 I began playing around with the idea of doing everything from the command-line. Not command-line in GNOME mind you, but command-line without X running at all. I switched my computer into init 3 for at least a week, and I was able to do tasks like coding, chatting on MSN messenger, IRC, browsing Wikipedia, watch videos and play audio files all from the terminal without having a graphical session at all. You might be wondering how you can do all of these in a world of only text, but I did it.

Web browsing was the biggest priority for me, and as a result I found a few basic web browsers you could use. They do not load graphical images in themselves so all you do is read text, and page layout is significantly different on some sites. The main program I used is called elinks. It is very simple to use, and pretty straight forward.

For chatting with friends I was able to use a program called centerim. It supports multiple chat protocols such as ICQ, Yahoo!, MSN, AIM, IRC, Gadu-Gadu, and Jabber (which means Google Talk is supported with a little work). At the time I only used MSN and IRC, and for IRC I used another program called irssi instead.

The coolest part was being able to watch videos. The program you use for this is good old mplayer. These days it takes tweaking to get it working in proper order, and I am still trying to figure out how to get audio working on videos under root. When I did it, I was using Fedora Core 6, and all I needed to do was become root, and I had color videos rendered just as well as if not better than on the graphical desktop. I think the reason it doesn't work now is I need to tweak a few things to have root interact with pulseaudio. Mplayer worked much the same way for playing mp3s and other audio files that you would use.

You might wonder what are the advantages to doing things this way. Number one you will save tons on memory and CPU cycles if those are important to you. I could probably slim my memory profile down to less than 256 MB on boot in init 3. The other thing is how cool it looks when all you have is black and white text which only you know how to operate with all the commands unknown to most everyone else. If you have questions about how to get other tasks done on the command-line feel free to leave a question in the comments area.

Wednesday, February 9, 2011

FreeBSD: I got it working finally.

I want to apologize for straying off on to philosophical and personal tangents with this blog. Part of an apologize is repentance. With that I have a slight review of FreeBSD and a little bit about how to make it user friendly after initial install.

About five years ago was the first time I heard about FreeBSD. I was a new Linux user, and I was soaking up all the information I could about Linux and Unix. FreeBSD is a continuation of the code base for BSD Unix which became popular in the 1970s and 80s with several universities and companies. Its demise in popularity came about from the Unix related lawsuits of the late 80s and early 90s. In the early 90s the code base was ported to the 386 processor (the first 32-bit chip for personal computers) and FreeBSD was born. It's kernel is a micro kernel where different services such as internet protocol are plugged in as a server to the kernel rather than apart of the kernel itself like a monolithic kernel like Linux. For determining which is a better design you can do some digging and use Google because I have no opinion.

After I heard about FreeBSD I downloaded it and wanted to give it a shot. The downside was it didn't want to easily coexist with my Linux partitions so I left it alone for the next four years. After virtual machines became popular I started playing around with it in Qemu which comes default on Fedora, but it refused to work so I left it alone another year.

After I went home this break, my uncle introduced me to VMWare Player. This is free from VMWare, and it supports several operating systems. Considering my role as a network administrator it is a very useful tool. I have lately been working on making a virtual machine to function as a backup for basic operations when our server goes down at school. If the server goes down, I just leave my laptop in a convenient spot and boot up the virtual machine. I can then work on bringing the system back up without twenty people telling me the internet is down.

I decided to give FreeBSD a shot once more. This time we had success. I used most of the default options and tried to install most things I thought I would use or tinker with at least. Everything worked, but it only left me with a command-line. No problem for me seeing I love using the command-line. At the same time though I want the graphical portion to work also. This is what took some work to get setup. The first thing you need to do is install Gnome and GDM. Gnome is the default environment for Fedora, Ubuntu, and Debian among others. It normally has a menu at the top left of the screen, a clock in the top right, and task bar on the bottom. GDM is where you login at once the system has started. For GDM to start on startup I had to manually edit the /etc/rc.conf and add the line gdm_enable="YES". After that no users popped into the users box. With a little digging I found out I needed to add procfs to fstab. After that graphical was all working.

Updates are painfully slow. They have many advantages such as saving space by compiling support for only what you need or making it as versatile as you want. Compiling several updates took me a whole week on and off and letting my computer run. Part of the delay involved the need for checking which options I wanted compiled on every package in the segments of the process rather than it all being up front.

My recommendation is FreeBSD is not for the faint in heart. This is something for the advanced user to tinker with or someone with a great deal of patience. If you want to play around with it there is plenty of documentation for it. I may do more with it; I may not.

Monday, February 7, 2011

The Howto on Being And Making Linux Users

When I first became a Linux user, I wondered how will I master all of this information. Can I actually use this operating system for everything? Obviously the answer to that question now is yes. Everyone goes through this period when they begin migrating to Linux. The process for becoming a Linux user is the same one you want to put others through to make them Linux users. Your goal is to become an independent user. What do I mean by that. You need to be able to fix your own problems. You need to be able to set up your own printer, wireless drivers, and make whatever other tweaks you make.

At first you are always confronted with problems. The internet doesn't work. The display manager isn't behaving like it does for your friend. Wine refuses to run that program I need so badly. You need to quit viewing these things as problems, but instead as learning opportunities. These problems give you a chance to become acquainted different components in Linux. Internet not working gives you a chance to better understand your network devices and wherever the problem is at. Gnome misbehaving has the advantage of you're not only fixing it, but also of a knowledge of how to customize it to your liking. As for wine I am still looking for advantages to working with problems on that, but have not found any yet. Remember these are learning opportunities for your own good.

The next thing to remember is not to have your Linux savvy friend do everything for you. This is bypassing the whole independent process. Your friend already knows how to fix things and this just extends his knowledge a little bit compared to you learning a lot from a simple problem. This is how you eventually give up on using Linux because supporting yourself is a requirement of using it. Your Linux savvy friend will not always be with you. When a problem arises, try to fix it yourself first and avoid going to your friend until you have run out of options, and I do mean run out of options.

Make Google your friend. You would be surprised how much I use Google to get help from the online community. You might wonder how is that different from asking help from your friend. It's different in that you have to learn how to use some of the things suggested as fixes unless you use a script someone else wrote. In learning different commands you figure out how to navigate the command line, use man pages, edit configuration files, etc. You do these things yourself, and you figure out how to use your system to its full potential. The Linux community knows how to help people by teaching them.

Now to the making users portion. Never ever let your new user be lazy. Get them thinking about how to solve the problem. If they want your help, do not run over and go fix the problem. Give them advice they can implement and let them do it. The only time you want to help them is if they just installed and they are having a multitude of problems and are not committed to using this thing at all. If they are committed, only teach them. Do not do for them. Sometimes they will get impatient. In moments like these lift your finger only a little bit, and it satisfies them. Do not go to far to help them as it only acclimates them to being lazy again. The best thing you can do to help them is get them to help themselves. The idea that giving a man a fish helps him eat for a day, but teaching that man to fish enables him to eat for a lifetime. The same holds true for Linux.

The advantages to this approach last. One friend of mine is naturally independent and when we got Linux working on his computer, he took off with it asking for my help only when it was absolutely essential. He has since taught others and made Linux users out of more people. Another friend of mine was working with me in a canvassing program, and I peaked his curiosity. We attempted to install Fedora on his machine before the program was over and failed. We parted company, and unbeknown to be he still tried to get it working and did. He had more questions about how to get this and that working to which I was hesitant to answer as that is part of the process. Needless to say he got impatient and fixed it himself. He is now using Linux solidly and has converted others to using it too. The approach works with those who are committed, but those who are not fall by the way side. For those it does work with, they become a help rather than ones who need help. They even help you with fixing your problems.

This is the process. The goal is independence, and when this is achieved, your work has been accomplished. You are now a true Linux user, and whoever you work with will be also.

Tuesday, February 1, 2011

Applications: Where are they?!

When I first started using Linux, it was late 2005. The distro was the hailed Fedora Core 4. I was thrilled with the prospect of actually using this operating system I heard so much about. In the packages section I checked off all the interesting applications and utilities I wanted installed. One of them was gcc and g++. Much to my surprise after everything installed it wasn't in my applications menu. You may know where I am coming from. What you need to understand is that there are two different types of user interfaces. One is a graphical user interface which we will call a gui from here on; the other is the command-line interface which we will just call CLI from here on.

CLI and the GUI are fundamentally different. The GUI is driven by the invention of the mouse and its involvement in the user experience. This is what powers your word processor, internet browser (if you are not on the command-line using elinks or lynx right now), movie player, etc. If you don't understand what a GUI is, chances are you are using it or you are an Unix user who just woke up from 1983 who somehow knows what the internet is without encountering a GUI yet. All of your day to day applications are GUI driven.

CLI is a very simple but powerful interface. If you ever saw a DOS prompt or Linux terminal, this is a CLI. This is officially the true hackers, crackers, and script kiddies playground. Hackers and crackers enjoy it the most, but it isn't only for them. Command-line has lots of useful tools for obtaining information on the system such as networking, CPU architecture, processes, file systems, etc. Most Linux/Unix utilities are written for the command-line only. gcc and g++ are two examples of command-line only programs. The reason I didn't see these in the applications menu is they are designed to be used from the terminal.

After I made this discovery I quickly found out how to use gcc and g++. It took me a little longer to learn how to execute the executables they produced, but everything worked out eventually. The best thing you can do to learn this environment is use google and the man and apropos commands. To find the different programs you may want to use look in the /bin, /usr/bin, /usr/sbin, and /sbin folders. Then to find out more about that specific command type in man command. Another great place is the Linux Documentation Project (www.tldp.org).

Using the command-line will seem weird at first, but it is very rewarding. I can find my IP address for any given device with only one command in comparison to three or four mouse clicks in Windows. I can kill an offending process with only one command and 3 sequences of keystrokes. I can do updates with only one command. Bottom line it is far more efficient to use, and if I want to save myself from using a series of commands repeatedly I can always write a shell script to streamline the process.