Thursday, April 16, 2009

Linux, Ubuntu, and File Permissions

For the last week or so, I have been getting more and more comfortable with Ubuntu. I have pretty much figured out the package manager Synaptic and how to install new programs onto my wonderful non-Windows machine.

During installation of any new software through Synaptic, Ubuntu asks for the root password of the machine to actually do the installing. I guess this is a precaution to disallow any other user from installing software that is not meant to be on the machine. Which is a great feature so my wife doesn't muck up my new machine.

I guess Ubuntu by default creates two user accounts during installation which are one user account and one admin account (user root). So apparently when I am playing games and cruising the web, I am actually in my user account and not in the root account. From my readings, Ubuntu does this to protect us from completely screwing up our system, having software inadvertently downloaded to our machine, and/or accidently altering our settings.

For each user, Ubuntu sets up a directory called "/home" which is like a "My Documents" folder on a Windows OS. In this directory the user has full read, write, and execute permissions for every file. Nothing new there.... I am still doing ok.

But.... Everything outside of that directory is "owned" by the root user. And to modify, or execute a file in most every other directory you will need to either change the directory permissions, login as root, or use the "sudo" command which stands for "super user do".

So for instance if I wanted to edit a config file in the /usr/bin using gedit then would have to use the command "sudo gedit" + the filename.

I ran into this issue when trying to install Xampp (which is a web server) into the /opt directory which was owned by root. The solution that I came up with was to use the "chmod" command to set the permission of the new directory, /opt/lampp, so that all users could use it. The actual command I used to do this was "sudo chmod 777 /opt/lampp". The 777 part of this command gives the owner, group, and everyone else the privileged to read,write, and execute the files in the directory.

I know that I most like made some Linux gurus cringe by setting the permissions to 777, but really I am the only person to using this machine so I am not horrified about it. Of course I am always willing to hear about other permission based solutions. So drop me a line if you have a better way of doing things.

Even though I ran into this issue and it took me a little time to figure out... this file permission thing really does make good sense. I can think of a ton of uses for it and as soon as I learn more about "groups" I will setup my system so it is more secure.

Wednesday, April 15, 2009

Kick Ass Community

Did I mention that the Linux community is absolutely awesome?!

I my quest for a good guide on the command line and Ubuntu, Lev dropped me a great little link to a handbook on how to get up and running with Ubuntu. I haven't had the chance to really dive into it yet, but just thumbing through it I can already tell that it is a great resource. And just like most things Linux ... it is free!!



Lev also gave me a little heads up as how to improve the appearance of my desktop from that U-G-L-Y standard theme that comes with Ubuntu.

The site is www.gnome-look.org which is a free site in which you can download some new "eye candy" for your linux box. There are a ton of themes in there, and I am still in the process of figuring out which one I want to go with, but I think it is safe to say that any theme is better than my current one.

Thanks Lev... you da man!!

Tuesday, April 14, 2009

First Problem - LinkSYS-N WMP300N and ndiswrapper

Ran into one of my first "linux-y" problems today. I installed a Linksys-N WMP300N PCI wireless card into my new computer and Ubuntu failed to recognize it. :(

I jumped back to my old laptop (still running Windows) and searched the forums for about an half an hour until I can across a post that walked me through how to get this card working.

For the most part, the good people at Ubuntu, has really good hardware support. I guess that when "newer" hardware does come out it does take some time to catch up and get Ubuntu to automatically recognize it. So I am not discouraged at all by this.

The post I found said that I had to use a little piece of programming called ndiswrapper which apparently is a wrapper (hence the name) for a lot of window drivers. Which is good to know since I can easily foresee this problem coming up again perhaps for a video cards or something. Here is the link to the post that I had to follow:

http://ubuntuforums.org/showthread.php?t=340689

Of course, the post calls for me to download some files off of the net.... and of course, I CANT! But it worked out because the file that I needed, ndiswrapper, is also located on the LiveCD so it was just a matter of finding the file and installing it.

One thumbdrive later, I had all the files that I needed and the step-by-step forum tutorial worked like a charm.

I did have to use the command line and it wasn't too bad to be honest. I still need to find a good tutorial on the subject of commands so if anyone knows of one the please leave a comment.

I had a very complex and strange run of emotions during this process.... it was part terror that I would complete screw up my OS, frustration of not really knowing what I was looking for, confusion in wondering if I was doing anything right, and pure exhilaration!!! I was having soooo friken much fun.

For those of you who are on the fence with Linux..... come on over the water is warm and inviting and the community is absolutely awesome. I kindof feel like I am part of a club, group, society... whatever you want to call it.

This is just awesome! Can't explain it any other way. :)

Monday, April 13, 2009

Installing Ubunutu

Over the Easter weekend I installed Ubuntu and I must say that it was a fairly straight forward and easy process. I am glad and relieved to be honest as I thought Linux will be more problematic simply because many of the hardware drivers a designed for Windows and not Linux. Kudos to the Ubunutu team for all of the hard work in making sure that a lot of the hardware will work with this awesome OS.

My first impression of the Ubunutu system is that the default desktop is awful! Just plain ugly! So my first order of business was to change the background pic to one of my daughter. Once I did that I was very impressed with the layout of my new open-source non-Microsoft operating system.

What I especially like is how clean the desktop is with no "trial" software to be found, unlike the Windows. Sorry to get back on my Microsoft-bashing soap box, but don't you find it ridiculous that you pay a huge amount of money for MS Windows and then spend at least an hour removing all the trail software off of it. I mean really... talk about greed! Anyway, back to Ubuntu.

The next thing that I really like is the layout of the menus... very simple and straight forward. One for Applications, Files, and Settings. It was very easy to find and setup my new operating system to how I wanted things as well as to see what type of applications I could immediately begin playing with. I played a game of "Robots" to break in my newly installed OS and quickly got addicted to it.

I only got to play with my new system for an hour or two before my in-laws rang our doorbell, so I wasn't able to dive deep into the OS but so far the speed is outstanding as it only took about 30 seconds to boot up and the responsiveness of the programs, in my opinion, is far superior to the Microsoft driven computers that I have used in the past.

Two thumbs up. :)

