Wednesday, December 24, 2008

Where the computer ends and the entertainment center begins

A little incident with my nine year old son got me to thinking a bit about how we define computers in our lives and how we interact with them on different levels. There has been a lot of scholarly talk about exactly this, and I'm not really adding anything to the discussion except a tidbit of personal experience. Still, perhaps this thought will get you thinking a bit, too.

First, the story:

Yesterday, the aforementioned nine year old boy was playing his favorite online game.* A certain incident inside the game bubbled over, and my boy completely lost his cool. From my work spot in my bedroom I heard him pick up the keyboard and slam it on the desk. So, I told him to get off the computer and then I banned him from the computer for the rest of the day plus all of today.

Now, let me explain something before I go on. I have a theory of discipline which is very clear. Punishments should, whenever possible, be directly related to the deeds that brought them on. So, when he behaved inappropriately with the computer, my response was simple. No more computer for a period of time. The end. That didn't mean that we couldn't go watch a movie last night, or have other fun. But the computer was lost to him.

However, and heres where the story turns into a philosophical discussion about technology, at this very moment he is watching the Nightmare Before Christmas in the living room.

So what, right? I just said that being banned from the computer didn't mean that he was banned from TV. Well... we don't have a TV per se. Well, we do. The big monitor that we watch movies and serial shows on is, in fact, a TV as well as a monitor. But, we don't use it to connect to the airwaves or to cable TV or to satellite TV. The TV is just a monitor, connected to the desktop computer in the living room. So, my son is watching a movie on the computer.

Is that OK?

Yes, I think it is. I wasn't really banning him from watching shows, like I said before. I also wasn't banning him from listening to the radio. (We also get our "radio" from sites like last.fm) What I really banned him from was using the keyboard and mouse to interact with the computer. I banned him from games and web browsing and story writing on the computer. I set up the movie and hit play, so it's OK.

I wonder if, 20 years from now, I would still have the same approach. I mean, will I still think of the passive forms of entertainment as being different and separate from the computer itself? Will I still think of the computer in terms of its specific uses? Or will I think of it as just being "the computer", whatever I'm doing? I think I know the answer to that.

Despite the fact that devices are converging, mixing multiple, sometimes highly specialized uses into a single gadget, 20 years from now we'll be defining the machines based on their uses not based on the amorphous concept of "computer".

We don't generally think of our cell phones as computers, but they definitely are, and they are becoming more and more PC-like every day. My phone is a camera. It's better than many standalone digital cameras out there with it's 5 megapixel images, automatic or manual focus and zoom, digital video at regular frame rates or 120fps for slow motion video... But my phone is really a computer above all else. If you had any doubt whatsoever, the built in video editing software right on the phone should clue you in.

More and more of us have multiple desktop and/or laptop computers in the house, but far more people have multiple computers in the home and don't even realize it. Whether those computers come in the form of phones or cameras or kitchen gadgets or even computerized heating and air conditioning systems.

In Star Trek, the ship is the computer, and whether you realize it or not, we're there already. Your car is already computerized from bumper to bumper. You may not be talking to your car yet, but that's not for lack of technology. It's so that car companies can keep a certain layer of luxury available for their more expensive cars.

In the 1990's the word "convergence" was a buzzword applied to the idea that we would soon be watching TV over the Internet. As usual, the realities of technology were predicted earlier and much more accurately by Sci-Fi authors than business people.


* I think I ought to write another post soon about parenting in the Internet age, using this game as an example, too. One of the things about this game is that when a kid signs up, their parents are automatically given an account, too, and encouraged to play *with* their kids. That's totally cool but a) I don't have as much free time as my kid and b) when I am involved, I'm not always sure when I should jump in to break up disagreements and when I should let the kids work it out on their own. It's not always as clear as in real life... as I said, another post on that soon.

Thursday, December 18, 2008

Kernel driver changes

I learned how to add in or swap out a Linux kernel module today. Kinda cool.

Let's start with the problem. My new laptop has both a wireless card AND an Ethernet card that are incompatible with Ubuntu Linux. So, after a little bit of testing and research, my ever patient friend, savior and all things *nix tutor discovered that the problem was that Ubuntu picks the wrong kernel driver for the Ethernet card on this machine and that it didn't have the wireless driver at all.

Just for extra learning goodness (or kharma or something), after my friend did the whole process to get my networking up and running, the Ubuntu updater updated the kernel and wiped out all his work. That just meant that I got to do the whole process myself, with him reminding me of the steps as I went.

So, the steps: First we downloaded the source code for the drivers. Unpacked the tarballs, followed the directions to compile the drivers.

With one of the drivers, the make install target did the copying of the kernel object into the right place for us. With the other driver, we needed to do that ourselves. To do that we found the ".ko" file in amongst the compiled code and copied it to the correct directory under /lib/modules/.

In the case of the Ethernet card, we needed to blacklist the wrong module as well, just to make sure that it didn't get loaded again by accident. To do that, we headed over to /etc/modprobe.d/blacklist and edited the list to include the bad driver. (Bad, bad driver! Don't come back!!)

Next
depmod -a
runs through your kernel and makes sure that all of the dependencies are there. It takes kind of a long time to run, because it goes through all of your kernel files.

Then use
modprobe [module]
where [module] is the name of your module, of course, to get the driver up and running.

