Sunday, February 25, 2007

Operating Online

After looking at the new Google Apps, I started thinking of the future of online applications, and where you could go if you had an operating system designed to take advantage of that system.

What if each user owned one static ip and a "home server". This server would be built into their computer, and would not require any major set-up. The server would be used to store data from online applications and serve them out again when asked for by the user. The other option is to create centralized data-servers that you can rent to hold your data. (A distinct up-side to keeping your files on a local server is that you can access them even if your internet connection stops working.)

At this point, the only thing required of your OS is to run a web-browser and possibly store, send and receive files. By freeing up the need for excessive amounts of CPU, hard drives, and video, computers could be made smaller and cheaper and more portable. These "portals" could be set up in a library or a school at which point a user could access their files in an environment that would be almost indistinguishable from their home computer. Also, since it all runs through a basic browser, you could access your files ad applications from a standard computer as well.

I'm excited to see where this type of technology could lead, although I don't see being able to edit files that push 100mb over the net any time soon.

Saturday, February 24, 2007

Watching Television on the Internet

After making the switch to Desktop Linux, I have finally got around to figuring out what to do for entertainment. Getting DVD media to play was a breeze, perhaps because it seems to be the first thing anyone asks after getting their OS up and running. Of course, we should do our best to push for open formats to replace DVD, but in the real world a little bit of "closed media" is likely to keep people from actively using Open Source everything-else. If a computer can't fulfill the basic human need for entertainment, it won't last long.

My next place to turn was to Television programs. There are a few series that I have enjoyed in the past, and I just gave away my 23" television to free up some space in the apartmet, leaving me with a 13" TV that I have decided only to use for 8-bit Nintendo. Television over the Internet would be a sweet alternative. Some shows are available for "free" viewing on their official websites, others are not.

The shows I think I'm interested in viewing right now are: 24 (Fox), LOST (ABC), The O.C. (Fox), The Office (NBC), Prison Break (Fox) and Veronica Mars (CW).

I will chronicle my level of success in this endeavor here:

I asked my brother "So how does one watch TV on the Internet?" and off the top of his head he referred me to ABC's website. I want to say "well done" to ABC for their episodes available online. They have done a decent job and it seems like Flash player is all that is required, making it a trivial matter to watch their content in Firefox on Linux. This takes care of my need for LOST, and opens up the possibility to some new programs which at the moment don't look very compelling for me, but may be possibilities. The first episode I watched had the same commercial played in every single break. I wonder about the effectiveness of this, and would have rather seen three separate commercials, even if they were all for the same product, simply because watching the same thing three times within an hour is not more productive than seeing it once.

Next I turned to Fox. Obviously I'm a fan of Fox, I have my eye on three of their shows, and I have purchased more Fox DVD box sets than any other show. In fact, it may well be true that every DVD box set I own is produced by Fox. The programs they put out seem to be of a high quality. I looked up the web site for Fox, clicked on Prison Break, and saw an inviting link that I may be able to watch full episodes for free. It directed me to a MySpace page belonging to Fox, which was a bit surprising: I thought MySpace was home to teenagers, not corporations. I observed right away that the site wasn't as clean and streamlined as ABC's, but then I got confronted with a major problem:
We're sorry, but only the following operating systems are supported at this time:

Microsoft Windows 2000/XP (not Vista)
(Intel) Apple Macintosh OS X or later
(PPC) Apple Macintosh OS X or later

Please check back soon for support for other operating systems.
It seems that Fox also has its programs available on iTunes, but I hear they will only play on the newer iPod devices, and the free iTunes software is only supported on Windows and Macintosh. I read an interesting article about "DVD-Jon" and some of his buddies writing some software that would let you purchase songs at the iTunes store using Linux, but I think it only worked for music, and furthermore, it was abandoned and does not work with the current iTunes Store. I would pay Fox directly to watch these shows if I could. So it sounds like I may have to wait until the current seasons of 24, The O.C., and Prison Break are released on DVD (if they are.)

NBC doesn't offer any apparent way to play full episodes from their websites, and if they are offering them for viewing in other venues they are not making this obvious by advertising them in any way. They do seem to offer short video clips and deleted scenes, etc., but I'm not one for spoilers. I will investigate at a later time to see if they offer them through another outlet, but except for my academic curiosity to investigate this at a later time, they would have lost my viewership.

The CW has a full episode feature, which links to this page, but the center area of the page just remains a white box and selecting a series from the right-hand list doesn't seem to do a thing. Right clicking on the white reveals that it is a Flash player. I don't know why it is broken, but I will presume they aren't supporting the Linux version of Flash (I don't know how that is possible), but I will give it another shot later in case they are just temporarily down.