Thursday, April 9, 2009

Partitioning the Hard Drive for Ubuntu

Setting up Linux on a new hard drive is not as straight forward as a Windows based machine, but it actually has some clear cut advantages.

The most important advantage to me is that you get an opportunity to break your hard drive up into chunks and install different portions of Linux onto those chunks. This is called partitioning your hard drive. Why is this important? Well because if we do this properly we can separate the operating system from our user data and files.

Therefore if our system gets corrupt then we can simply re-install a fresh copy of Ubuntu onto the partition that held our OS and we are back up and running with all of preferences set to what there were pre-crash as well as any personal files that we had. This is drastically different than MS windows where if the OS crashes we would scramble frantically to get Windows to boot in safe mode to get our files and then overwrite the entire hard drive to reinstall the OS.

When partitioning the hard drive you can break it up into four "primary" partitions and then you have the option to break each "primary" into "logical" partitions.

This seems pretty logical, so what I did is I created 3 different primary partitions:
  1. / (root)- size:20GB - this partition will be used to hold the OS
  2. / swap - size:8GB - this is the section that the memory uses to hold data if it needs it
  3. /home - size:10GB - this partition will hold all the user data for the installed applications
  4. /data - size:20GB - my secret stash of disk space to hold my important files
I further create a few sub-partitions on the /data partition to further segment my files and data. I left the rest of my 500GB drive as an ext3 format.

During the Ubuntu installation process, the setup wizard will ask you whether or not you want to have this partition "mounted". If you want to have access to these partitions through the file managers then you should say "yes". Otherwise you will have to manually mount any partition you want to use. So consider your choices carefully.

This step took me about 2 hours worth of planning before I actually went ahead and did it. I guess an ounce of planning is worth the effort because now I am protected in case (when) I crash my system and need to start fresh.

If anyone needs a good source of information, here are the sites that I visited to make my decision:
  1. https://help.ubuntu.com/community/HowtoPartition/PartitioningBasics
  2. http://www.psychocats.net/ubuntu/partitioning
  3. http://ubuntuforums.org/showthread.php?t=282018
Link #3 is by far the most valuable link in my eyes... I just used this information to make 90% of my decission.

Choosing a Linux Distribution

Which Linux Distribution Should I Use?

When it comes to open-source operating systems you would think that there would only be a few choices. I was pretty amazed to find out that even in the land of Linux there was many different views on what makes the ideal operating system or what is known as a "Distro".

If you are interested in learning about the different types of distributions out there you can check out:
  1. Wikipedia - List of Linux Distributions
  2. DistroWatch - A good site to see which distributions are the most popular
Since I am a complete Noob with Linux I decided to look for the most popular version of Linux, one that has a very strong community to help me when I crash my system, one that makes installation a snap, and one with a strong package manager.

After researching the different distributions I finally ended up choosing Ubuntu. What I like about Ubuntu is that it commercially sponsored even though the OS is offered for free. That means that it will be continuously be improved upon and hopefully in the future is will be so feature rich that people will flock away from Windows :) Also the folks at Ubuntu provide an Educational version to help children learn about computers and helps supports educational institutions. Not a huge selling point, but I since my entire family is made up of teachers... it is nice bonus.

Since I am using an Intel Duo Core 2 processor, I have decided to download AMD64 ISO for installation to take advantage of the multi-core processing power of Ubuntu. From what I read there are a lot of packages (software) that can have some problems using the AMD64 framework, but given enough research I am sure that I can overcome these issues.

Once I download the ISO, it needs to be burned to a CD as an image. This is very important, I fell into this trap once before when I just burned a "data" CD. I am using a free software called InfraRecorder for this and it handles image files beautifully.

Not that I am geared up with my Linux Distro on a CD... I am ready to install. (My hands are sweating a little bit)