Use
lsmod
to check to see if your modules are there.

We tested the whole thing by creating a boot image with our modified kernel. We did that with
mkinitramfs -o /boot/initrd.img-2.6.27-9-generic.new `uname -r`
and then we created an entry in grub at /etc/grub/menu.lst for the new image. The command mkinitramfs creates a special file with all the kernel information that the system needs to boot. The name that I used was based on the existing file for the pre-modified kernel, but with .new on the end. That was so that we'd know which was which, of course, and so that we'd know what to copy over top of later.

After booting into the modified kernel with out a problem, we went back and removed the extra grub entry, and moved the .new version of the image over top of the normal version. Now the modified kernel is my kernel and I have Ethernet AND wireless networking. Yay!


In case you are wondering, my new laptop is an LG R510. (My 9yo son says the LG stands for "Lawful Good". You think I'm raising a geek?) The drivers it needed are Realtek Ethernet and Ralink Wireless.

Monday, December 8, 2008

Creating a bootable USB disk

With all the MID stuff I've been doing lately, I've had need to create bootable USB disks from img files twice now. As noted previously, I am a dork, so I always forget how to do things like this that I don't do terribly often. To save myself heartache and search time, here are the destructions instructions in short:

  1. Get .img file for the OS you need. (via download, Moblin image creator, or whatever)

  2. Find out which /dev your USB disk is.

    1. before you put your USB disk into the computer, type
      ls /dev/sd*

    2. after you put your USB disk into the computer, do that again.
      The new entry is your USB disk

  3. Run dd to copy the image to the disk
    sudo dd if=/path/to/imagefile.img of=/dev/yourUSB
    (obviously, you wanna replace those paths with the correct info)



That should do it. It takes a little while, so don't freak out. You can check to make sure it's working by opening another terminal window and running
ls /path/to/usb
where /path/to/usb is the path that you would usually use to see the files on that USB disk. You'll get some gobbeldy gook, but that's fine. It means it's working.

You can get more details at this article on the Intel site.

Sunday, December 7, 2008

Compiz-Fusion: Some basic commands

So, it dawned on me the other day while I was watching a colleague zoom through windows and workspaces with keystrokes that I am not using all the juicy goodness of my desktop GUI. Compiz-fusion is installed by default on Ubuntu 8.10, but I'd never bothered to figure out how to use it properly. So, today I'm learning a bit and writing in commands I find here.

First, a definition. The super key is the Windows key on Windows keyboards. I have not the foggiest notion what it would be on other keyboards.

Next, make sure that you have the compiz config settings manager (aka CCSM). It should be under preferences and it doesn't need sudo acces to run. If you don't have it (I didn't even though I did have compiz-fusion installed) then do this:
sudo apt-get install compizconfig-settings-manager

If you go into CCSM and then choose General Options, and then choose the tab for key bindings, you'll get a listing of all the default key bindings. You can change them there, if you like.

For quick reference, here are some of the defaults I find useful.









Close window   alt-F4
Show Main Menu   alt-F1 (use arrows to navigate, esc to escape)
Run Dialog   alt-F (for apps that may not have a handy-dandy menu link)
Unmaximize window   alt-F5
Minimize window   alt-F9
Maximize window   alt-F10
Window menu   alt-space
Show desktop   ctrl-alt-d


Expo:
See all the Worspaces at once: super-E
Use the arrow keys to navigate around. Use Enter to exit that view and go into the workspace you have highlighted.

Ring Switcher:
This gives you a view kind of like when you flip through CD and DVD covers on iTunes, only the view is of your available windows.
Clockwise rotation: super-tab
Counter-clockwise rotation: super-shift-tab
Let go to land on the window you see in the center of the screen.

Scale:
This is the tool that has Exposition-like effects. Your desktop turns into a rotatable cube.
ctrl-alt + left and right arrows turns the cube.
ctrl-alt-down arrow flattens the cube.


There's a lot more that you can do, but those are the bits that I've played with so far and liked enough to keep activated. I like the water effects, but they are a bit distracting.

I like the annotation tool, but don't really need it on this computer. It would be way cool for presentations, though, so check it out if you do sales presentations, tech-talks or are a teacher.

Have fun with it!

edit: yes, yes, I see the big gaping hole in the view before the table. I'll fix it later, sorry!!

Thursday, December 4, 2008

When to write a script in a language you don't know

Sometimes there is a long, repetitive task that you know would be much better off if done by a small script, but the problem is that you don't know how to use the tools available at the moment.

One of my problems is that I never remember anything about a language or system if I'm not using it often. It's like I do a brain dump in order to make room for new stuff when I switch from one technology to the next. That means that even though I *have* done considerable shell scripting in the past, I can't remember a darn thing when I need it for a one off project. So, I know that I'd be better off writing a script, but I end up doing the job by hand anyway because it would take longer to look up language bits than it does to hit arrow up, back, back, back,... delete, delete,... paste.... a few times through.

The whole time I'm doing that, though, I'm thinking, "I could solve this like this in PHP or like that in Perl" and none of it matters, because at the moment I'm working in a very limited embedded linux system with neither of those languages on board.

So, what do YOU do in a case like that? Do you go look up the language ref for what IS available to you, even if it will take longer than the cut-and-paste for the task? Or do you just do the task manually?