So it looks like ABC wins. Stay tuned for an upcoming article on why even their solution isn't the best choice and why Television producers need to make some decisions in the upcoming years.

Monday, February 5, 2007

Why do we sudo in Ubuntu, and who is Charlie Root?

It is a tradition in Linux and other Unix-like operating systems to have a superuser account named root. root is named such because "he" has full access to everything in the filesystem from the root directory "/" on down the line (whereas most ordinary users only have limited access with full access in their home directory alone.) root has a home directory too, named after himself, found at /root, not to be confused with "/" which is also called the root directory. :-) You'll notice that on most systems his home directory is not in the same place as the other user's home directories (usually /home/yourname).

In some Linux distributions, you log in to the root account frequently to perform administrative tasks on the machine, but in Ubuntu and a few other modern distros, this is not the case. Instead, we use a tool called sudo.

sudo means "switch user and do." There is another command called su (switch user), which can be used to switch to another user and open a shell, which is great if you know their password (which su prompts for), but on Ubuntu you aren't supposed to know the root password. That's right, that is how it is designed, and you should not change it unless you have a really good idea of what you are doing. The reason you don't know the root password on Ubuntu is that you don't need it at all because the admin group to which all "Administrator" users belong is listed in the sudoers list (/etc/sudoers) If I needed to change the owner of a file (hypothetically called myfile), and I need root access in order to do this, I would type:

sudo chown jeffd myfile

I will be prompted for a password. This is not the root password, but your own password. It is requested as a security precaution before proceeding to run the program with root access. After entering the password, the command "chown jeffd myfile" is executed as root, after which control returns to your ordinary user (subsequent commands are not executed as root, although if you sudo again within about five minutes, the Ubuntu defaults are set to not ask you for the password again.)

So what if you need to do several commands as root? In all the other Linuces, you just log into a shell as root. Well, if you really want to do this, you can either type sudo bash (to open the bash shell) or sudo su root (to open root's default shell). Either way, you will enter your own password and then be presented with a root shell prompt. When you are done with the shell prompt, type exit to return to your own shell. Do not forget this step! It is never a good idea to run applications or compile things as root. You should perform these tasks as your own user. In fact, some newer Linux software is designed so that it will actually refuse to compile or run as root, giving you a gentle slap on the wrist.

Again, please do not change the root password. Doing this will only weaken the security of your system, and make it easier for you to get into bad administrative habits.

If you are using gnome and would like to launch a graphical application as root you use gksudo instead of sudo, but it works the same way aside from its name and the way that the password prompt appears in a window.

Oh, one last thing: I mentioned Charlie Root in the subject. This is the full name sometimes given to the root user, when a first and last name are required (for example, in the address headers of administrative emails automatically generated by the system and sent to the root account.) I think this name is only used on BSD Unix systems, (FreeBSD, OpenBSD, and NetBSD), so you may not ever see it in Ubuntu, but because I was familiar with administering FreeBSD servers, it is still the name I affectionately call the root user by. Here's some more Charlie Root trivia.

Linux Kernel Modules

This brief post is designed to explain what a Loadable Kernel Module is.

In the beginning, there was the Linux Kernel. Linus Torvalds designed it so that the code you needed to operate the base devices on your system would be compiled into the kernel, after all, as Open Source Software, everyone had the capability (if not the skill) to recompile the source as needed.

Around 1995, Loadable Kernel Modules (LKM's) were introduced into Linux. While not entirely synonymous, these are about the closest things in Linux to what windows users would know as Device Drivers (something like Windows .vxd's)

An LKM is a separately compiled piece of source code, which is linked against the kernel you are running so that it is "pluggable" and can be enabled or disabled even while the base Linux kernel is running. To see what Kernel Modules you have installed you can type lsmod at a shell prompt. Here's what I see on my Dell Inspiron 6000 notebook (this list is a little long, but just skim it quickly so you get the idea of what is there):

Module Size Used by
binfmt_misc 13448 1
rfcomm 42260 0
l2cap 27136 5 rfcomm
bluetooth 53348 4 rfcomm,l2cap
xt_limit 3840 2
xt_pkttype 2944 1
xt_tcpudp 4480 28
ipt_LOG 8320 11
xt_state 3328 6
iptable_mangle 3968 0
iptable_nat 8964 0
iptable_filter 4224 1
ip_conntrack_irc 7920 0
ip_nat_ftp 4736 0
ip_nat 19884 2 iptable_nat,ip_nat_ftp
ip_conntrack_ftp 8816 1 ip_nat_ftp
ip_conntrack 53088 6 xt_state,iptable_nat,ip_conntrack_irc,ip_nat_ftp
,ip_nat,ip_conntrack_ftp
nfnetlink 8088 2 ip_nat,ip_conntrack
ip_tables 15204 3 iptable_mangle,iptable_nat,iptable_filter
x_tables 16132 7 xt_limit,xt_pkttype,xt_tcpudp,ipt_LOG,xt_state,i
ptable_nat,ip_tables
speedstep_lib 5764 0
cpufreq_userspace 5408 0
cpufreq_stats 7744 0
freq_table 6048 1 cpufreq_stats
cpufreq_powersave 2944 0
cpufreq_ondemand 8876 0
cpufreq_conservative 8712 0
video 17412 0
tc1100_wmi 8324 0
sbs 16676 0
sony_acpi 6412 0
pcc_acpi 14080 0
i2c_ec 6272 1 sbs
i2c_core 23424 1 i2c_ec
hotkey 11556 0
dev_acpi 12164 0
button 7952 0
battery 11652 0
container 5632 0
ac 6788 0
asus_acpi 17688 0
ipv6 271136 18
sg 37020 0
sd_mod 22528 0
lp 12964 0
tsdev 9152 0
psmouse 41352 0
usb_storage 74816 0
libusual 16912 1 usb_storage
serio_raw 8452 0
snd_hda_intel 20244 2
snd_hda_codec 164480 1 snd_hda_intel
8139cp 24960 0
8139too 29056 0
ati_agp 10636 0
agpgart 35016 1 ati_agp
shpchp 42144 0
pci_hotplug 32828 1 shpchp
parport_pc 37796 1
parport 39368 2 lp,parport_pc
usbhid 45280 0
pcspkr 4352 0
mii 6912 2 8139cp,8139too
snd_pcm_oss 47232 0
snd_mixer_oss 19328 1 snd_pcm_oss
snd_pcm 84356 3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
snd_timer 25348 1 snd_pcm
snd 58116 10 snd_hda_intel,snd_hda_codec,snd_pcm_oss,snd_mix
er_oss,snd_pcm,snd_timer
soundcore 11232 1 snd
snd_page_alloc 11528 2 snd_hda_intel,snd_pcm
evdev 11392 1
ext3 142344 1
jbd 62100 1 ext3
ehci_hcd 35208 0
ohci_hcd 22788 0
usbcore 134656 6 usb_storage,libusual,usbhid,ehci_hcd,ohci_hcd
ide_generic 2432 0
ide_cd 33696 0
cdrom 38944 1 ide_cd
ide_disk 18560 3
atiixp 7824 1
generic 6276 0
sata_sil 11016 0
libata 74764 1 sata_sil
scsi_mod 144392 4 sg,sd_mod,usb_storage,libata
thermal 15624 0
processor 31560 1 thermal
fan 6020 0
ehci_hcd 35208 0
ohci_hcd 22788 0
usbcore 134656 6 usb_storage,libusual,usbhid,ehci_hcd,ohci_hcd
ide_generic 2432 0
ide_cd 33696 0
cdrom 38944 1 ide_cd
ide_disk 18560 3
atiixp 7824 1
generic 6276 0
sata_sil 11016 0
libata 74764 1 sata_sil
scsi_mod 144392 4 sg,sd_mod,usb_storage,libata
thermal 15624 0
processor 31560 1 thermal
fan 6020 0
fbcon 41376 0
tileblit 3840 1 fbcon
font 9344 1 fbcon
bitblit 7296 1 fbcon
softcursor 3328 1 bitblit
vesafb 9244 0
capability 5896 0
commoncap 8704 1 capability
(END)

To activate a compiled module that isn't showing on this list, the tool modprobe is used. For example, while I was getting my proprietary wireless card working, I had to run:

modprobe ndiswrapper

To remove a module, you can use:

modprobe -r ndiswrapper

Or, alternatively: rmmod ndiswrapper

That being said, you probably shouldn't be adding or removing modules if everything is working fine, unless you have a very good reason to do so.

The very brave and memory-thrifty user might scour the list analyzing the sizes and if a module is unused and unneeded, remove it. For example, since I don't plan on using any bluetooth devices whatsoever, I might remove bluetooth, l2cap, and rfcomm, which are all related to bluetooth. (I looked them up on Google to make sure.) But, since I'm not really that adventurous, and don't know if there are any side effects, I'm not going to do that. :-)

Some modules of note in my list are snd_hda_intel & snd_hda_codec, which make my particular variety of sound card work, and... hmm, It's gone now. I could have sworn ndiswrapper was in my list, as I jumped through all sorts of hoops to get my wireless networking working with it, but I don't see it now. The network card is working, though, so I'm not going to touch it. None of the other modules I have installed are of particular interest to me: They have been doing their job, and I haven't had to even know they are there.

Well, I hope this was a little helpful in understanding what LKM's are and how to manage them.