Thursday, December 3, 2009

Microsoft drives another Windows user to Linux

Previous: CD to MP3 conversion

This is a Good News, Bad News post. The Good News is summarized by the title of the post. The Bad News is called "Ease of Access."

My wife recently had a strange problem with Microsoft Windows Vista. For no apparent reason and at irregular times, a pop-up window appeared offering various accessibility options, and a synthesized voice read the contents of the screen aloud. This was particularly puzzling since nothing of the sort has happened in the several years she has been using the machine, running the very same copy of Windows Vista the whole time.

We learned this annoyance is an intentional feature of Windows Vista, ironically named Ease of Access. Far from making access "easy," its actual effect is to render the system completely unusable. With the feature active, whenever you type more than three characters into any input field in any program, the Ease of Access pop-up window appears and takes control of all keyboard input. The feature seems to activate and deactivate itself whenever it feels the urge.

I found an inquiry on a Microsoft forum from a customer who was experiencing the same problem: http://social.answers.microsoft.com/Forums/en-US/vistaappearance/thread/cefa6d08-f32f-4de6-a74f-a6bd53843b52. He writes, "...i have had nothing but trouble with the ease of access randomly opening without provacation, EVEN AT START UP before I have even logged on to my computer, when it is doing that I can almost NOT CONTROL my mouse at all, it keeps pulling my mouse down to the lower left of my screen and opens up!"

A Microsoft engineer with the screen name "Keith" replied, "...Ease of Access is built into the operating system and you will not be able to uninstall it but...you can search the Web for a 3d party program that will disable Ease of Access." He goes on to warn us about the dangers of running programs not published by Microsoft Corporation.

Restoring keyboard control and blessed silence



I found that by unchecking the appropriate checkbox we could silence the annoying synthesized voice, but we were unable to find a way to disable the Ease of Access feature altogether. "Keith" offered the following suggestion to disable the onscreen keyboard:

1. Click the Start Orb on the Desktop

2. Select Control Panel

3. Select Ease of Access (Classic View)

4. Select Use the computer without a mouse or keyboard

5. Remove the Checkmark by Use On-Screen Keyboard

6. Select Apply and then close the window

Disabling the Ease of Access button on the logon screen



There is no practical way to remove the Ease of Access feature from Windows, since Microsoft have so cleverly hard-wired the bloody thing into the guts of the OS. There is a free download from Softpedia called Ease of Access Disabler that can render the Ease of Access button on the logon screen inactive. The program is described at http://www.softpedia.com/get/Tweak/System-Tweak/Ease-of-Access-disabler.shtml. This will, at least, protect you from people who play pranks by activating Ease of Access while you're away from your desk (yes, that's right: anyone can change the settings, even when the computer is locked - another clever design point by the fine folks at Microsoft), as well as protecting you from accidentally clicking on the button yourself.

Please welcome a new Linux user



My wife is a long-time user of Windows and has resisted change, even through the years when I switched to the Mac and later to Linux. In the past when I've mentioned ease of use and convenient features of other operating systems, she has responded with the sort of friendly pro- and anti-Microsoft banter that many people enjoy. You know the script: "I'm a PC, ha ha ha." So, I figured she simply preferred Windows, and that's fine. It's a personal choice.

As I tinkered with her machine in search of a solution, my wife grew impatient. I told her that I knew she liked Windows, so I wanted to try and fix the problem for her. Exasperated, she said "I don't care if it's Windows or Utoombo or Watonga or whatever. I just want to use my computer!"

Well, I can relate to that.

I had recently installed Wubi on that machine and set up a dual boot with Ubuntu and Vista. I showed her how to log in and where to find her files. She was already using OpenOffice and Firefox, so those programs were familiar. Ubuntu supports our wireless printer and household network out of the box. I showed her how to play audio CDs on Ubuntu. Now she can do everything on Ubuntu she ever did on Vista, with the sole exception of running a client for an online game site that is only available for Windows or OS X. When she wants to play, she takes her chances with Ease of Access popping up. If worse comes to worst, she can download the game client for OS X and use my old MacBook Pro for that activity.

Next: TBD

Tuesday, December 1, 2009

CD to MP3 conversion

Previous: Installing Wubi on HP Pavilion notebook

RubyRipper - FAIL



RubyRipper was recommended on the Ubuntu community documentation site. To install it, install dependencies:
sudo apt-get install cd-discid cdparanoia flac lame mp3gain normalize-audio ruby-gnome2 ruby vorbisgain
Get RubyRipper from http://linux.softpedia.com/progDownload/Rubyripper-Download-20741.html and follow the installation instructions for the format of your choice. I used the Debian package install, and it seemed to work fine.

RubyRipper then appeared in the Gnome menu under Applications -> Sound and Video. I tried it with a couple of CDs and specifying different output formats with absolutely no success. As far as I can tell, RubyRipper doesn't even begin to work.

Grip



Grip was also mentioned on the community documentation site. The project home page at http://nostatic.org/grip/grip-download.shtml does not mention an Ubuntu repository package, but when I ran
sudo apt-get install grip
it installed fine and Grip then appeared in the Gnome menu under Applications -> Sound and Video.

On starting Grip, it warned me that it was a development version and not a stable version. I tried it with the same CDs as I had used to test RubyRipper. Worked fine, no problems.

Next: Microsoft drives another Windows user to Linux

Tuesday, November 24, 2009

Installing Wubi on HP Pavilion notebook

Previous: Flash player for Firefox libnspr4-dev dependency

I liked Wubi so well on my Acer netbook that I installed it on my wife's HP Pavilion laptop as well. After rebooting the first time to complete the basic installation, the grub boot loader would never recognize the Linux OS. I tried various this to fix it but was unable to get it to work.

I noticed that the Wubi installer site always downloaded the 64-bit version of the program and offered no way to override this. The Wubi FAQ at http://wubi-installer.org/faq.php includes an entry about installing the 32-bit version of Wubi. It suggested running Wubi from a command line with the 32-bit option:
wubi --32bit
This worked, and the HP Pavilion now has an Ubuntu instance installed.

Next: CD to MP3 conversion

Flash player for Firefox libnspr4-dev dependency

Previous:

Ran into a dependency problem with Ubuntu Karmic 9.10: Adobe Flash player plugin for Firefox depends on package libnspr4-dev, which apparently is problematic for one reason or another. I got the player to install by doing the following:
sudo apt-get update
sudo apt-get install libnspr4-dev
Without doing the update first, the install warned that it would remove several packages, including Firefox itself. Not very convenient.

Next: Installing Wubi on HP Pavilion notebook

Sunday, November 15, 2009

Installing Wubi on Acer Netbook

Previous: Firefox addon toolbar buttons not displayed

I've been using my Toshiba Satellite as my main workhorse, and my Acer Netbook as a system for running presentations at conferences and user group meetings and for clients. I took only the Acer with me on a business trip recently, and I became quite frustrated with using Windows XP all the time, rather than just for running presentations. Besides that, I missed having the usual tools available. I decided to load Ubuntu Linux on the Acer so I would have similar environments on both machines, and to avoid the hassle of using Windows.

I have a conventional dual-boot setup on the Toshiba. For the Acer, I decided to try Wubi, a program for Microsoft Windows that manages an Ubuntu dual boot for you, without your having to repartition the hard drive manually. I wanted to see how the user experience compares with the conventional dual boot setup.

Wubi install



First, I went to http://wubi-installer.org/ and downloaded the Wubi installer.

Next, I started Windows XP on the Acer and ran the installer, following the prompts as needed. Everything went smoothly.

After rebooting into Ubuntu Linux, Wubi copied the basic installation files and set up its pseudo partition. It installed 9.10 Karmic.

Making Ubuntu the default OS on boot



By default, Wubi has Windows as the default OS. To change that, here is what I did:

1. Boot into Windows XP.

2. Go to Control Panel

3. Switch to Classic View

4. Choose: System -> Advanced -> Startup and Recovery

5. From "Default Operating System" drop-down list, choose "Ubuntu"

6. Click OK on all open dialog windows to close them

Ubuntu upgrade



From there, I followed my own instructions for updating the system and loading the various programs I use, starting with this blog post: http://kotowanandesu.blogspot.com/2009/08/updating-ubuntu.html. The system upgrade went smoothly.

Ruby development support



The next step was to install support for ruby development. I followed the steps I had documented previously in this post: http://kotowanandesu.blogspot.com/2009/08/installing-support-for-ruby.html.

Things had changed a bit since I installed 9.04. Here are the differences I encountered:

1. When I ran the command
sudo apt-get install libmysql-ruby libmysqlclient-dev
the virtual package name libmysqlclient-dev was resolved automatically and the correct components were installed without the need for any additional action on my part.

2. When I installed the ruby bindings for MySQL, the software installed correctly but the ri documentation was missing a lot of bits and pieces. I did not consider this a serious problem.

3. The menu option Applications -> Add/Remove Applications was replaced by Ubuntu Software Center. I discovered that when I started to type the name of an application into the search box, it auto-filled all matching names. This was faster than the old way of finding the packages I wanted.

No problems with the rest of the ruby-related stuff, except some of the ri docs for nokogiri were missing. For the scripts and aliases documented in the original blog post, I just copied the files from the Toshiba laptop.

Java development support



I followed the instructions I had documented earlier in this post: http://kotowanandesu.blogspot.com/2009/08/installing-support-for-java.html. Everything worked the same as the first time, with the following exceptions:

1. Eclipse Galileo was installed by default. No additional steps were needed on my part.

2. Previously, Eclipse installed with a default value for the classpath variable M2_REPO. This time, it had no default definition. In Eclipse, under Window -> Preferences -> Java -> Build Path -> Classpath Variables, I added M2_REPO to point to /home/dave/.m2.

3. This time, migrating my existing projects to the new instance of Ubuntu was easier, since I was copying them from another Ubuntu instance that was configured in the same way. The first time around, I copied project files from an OS X system that was configured a bit differently.

Tomcat install



I had some difficulty with the standard installation procedure the first time around, as described in this post: http://kotowanandesu.blogspot.com/2009/08/installing-tomcat.html. This time, I checked for updated documentation and found this information about installing Tomcat 6 on Ubuntu 9.10: https://help.ubuntu.com/9.10/serverguide/C/tomcat.html. Per that documentation, I ran the command
sudo apt-get install tomcat6
and the It Works! page came up fine.

ColdFusion install



I skipped the ColdFusion installation for the moment, since I wouldn't need it in the near future.

.NET support



As before (see http://kotowanandesu.blogspot.com/2009/08/installing-support-for-net.html), I entered the command
sudo apt-get install mono-devel


To install the IDE, used Ubuntu Software Center, and then found it under Applications -> Programming. Go figure. I didn't try the Hello, World! programs this time, because I'm confident in the package.

The NUnit and debugger installs went smoothly.

Git install



The git install went smoothly, as documented here: http://kotowanandesu.blogspot.com/2009/08/installing-git.html.

eXPlainPMT install



I skipped this install, since I've started using the Kanban approach rather than the iterative approach on personal development projects.

Firefox development add-ons



I skipped this, since I won't be using the Acer as my primary development platform.

...and the rest of it



All that remained was to copy files from the Toshiba to the Acer. Up and running!

Next: Flash player for Firefox libnspr4-dev dependency

Sunday, November 1, 2009

Firefox addon toolbar buttons not displayed

Previous: Troubles with Flash player

After installing some addons to Firefox, I noticed that some of the buttons associated with addons that were supposed to show up on the navigation bar were not displayed. From a thread on the Read It Later site, I learned that the "Ubuntu Firefox Modifications" addon may cause this problem. I disabled "Ubuntu Firefox Modifications" and the problem was solved.

Next: Installing Wubi on Acer Netbook

Wednesday, October 28, 2009

Troubles with Flash player

Previous: Static from the speakers

I had been having a lot of trouble with the Flash player plugin for Firefox on Ubuntu. When I first switched to Ubuntu, there was no Flash plugin for 64-bit Linux in general release. After a while, they published an "alpha" version, and it appeared to work. But after the latest Firefox upgrade, YouTube videos did not play and no error message was displayed to indicate any problems with the plugin.

A post on launchpad.net suggested using any of the following Firefox plugins:

  • MPlayer (package name mozilla-mplayer)
  • Totem (package name totem-mozilla)
  • VLC (package name mozilla-plugin-vlc)
I've noticed that MPlayer, which came bundled with Ubuntu, appears to play every kind of media file I've got with no difficulty, so I decided to try the MPlayer plugin. I installed it with
sudo apt-get install mozilla-mplayer
and restarted Firefox. Absolutely no problems. This is the way to go, rather than the Flash plugin.

That is, it's the way to go when it works. I haven't investigated the cause, but sometimes Firefox doesn't seem to know it ought to launch the MPlayer plugin. I suspect it has to do with the way the HTML is written on some sites. The observed behavior appears to be: When the page checks for the existence of the Flash plugin so that it can initiate a download for clients that don't have it installed, it finds a plugin associated with Flash video so it doesn't prompt for the download, but it also doesn't know how to invoke the MPlayer plugin, so you end up with nothing.

I've found that if I download the video manually, it will play just fine with MPlayer. Another workaround is to launch Opera and view the video with the "standard" Flash player in Opera. That seems to work without any problems.

I don't intend to invest much personal time on this problem. Based on what I've seen, my guess is that it boils down to a problem in the 64-bit version of Flash player for Firefox. When looking for answers I found a CNET article about the Firefox Flash plugin that suggests there has been a history of problems with that plugin ever since it was first introduced.

Next: Firefox addon toolbar buttons not displayed

Friday, October 23, 2009

Static from the speakers

Previous: Another reason to like Ubuntu

After a series of software updates, I noticed that the speakers were emitting static instead of clean sound whenever there was audio output. I did a net search on the keywords "ubuntu audio static" and immediately found this resource: http://beyondteck.blogspot.com/2009/04/ubuntu-audio-does-not-work-static-sound.html.

The problem description and the solution were exactly what I needed. Apparently, one of the software updates had modified my audio settings, for reasons unknown. After adjusting them, everything worked properly again.

Next: Troubles with the Flash player

Another reason to like Ubuntu

Previous: UMLet install

Ubuntu provides automated updates much as Microsoft and Apple do for their operating systems. I recently accepted an updated kernel, and afterwards I noticed some rendering problems on the Gnome desktop. A quick net search didn't reveal any fixes, probably because the problem is so fresh.

I rebooted Ubuntu and selected the previous kernel build from the boot menu. It works just fine now.

I really appreciate the boot process that allows you to drop back to a previous kernel build in such a simple and painless way. Now I won't have to cope with that problem while waiting for the fix to be published.

I find this much easier than the procedures for recovering a previously-working version of Microsoft Windows or Apple OS X. Thanks, Ubuntu team!

Next: Static from the speakers

Thursday, October 22, 2009

UMLet install

Previous: Freemind install

I found a useful UML modeling tool that's suitable for agile modeling, called UMLet. I wrote my opinions about it on my Effective Software Development blog, and I won't repeat them here. This entry is just about how I installed it on Ubuntu Linux.

First I downloaded the archive from the UMLet site at http://www.umlet.com. I unzipped the archive for the standalone version of UMLet into /home/umlet.

To make it easier to start UMLet, I defined an alias in .bash_aliases as follows:

alias umlet='java -jar ~/umlet/UMLet/umlet.jar'


Then I created a desktop file for UMLet and saved it in /usr/share/applications as umlet.desktop. The contents are:

[Desktop Entry]
Encoding=UTF-8
Name=UMLet
Comment=UML diagramming tool
Exec=umlet
Icon=uml_icon.png
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true


The desktop definition makes UMLet appear in the Applications -> Programming menu in the Gnome desktop. The icon file referenced in the desktop file is just an icon I found on the net somewhere that reminds me of UML. UMLet doesn't have its own icon.

Next: Another reason to like Ubuntu

Sunday, October 18, 2009

Freemind install

Previous: Google Earth install

Downloaded Freemind from Sourceforge and unpacked the distro in my home directory.

Downloaded the Freemind icon by Christian Foltin from this Wordpress blog, whose owner does not make it easy to identify him/her, so I don't know whom to thank for making it available. Copied the icon to /usr/share/pixmaps and named it freemind.png.

Created a desktop file in /usr/share/applications named freemind.desktop with the following contents:

[Desktop Entry]
Name=Freemind
Comment=Mind mapping tool
Exec=/home/dave/freemind/freemind.sh
Terminal=false
Type=Application
Icon=freemind.png
StartupNotify=true
Categories=Office;
Freemind now appears in the Applications -> Office menu.

Next: UMLet install

Saturday, September 26, 2009

Google Earth install

Previous: Firefox 3.5 install

The Linux installation for Google Earth isn't a simple click or double-click. Here's what I did:

1. Open a browser and navigate to http://earth.google.com/download-earth.html.

2. Download the installer for Linux. At the time I did it, the file name was GoogleEarthLinux.bin. Download it to whatever directory you please.

3. Open a Terminal window and go to the directory where you downloaded the installer.

4. Grant execute privileges on the installer. I used

chmod +x GoogleEarthLinux.bin


5. Run the installer with

sh GoogleEarthLinux.bin

Set the installation directory and bin path as you please, following the prompts displayed by the installer.

The install worked fine, but it didn't add an entry to the Applications menu in Gnome. They don't make any assumptions about which desktop you might be using. To add it, I took the following steps:

1. Copied the Google Earth icon from the installation directory to /usr/share/pixmaps.

2. Created a googleearth.desktop file in /usr/share/applications with the following contents:

[Desktop Entry]
Name=Google Earth
GenericName=Google Earth
Exec=googleearth
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=googleearth-icon.png
Categories=Application;Network;
StartupNotify=true

This worked fine.

Next: Freemind install

Friday, September 25, 2009

Firefox 3.5 install

Previous: Value Stream Mapping font

A "normal" Firefox 3.5 for Ubuntu has been created, and it was a recommended system upgrade as of this morning's automatic upgrades. I chose it, and it messed me up badly. The Shiretoko install was gone, but the new Firefox 3.5 did not work.

I got around the problem by running sudo apt-get remove firefox-3.5 and then sudo apt-get install firefox-3.5. Fortunately, this cleared up whatever had been clobbered by the earlier install.

Next: Google Earth install

Monday, September 14, 2009

Value Stream Mapping font

Previous: Partial success with Logitech EX100 wireless keyboard and mouse

I came across a useful tool for Value Stream Mapping: A free VSM TrueType font, offered by ambor.com. The ambor.com site provides instructions for installing on Windows and OS X. To install on Ubuntu, I did the following:

  1. Downloaded the .ttf file from ambor.com

  2. Copied the .ttf file to /usr/share/fonts/truetype

  3. Ran the command: sudo fc-cache -fv


The font works nicely with OpenOffice under Ubuntu.

Next: Firefox 3.5 install

Saturday, August 22, 2009

Partial success with Logitech EX100 wireless keyboard and mouse

Previous: Ubuntu: No love for Kodak printers

The second home office peripheral I wanted to try with the new Ubuntu laptop was the Logitech EX100 wireless keyboard and mouse. I had hoped it would solve the usability problem with the Synaptic touch pad moving the input cursor when it detected hand movements above the pad.

It's one of those good news, bad news things. The good news is the wireless mouse worked flawlessly on a plug-and-play basis with no installation, configuration, or other effort on my part. With the touch pad turned off, I've been typing my little heart out for several minutes now, and Ubuntu is still responding to keyboard input (from the Toshiba laptop's keyboard).

The bad news is that I've got no response from the wireless keyboard. But the truth is, the wireless mouse solves my particular problem quite nicely.

I found a note on a forum complaining about this model of wireless mouse not working with Open Office spreadsheet on Ubuntu. I gave that a try, and apparently the problem was solved in a subsequent release. No problems here.

Next: Value Stream Mapping font

Ubuntu: No love for Kodak printers

Previous: Installing Banshee media player

Or maybe I should say, Kodak: No love for Ubuntu. Either way, the outcome is the same.

Back at home, I was eager to try my shiny new laptop with some of my home office peripherals. I found no driver for the Kodak ESP-3 multipurpose printer on CUPS. The Kodak driver download site had nothing available for Unix, and no listing for Linux at all. A thread on Ubuntu forums where people were asking about this printer model indicated there is no driver for it and no practical workaround for using the printer with Ubuntu.

Last post, I reported one less reason to boot into Vista. Sadly, I must now report one more reason to boot into Vista.

You might ask: So, why not replace the Kodak printer with a supported model? I might answer: Remember the reason I was in the market for a new laptop in the first place? It was high cost of ownership of hardware. The Kodak ESP-3 is a low cost of ownership printer. It's also low-maintenance and very reliable. I'm keeping it.

Next: Partial success with Logitech EX100 keyboard and mouse

Thursday, August 20, 2009

Installing Banshee media player and ffmpeg video converter

Previous: Audio support fixed

With audio working, I went ahead and installed support for watching videos.

I started Firefox and went to https://addons.mozilla.org/en-US/firefox/. There, I installed the Video DownloadHelper add-on. Then I installed ffmpeg (video converter) and Banshee (media player) from a command line:
sudo apt-get install ffmpeg
sudo apt-get install banshee
Smooth as silk, no problems, no extra steps. Done. Lovely!

One less reason to boot into Vista. That in itself is like a cool drink of water on a hot day.

Next: Ubuntu: No love for Kodak printers

Audio support fixed

Previous: Problem with keyboard and Synaptic touch pad

Well, I told you I was a noob, didn't I?

Searching around the net I learned that one can check to see if one has support for audio by trying to run alsamixer. If the software isn't there, the program won't start. I tried
alsamixer
and a mixer panel came up. The master volume slider was set to minimum. I moved it to maximum.

Problem solved.

Geez, what a noob!

Next: Installing Banshee media player and ffmpeg video converter

Sunday, August 16, 2009

Problem with keyboard and Synaptic touch pad

Previous: Linux vs. Vista download performance

One of the problems I've mentioned here is that from time to time Ubuntu would stop responding to the keyboard and touch pad. I had not been able to find a report of exactly the same behavior with Ubuntu 9.04 or with Toshiba laptops. I did find some similar reports dating from 2007.

Today I was working on the Vista side of the system to disable some of its pre-configured annoyances, since it had become clear that I would have to use Vista for certain non-work-related tasks. The same behavior occurred once while I was working on Vista.

If the problem affects both operating systems, then it follows that it isn't a problem with the OS, drivers, or firmware. It has to be either the BIOS or the hardware.

This is good news, because if the problem affects Vista users then maybe Microsoft will pressure Toshiba and/or Phoenix Technologies to fix it. They certainly won't care about Linux users.

It may be coincidental, but I've observed an apparent correlation with using the hardware switch to turn off the touch pad so that you can type freely without having your hand movements interpreted as mouse movements. The problem has been less frequent when I avoid turning off the touch pad and just live with the occasional cursor jumps.

Another correlation is that when I close the lid and then open it again later to resume work, Ubuntu no longer responds to the keyboard. I have not observed this behavior when using Vista.

When I get home from this road trip I plan to test a wireless mouse with its own USB Bluetooth adapter. If that works, then the inability of Ubuntu to see the built-in Bluetooth adapter will be less annoying. I'm hopeful that this will eliminate the interference between the keyboard and touch pad, as well.

Next: Audio support fixed

Linux vs. Vista download performance

Previous: Making Vista liveable

When installing one of the two Windows program I need, I noticed a significant discrepancy between the download times on Vista and Ubuntu. Vista doesn't always behave this badly, so there must be a factor involved in this that isn't obvious to me. In any case, here's what I observed.

I needed to install the Zune software (to manage my Zune portable media player) on the Vista instance on my dual-boot Toshiba Satellite P500. I booted into Vista, opened Internet Explorer, and navigated to http://www.zune.net/en-US/software/default.htm to download the Zune 3.0 software.

The download ran for about 10 hours before it was rudely interrupted by the scheduled automatic system update at 3:00 a.m. I awoke to discover the machine had rebooted into Ubuntu, the default OS, after the Windows update restarted the system. The download had not been completed. I tried again, and saw that the download was proceeding extremely slowly. I canceled it and decided to download the file from Ubuntu, just to see if there might be a difference.

In Ubuntu, using Firefox, the same download finished in 5 minutes. Same site, same file, same Internet connection, same hardware. Different OS, different Web browser. In other words: Two suspects.

The 133 MB file was not the Zune software. It was only the installer for the Zune software. Having installed Zune software before (on Windows XP), I knew the installer would have to download components during the installation procedure. Those downloads could not be done on the Ubuntu instance because they were tied into the actual software installation. So, there would be another opportunity to observe download behavior on Vista.

Booting into Vista again, I copied the Zune installer and ran it. When it got to the downloading components step in the installation, the downloads once again ran extremely slowly. I left it running and went to work for the day.

When I returned 11 hours later, the download components step was still running. It finished after 11.5 hours. The remainder of the installation steps finished in a few seconds.

Based on previous installs of Zune software, I can say the Zune installer was not the cause of the slow download. Internet Explorer was not involved in this step, so it could not have been the culprit. Only one suspect remained: Vista.

Hmm. Largest software company. Many of the top engineers in the field on staff. More than 25 years continuous product development experience in the Windows product line. And this is the best they can do? Really?

Interesting.

Next: Problem with keyboard and Synaptic touch pad

Making Vista liveable

Previous: Firefox Web development add-ons

Okay, I've installed a lot of development tools and so forth, and I'm pretty happy with the way it all works. When I turned my attention to "consumer" uses of my shiny new machine, I encountered a couple of problems. Ubuntu cannot see the Toshiba's audio adapter or Bluetooth adapter. I spent a couple of hours online looking for solutions and found none, except for a problem with audio on Toshiba laptops dating from 2007 and involving an earlier incarnation of Ubuntu.

I did find a couple of references to a contractual arrangement between Microsoft Corporation and Phoenix Technologies, the makers of the machine's BIOS, that some people assume means that Phoenix may have designed the BIOS to be unfriendly toward operating systems other than Microsoft Vista. I think that is probably speculation on their part, and I plan to keep looking for solutions.

At the moment, I have no way to predict whether I will be able to get Ubuntu to work with the audio adapter and Bluetooth adapter in the Toshiba Satellite. It's possible someone will create drivers, firmware, or whatever else is required to support them. It's also possible that the Phoenix BIOS is actually the problem.

In any case, I need a way to organize my music files and sync my Zune, and I need a Windows system to run Music Publisher. If the audio problem is not solved, I will have to switch to Vista when I want to visit YouTube or Hulu, listen to music on Pandora or a streaming radio station, or listen to news. It would be nice to have audio when using Skype, too. That meant I would be spending at least some of my time on Vista.

OEMs have a long tradition of configuring pre-installed Windows systems in a way designed to piss people off and make them hate computers. Although Toshiba's motto is "leading innovation," in this regard they are respectful of tradition.

So, how could I make the Vista environment less annoying? Here are a few steps I took that seemed to help. None of this pertains to Ubuntu, of course.

Removing unnecessary programs from startup


Press the Start orb, type msconfig into the Search field, and press Enter. This opens the System Configuration utility. Go to the Start tab. YMMV, but what I did was to deselect the following entries:
  • Intel(R) Common User Interface - igfxtray.exe
  • Intel(R) Common User Interface - hkcmd.exe
  • Intel(R) Common User Interface - igfxpers.exe
  • TOSHIBA Button Support
  • TOSHIBA Zooming Utility
  • TOSHIBA Flash Cards
  • TOSHIBA Web Camera
  • SmartFaceVWatcher
  • RealConnect Agent
  • Google Toolbar Notifier
  • CyberLink Power Cinema
  • CyberLink MediaLibrary Service
These changes reduced startup time noticeably and reduced the number of annoying reminders and pop-ups almost to none.

Disabling "notification balloons"


Press the Start orb, type regedit into the Search field, and press Enter. This opens the Registry Editor. Navigate to HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/Advanced. From the menu choose New -> DWORD(32 bit). Name it EnableBalloonTips. Give it a value of zero. Close the Registry Editor.

Disabling Auto-Complete in Internet Explorer


Start Internet Explorer. On the main menu, choose Tools -> Internet Options. Go to the Content tab. Under AutoComplete, press Settings. In the resulting dialog box, deselect all the checkboxes. Press OK.

To get rid of existing AutoComplete entries, in Internet Options go to the General tab. In the Delete section, press Delete Forms.

Disabling assorted annoyances in Google Toolbar


In Internet Explorer, choose the Tools drop-down near the right-hand end of the Google Toolbar. Choose Options from the drop-down menu. Choose the Search tab. Under 'Search features', deselect 'Suggest searches as you type'.

Go to the General tab. Under 'Additional settings', deselect 'Send usage statistics to Google'.

Go to the Custom Buttons tab. Deselect all the items you don't want.

Go to the AutoFill tab. Deselect 'AutoFill'.

Press the Save button.

Installing necessary Windows programs


As I mentioned previously, there are two Windows-only programs I need: Braeburn Software's Music Publisher and the Microsoft Zune sync software.

Music Publisher is a commercial product that comes on a CD. Installation consists of running the installer off the CD. No problems there.

The Zune software is a free download. Getting the download to work turned into an educational exercise on the relative downloading performance of Vista vs. Ubuntu. It's a tale in its own right, so I blogged about it separately.

Making frequently-used programs easy to access


I took the following steps to place entries in the Start menu for the programs I use most often on Vista:
  1. Right-clicked the taskbar and chose Properties from the context menu to open the Taskbar and Start Menu utility.
  2. Went to the Start Menu tab.
  3. Deselected the checkboxes labeled Store and display a list of recently opened files and Store and display a list of recently opened programs.
  4. Clicked the Customize button next to the Start Menu radio button near the top of the panel.
  5. Deselect the checkboxes near the bottom of the panel labeled Internet link and E-mail link.
  6. Clicked OK until I had clicked my way out of the Taskbar and Start Menu utility.
  7. Clicked the Start orb and then the All Programs link.
  8. Navigated to the shortcut for each program of interest, right-clicked it, and clicked Pin to Start Menu


General beautification


Downloaded the flattering photgraph of me from this very website and set it as my User icon in Vista.

Next: Linux vs. Vista download performance

Firefox web development add-ons

Previous: Installing eXPlainPMT

Upgraded Firefox


Ubuntu came with Firefox 3.0.2 pre-installed. To upgrade it, I typed 'apt:firefox-3.5' in the Firefox location field. This is a front-end to Synaptic Package Manager that was added to Firefox for the Ubuntu distro.

This installed Firefox 3.5.2 and added an entry in the Applications -> Internet menu named 'Shiretoko Web Browser' (the codename for Firefox 3.5).

On starting the new browser, I saw that it had transferred my bookmarks correctly. However, it did not find a compatible version of Ubuntu Firefox Extensions. I typed 'apt:' and 'apt:firefox-3.5' into the location field and it complained about the protocol name. Maybe this handy feature is gone!

Add-ons for web development


I browsed to https://addons.mozilla.org/en-US/firefox/ and selected the following add-ons (selected all before restarting Firefox):
  • Abduction!
  • Bottom Error Console
  • ColorZilla
  • Console2
  • Dom Inspector
  • EditCSS
  • Execute JS
  • Firebug
  • lori (Life-of-request info)
  • QuickRestart
  • SQL Injection
  • SQLite Manager
  • Web Developer
  • XSL Results

The current version of Html Validator was not available on the Mozilla add-on site on the date when I was installing add-ons. The version on the developer's site at http://users.skynet.be/mgueury/mozilla/ turned out to be incompatible with Shiretoko. Too bad, since this one does validation locally in the browser and does not depend on any third-party sites.

The current version of Selenium IDE was not available on the Mozilla site. I installed it from "Selenium HQ" at http://seleniumhq.org/download/. The install worked fine.

Next: Making Vista liveable

Saturday, August 15, 2009

Installing eXPlainPMT

Previous: Installing Git

eXPlainPMT is an Open Source project planning tool geared for Extreme Programming.

Installation


I installed it like this:
  1. Downloaded the distribution archive from http://github.com/explainpmt/explainpmt/tree/master.
  2. Unzipped the archive into my home directory.
  3. Renamed the top-level directory 'explainpmt'.
  4. I'm using SQLite for this program, so I didn't need to create a MySQL database.
  5. The instructions say to edit config/database.yml, but this distribution had no such file. There was a database_cruise.yml with an entry for postgresql, but I wanted to use sqlite. I created a database.yml file with the following contents:
    production:
    adapter: sqlite3
    database: db/production.db
    development:
    adapter: sqlite3
    database: db/development.db
    test:
    adapter: sqlite3
    database: db/test.db
  6. Created file log/production.log and gave it permissions 0666.
  7. In the explainpmt directory: Ran
    rake db:migrate RAILS_ENV=production
    Note the syntax differs from the instructions given on Github. It complained about the Rails version and suggested this to fix it:
    sudo gem install -v=2.0.2 rails
    After that the rake command completed successfully.

Verify installation


From the explainpmt directory, I ran this command to start up the program:
./script/server webrick -e production -p 8100
In Firefox, I went to localhost:8100. eXPlainPMT started up clean. I entered the default userid and password, admin/admin, and everything looked normal.

Conveniences



When I want to use eXPlainPMT for a personal development project, I copy the full eXPlainPMT directory structure to /projects/projectname/explainpmt so that there is a separate "backlog" or "master story list" or "work queue" (pick your favorite buzzwords) for the project. That means starting a separate eXPlainPMT instance for each project. To simplify starting and stopping the tool, I created a bash script to wrap the command line shown above and to capture the pid to stop the server later. You can cd to the /projects/projectname directory and type 'backlog xxxx' where xxxx is the port number you want the server to listen on. When finished working on that project for the moment, you can type 'backlog_stop'. The script looks like this:
#!/bin/bash
# Start an instance of eXPlainPMT
# Assumes you are in the /projects/projectname directory
# and eXPlainPMT lives in /projects/projectname/explainpmt
if [ ! $# == 1 ]; then
echo "Usage: $0 port-number"
exit
fi
`./script/server webrick -e production -p $1 2> temp_$` &
sleep 5
# Grab the pid and create a quick and dirty shutdown script
echo `awk '/pid=/ {split($5,thepid,"="); print "kill -9 " thepid[2]}'
temp_$` > backlog_stop
chmod +x backlog_stop
firefox http://localhost:$1
Also added an alias to .bash_aliases:
# Start any eXPlainPMT server
alias backlog='~/bin/backlog_start'

A comment on the installation instructions


I've used eXPlainPMT in the past and so I was reasonably familiar with it. Had that not been the case, I suspect I would have given up and looked for another tool. The installation instructions are sparse and several releases out of date. I don't know that a novice user would be successful following the published installation instructions. This may not be the best way to encourage people to use an Open Source product.

Next: Firefox development tools

Installing Git

Previous: Pimp My Instiki.

Git is a distributed source control management system that is useful both for managing my own local projects and for downloading and contributing to Open Source projects. I installed it on Ubuntu with this command:
sudo apt-get install git-core

Next: Installing eXPlainPMT

Friday, August 14, 2009

Pimp My Instiki

Previous: Installing support for .NET development.

Instiki is a simple wiki that I use to keep track of useful information. I find it easier to find information if it's organized in a wiki than if it's scattered all over the filesystem.

To get Instiki, go to http://www.instiki.org and download it. There's no further installation to do, and no mandatory configuration before you can start using Instiki. Start an instance by navigating to the directory where you installed Instiki and running the instiki command.

Instiki is very simple and is Open Source. Users are encouraged to customize it. Some people use Instiki as the basis of public websites, and they do some pretty extensive customization. For my purposes, it's just a single-user wiki running on my laptop. To make it a little friendlier and better integrated with my desktop, I've made the following changes.

Start and stop scripts


As shipped, Instiki expects you to start it from a command line and stop it by typing ctrl+C. I set up a start script that starts Webrick in the background and saves the pid so that a kill command can be issued later.

Start script is ~/bin/wiki. It picks up the pid from stderr, where Instiki writes it, and creates the stop script on the fly in ~/bin/wiki_stop. The stop script does a kill -9, since Instiki appears to ignore SIGTERM.
#!/bin/bash
# Start the instiki wiki
cd ~/wiki/inst*
`./instiki 2> wiki_$` &
sleep 12
# Grab the pid and create a quick
# and dirty shutdown script.
echo `awk '/pid=/ {split($5,thepid,"="); print "kill -9 "
thepid[2]}' wiki_$` > ~/bin/wiki_stop
chmod +x ~/bin/wiki_stop
# This will start Firefox if necessary.
# Otherwise it will open in a new tab.
firefox http://localhost:2500/
I set up aliases for the scripts in ~/.bash_aliases.
alias wiki='~/bin/wiki'
alias wiki_stop='~/bin/wiki_stop'

Associated an icon with Instiki and created a desktop definition


AFAIK no one has yet created a logo or icon for Instiki. I found a nice one in a set called Influens by artist Matt U on Deviant Art, at http://mat-u.deviantart.com/art/influens-icons-62280875. It looks like this:


The icon is apopros of the way I use Instiki in that it depicts a folder of documents with sticky notes on them, suggesting an informal, working scratchpad area.

I copied it to ~/wiki/instiki.png and created an instiki.desktop file in /usr/share/applications with the following contents:
[Desktop Entry]
Encoding=UTF-8
Name=Instiki
Comment=Personal Wiki
Exec=wiki
Icon=/home/dave/wiki/instiki.png
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
Made the favicon for Instiki match the desktop icon by copying the .ico version of the file to ~/wiki/inst*/public/favicon.ico.

Reclaimed screen real estate when viewing a page


By default, Instiki displays wiki content in a narrow column centered on the page. To make this area wider I made the following change in ~/wiki/inst*/public/stylesheets/instiki.css. As shipped, the definition of #Content looks like this:
#Content {
border-top:none;
margin:auto;
padding:0.3em;
text-align:left;
width:100%;
max-width:55em;
}
I removed the max-width specification, resulting in this:

#Content {
border-top:none;
margin:auto;
padding:0.3em;
text-align:left;
width:100%;
}

Reclaimed screen real estate when editing a page


The edit and create views provide a small textarea for entering content. They also display a few examples of wiki markup in an area on the right-hand side of the frame. Since I'm using Instiki on my local machine only, I don't have to worry about accommodating different screen sizes or different markup languages. I'd rather have a large textarea that mostly fills the frame. I don't need the markup help to be visible all the time and I'm always using Textile, so I could free up some real estate by replacing the help area with a single link. Here are the portions of ~/wiki/inst*/app/views/wiki/edit.rhtml that were affected, as shipped:

<%-
@title = "Editing #{@page.name.escapeHTML}"
@content_width = 720
@hide_navigation = true
-%>

<div id="MarkupHelp">
<%= render(:file => "#{@web.markup}_help") %>
<%= render(:file => 'wiki_words_help') %>
</div>

<% form_tag({
:action => 'save',
:web => @web.address,
:id => @page.name },
{ 'id' => 'editForm',
'method' => 'post',
'onsubmit' => 'cleanAuthorName()',
'accept-charset' => 'utf-8' }) do %>
<div>
<textarea name="content" id="content" rows="24" cols="60">
<%= h(flash[:content] ||
((params['content'] && params['content'].is_utf8?) ?
params['content'] : @page.content).purify) %></textarea>
. . .
I removed the MarkupHelp div, added a link to Textile help to open in a new tab, and increased the size of the textarea, resulting in this:

<%-
@title = "Editing #{@page.name.escapeHTML}"
@content_width = 720
@hide_navigation = true
-%>
<% form_tag({
:action => 'save',
:web => @web.address,
:id => @page.name },
{ 'id' => 'editForm',
'method' => 'post',
'onsubmit' => 'cleanAuthorName()',
'accept-charset' => 'utf-8' }) do %>
<div>
<a href="http://hobix.com/textile/quick.html"
target="_blank">Textile Help</a><br />
<textarea name="content" id="content"
rows="30" cols="190"><%= h(flash[:content] ||
((params['content'] && params['content'].is_utf8?) ?
params['content'] : @page.content).purify) %></textarea>
. . .
I made the same changes in ~/wiki/inst*/app/views/wiki/new.rhtml.

Disabled spam filtering


Since this instance of Instiki resides locally and is not accessible on the network, I didn't need Instiki to protect me from my own innocent updates. I disabled spam filtering by deleting the file config/spam_patterns.txt.

One more thing...


I copied my personalized version of Instiki over from my MacBook Pro rather than installing Instiki fresh and repeating the modifications. Initially, Instiki would not start up. It displayed the catch-all "Do you smell smoke?" message and offered no clues on the console or log file.

A brief Internet search turned up a note on http://rubyforge.org/pipermail/instiki-users/2009-April.txt reporting that on Debian and its variants (including Ubuntu) some packages on which Instiki depends are not installed by default. I ran the following command, and the problem was fixed:
sudo apt-get install 
ruby1.8-dev swig libsqlite3-ruby1.8 flex bison


Next: Installing Git

Thursday, August 13, 2009

Installing support for .NET development

This is a follow-up from Installing support for ColdFusion development.

Fair warning: This is not a definitive tutorial, it's just an informal record of my experiences in trying to install software for .NET development on Ubuntu. I had not done any .NET development prior to this. Maybe in a future blog post I'll have something more interesting to share.

.NET development is supported on Linux by the Open Source project mono, at http://www.mono-project.com. In reading about this on the web, I learned that the Ubuntu distro includes support for running .NET applications with mono, but not for developing them. My first step, then, was to install the basic mono package:
sudo apt-get install mono-devel
To verify the installation worked, I followed the instructions at http://www.mono-project.com/Mono_Basics to compile and run a few simple Hello World programs.

The first is a command-line Hello World that looks like this:
using System;

public class HelloWorld
{
static public void Main ()
{
Console.WriteLine ("Hello Mono World");
}

}
To produce a .NET 2.0 assembly, I compiled with
gmcs hello1.cs
No errors reported. To execute the program, I used
mono hello1.exe
It worked fine.

BTW this was my first-ever C# program. I'm so proud! :-) Oh, wait. I didn't test-drive it. I'm so ashamed. :-(

The second test was a gtk# version of the same thing. It looks like this:
using Gtk;
using System;

class Hello {

static void Main()
{
Application.Init ();

Window window = new Window ("helloworld");
window.Show();

Application.Run ();

}
}
and is compiled like this:
gmcs hello2.cs -pkg:gtk-sharp-2.0
I ran it with
mono hello2.exe
and it worked fine.

Next there was a Winforms sample. It looks like this:
using System;
using System.Windows.Forms;

public class HelloWorld : Form
{
static public void Main ()
{
Application.Run (new HelloWorld ());
}

public HelloWorld ()
{
Text = "Hello Mono World";
}
}
I compiled it according to the instructions with this command:
gmcs hello3.cs -pkg:dotnet
This one didn't go quite so well. It complained about 13 missing dlls.

I found a suggestion at http://code.google.com/p/paint-mono/issues/detail?id=6 to try this:
sudo apt-get install libmono-winforms2.0-cil
and compile with
gmcs hello3.cs -r:System.Windows.Forms.dll
This time the compile worked. I tried running the program with
mono hello3.exe
and it worked fine.

So at that point I had at least a partial installation of basic mono development tools. Clearly, there were still missing pieces, but at the time I did not know what more to look for.

MonoDevelop IDE


This is an IDE for working with mono. The home page is http://www.monodevelop.com. I installed it with
sudo apt-get install monodevelop
Mono Develop appeared under Applications -> Programming and it started up nicely. I didn't know what more to check, so I declared victory and moved on.

NUnit (unit testing tool)


I didn't find any useful help on the NUnit site at http://www.nunit.org, so I searched the web and found some help at stackoverflow.com/questions/924239/what-the-best-setup-latest-mono-monodevelop-on-ubuntu-9-04. They suggested this:
sudo apt-get install
monodevelop-nunit monodevelop-debugger-mdb
As far as I could tell, this appeared to work.

NUnit with MonoDevelop


I had to search for help with this, as well. There doesn't seem to be any single comprehensive source of "getting started" information for people who want to learn to work with mono. At http://www.dijksterhuis.org/using-nunit-with-monodevelop/ Martijn Dijksterhuis suggests the following.

First, create a new Solution in MonoDevelop. I chose Console Project and skipped the options presented in the Project Features dialog. Then, right-click the References item in the Solution tree menu in the left-hand pane. Choose Edit References and select NUnit.Core and NUnit.Framework to include them in the Solution. What I found at that point were two options named nunit.core (all lower case) and two options named nunit.framework. One of each had a version number. I chose the entries that had version numbers.

Next step was to paste in the sample program Martijn had posted:
using System;
using NUnit.Framework;

namespace bank
{
public class Account
{
private float balance;
public void Deposit(float amount)
{
balance += amount;
}

public void Withdraw(float amount)
{
balance -= amount;
}

public void TransferFunds(Account destination, float amount)
{
}

public float Balance
{
get { return balance; }
}
}
}

namespace bank
{
[TestFixture]
public class AccountTest
{
[Test]
public void TransferFunds()
{
Account source = new Account();
source.Deposit(200.00F);
Account destination = new Account();
destination.Deposit(150.00F);

source.TransferFunds(destination, 100.00F);
Assert.AreEqual(250.00F, destination.Balance);
Assert.AreEqual(100.00F, source.Balance);

}

[Test]
public void DepositFunds()
{
Account source = new Account();
source.Deposit(200.00F);
Assert.AreEqual(200.00F, source.Balance);
}

}
}

namespace UnitTestDemo
{
public class MyAccountingSoftware
{

public static void Main()
{
bank.Account DemoAccount = new bank.Account();
DemoAccount.Deposit(1000.00F);
DemoAccount.Withdraw(500.50F);
Console.WriteLine("Our account balance is {0}", DemoAccount.Balance);
}

}
}
I chose View -> Unit Tests from the MonoDevelop menubar and right-clicked my Solution, then chose View -> Test Results to see the results. It appeared as if NUnit ran, and the sample program had 1 passing and 1 failing test. Looked good enough as a start.

Next: Pimp My Instiki

Installing support for ColdFusion development

Previous: Installing Tomcat.

I wanted to set up a ColdFusion development environment similar to that used at a current client of mine. That environment is based on ColdFusion, ColdSpring, ModelGlue, and MXUnit. The software used in this set-up is:
  • Eclipse - development IDE
  • ColdFusion - the base product
  • ColdFusion Eclipse Plugin - Eclipse support for ColdFusion development
  • ColdFusion ModelGlue - an MVC framework for webapps
  • ColdSpring - a Spring-like IoC implementation for ColdFusion
  • MXUnit - a unit test framework for ColdFusion, based on JUnit
  • CFEclipse Plugin - Eclipse support for CFML
  • MXUnit Eclipse Plugin - Eclipse support for MXUnit

ColdFusion


I followed instructions on http://www.adobe.com to download and install ColdFusion Developer Edition.
  1. Navigate to the ColdFusion product page on Adobe's website: http://www.adobe.com/products/coldfusion/.

  2. Follow the link labeled Download the free Developer Edition.

  3. Sign in to the Adobe site. Create a userid and password if you don't already have one. Don't worry, it's harmless.

  4. From the drop-down list for ColdFusion Developer Edition, choose the appropriate language and operating system.

  5. Click the button labeled Download next to the Developer Edition drop-down box.

  6. I copied the downloaded file, which is an installation program, to an "installation" directory, gave myself execution permission on it, and ran it. I followed the prompts to install a standalone ColdFusion server with a root directory of /home/dave/coldfusion8, to listen on port 8500.

  7. Started ColdFusion with
    sudo ./coldfusion8/bin/coldfusion start
    and navigated in Firefox to localhost:8500. (Yeah, you read that right: You need root privileges to start a single-user development server on your own machine. That's "enterprise" software, for ya. <sigh>) It told me no application was configured to respond to the request. I tried localhost:8500/CFIDE (based on what I saw in ~/coldfusion8/wwwroot, and not because I knew what I was doing) and it displayed a directory listing of wwwroot/CFIDE. I clicked on administrator and the ColdFusion Administrator app started up. It accepted the password I had defined during the installation process, and appeared to be working. I took this to mean a crude install of the base product had been accomplished. I looked, but couldn't find a sample app. Often, vendors include a sample app you can attempt to run, so that you can see whether the product installed correctly. No such luck here. If there are problems, I suppose they will turn up as I continue configuring the environment.

Install ColdSpring


ColdSpring is a port of Spring to ColdFusion. Its main features are support for IoC and AOP. I obtained it from http://www.coldspringframework.org/. The site offers a quick start guide, a reference guide, and API docs for CFCs. The simplicity and clarity of the packaging and documentation were a refreshing contrast to the "enterprisey" organization and packaging of ColdFusion itself.

I downloaded the pdf Reference Guide. The guide states you can install ColdSpring by placing the source in the web root directory. I learned the hard way that they should have said to unpack the distribution archive in the web root directory. "Place the source" there didn't imply that to me.

There is more than merely a problem with wording, though. While the Reference Guide says you can either place the source in wwwroot or define mappings in Administrator, in fact you must do both. After I defined a mapping for /coldspring to wwwroot, the quickstart app worked. The other sample apps did not work. This tells me the basic install is okay, and there are some configuration secrets that the developers and supporters of ColdSpring think are too obvious to bear mentioning. I'll have to seek help to complete the configuration later, when I'm ready to try using these tools.

Install ModelGlue


ModelGlue is a Model-View-Container framework that comes in ColdFusion and Flex flavors. I downloaded a zipped distribution archive from http://www.modelglue.org. At first glance, the documentation at http://docs.model-glue.com/ looks comprehensive, well-organized, and filled with concrete, practical examples, tutorials, and how-tos. One exceptionally good feature of the documentation is that the main heading on the first page reads, "Don't panic!" The site also has installation and configuration instructions, which I followed more-or-less like this:
  1. Unpack the distribution archive
  2. Copy the ModelGlue folder to ColdFusion's wwwroot folder

Install MXUnit


MXUnit is a unit testing framework based on JUnit. To get it, I went to http://www.mxunit.org/ and downloaded the distribution archive. Then I unpacked it in the coldfusion8/wwwroot directory.

To verify the installation, I started the ColdFusion server and went to http://localhost:8500/mxunit/index.cfm. It ran a trivial sample app and displayed a "Congratulations" message.

So far, so good with the ColdFusion setup.

Install the CFEclipse Eclipse Plugin


This is an Eclipse plugin that provides language support for ColdFusion Markup Language (CFML). The CFEclipse wiki has current information about the Eclipse update site, recent versions, known problems and workarounds. When I installed it, the update site was www.cfeclipse.org/update. Installation instructions are at http://trac.cfeclipse.org/wiki/InstallingCfeclipse. I followed the instructions more-or-less this way:
  1. Started Eclipse
  2. From the main menu, chose Help -> Install New Software...
  3. In the Install dialog window, clicked the Add button. Entered 'CFEclipse' in Name and 'http://www.cfeclipse.org/update' in Location. Clicked OK.
  4. Eclipse displayed two downloadable items, the editor and the documentation. I checked both. I also unchecked the 'group items by category' box and clicked Next. This resulted in an error, apparently because it tried to grab the documentation for Eclipse 3.4 and 3.5. I only needed 3.5, so I deselected the documentation for 3.4 and tried again. It seemed to like this better.
  5. Clicked Next on the 'review' dialog.
  6. On the 'accept licenses' dialog, clicked the 'accept' radio button but the installation did not work. The Next and Finish buttons remained disabled. I tried checking 'do not accept', scrolling from top to bottom of each license, and then checking 'accept' on each one. This time, the Finish button became enabled.
  7. Eclipse called for a restart, and I clicked Yes to restart it.
Since I have no existing ColdFusion code and no ColdFusion experience, I didn't try to write a test app. I noticed that when I opened the perspectives dialog, there was an entry for CFEclipse. I chose it and things looked pretty normal.

Install the MXUnit Eclipse Plugin


The installation instructions at http://www.mxunit.org/doc/index.cfm?doc=installplugin appear to be designed for an earlier version of Eclipse and for Microsoft Windows. It looks like a standard Eclipse software update, so I used the information from the site but followed a procedure like the one I used for the CFEclipse Plugin. The update site is http://mxunit.org/update. This installed MXUnit Test Runner.

At this point I believed I had a working installation of the ColdFusion development tools my client uses.

Next: Installing support for .NET development.

Installing Tomcat

Previous: Installing Tomcat - FAIL!

I went to http://tomcat.apache.org and downloaded a zipped archive of Tomcat. I unpacked it into my home directory, resulting in a directory tree starting with apache-tomcat-x.x.x. I renamed the top-level directory tomcat-dev.

In Terminal I changed to the tomcat-dev/bin directory and granted execute permission on everything in it with
chmod +x *
Then I tried starting Tomcat with
startup.sh
I expected this to start a server listening on port 8080. It worked.

I edited conf/server.xml and set the connection port to 8081. I edited conf/tomcat-users.xml to define a user like this

<role rolename="manager"/>
<role rolename="tomcat"/>
<user username="tomcat" password="tomcat" roles="tomcat,manager"/>
</tomcat-users>
Tomcat started properly on 8081, and I could get to the Manager app.

Next: Installing support for ColdFusion development

Installing Tomcat - FAIL!

Previous: Installing support for Java development

Installing Tomcat should be routine. I've done it many times on Windows and OS X systems. Installing it on Ubuntu turned out to be a lengthy and frustrating experience.

The Ubuntu help pages have a description of how to install Tomcat system-wide or on a per-user basis for a development environment; see https://help.ubuntu.com/8.10/serverguide/C/tomcat.html.

I followed the instructions provided on that page under Using private instances. The commands to install Tomcat and to create a user-specific instance were:
sudo apt-get install tomcat6-user
tomcat6-instance-create my-instance
This resulted in a Tomcat installation under ~/my-instance. I'm not crazy about that directory name. Before changing it, I wanted to verify the installation was okay so far. I checked my-instance/conf/server.xml and saw it was set to listen on port 8080, so I left it alone. I ran this command:
my-instance/bin/startup.sh
Browsing to localhost:8080 in Firefox got me a blank document. I tried localhost:8080/manager and got a blank document. I tried localhost:8080/tomcat and got a blank document. In my-instance/logs, both catalina.out and the log file indicated startup was normal, services started properly, and showed no other activity and no errors. I had not seen this behavior in a Tomcat installation before.

I edited my-instance/conf/server.xml and changed the connector port to 8088, then tried it again. Same behavior. The documentation states that no webapps are deployed by default. That might be the reason it serves nothing but blank documents. Apparently, the manager app is not included in the per-user package. Normally, I expect to see the "It works!" message by default.

My next thought was to download the manager application by itself and drop it into the webapps directory. All the documentation I could find stated that the manager application is included by default in Tomcat installations. Clearly, this is not the case for the user-specific Ubuntu package.

The Ubuntu Tomcat help page listed this command to install the manager application, assuming you had installed the service version of Tomcat. It looked as if this might do the trick:
sudo apt-get install tomcat6-admin
Unfortunately, this resulted in a Tomcat service automatically installing and starting.

It was unclear how to shut the thing down manually. I found a posting online that indicated the start and stop commands are in /etc/init.d. I ran
/etc/init.d/tomcat6 stop
to shut down the instance. I was unable to locate a .war file for the manager app anywhere.

A task that should have taken me five minutes had now extended into hours. I had to stop and go to work. Before I gave up for the morning, I found a backup copy of another Tomcat installation on an external hard drive. I was thinking of copying the manager and host-manager applications from there to the user-specific Tomcat installation on Ubuntu, but on reflection I realized this was not a repeatable or reliable way to install software.

I decided to install dev instances of Tomcat the "old-fashioned way."

Next: Installing Tomcat

Installing support for Java development

Previous: Installing support for Ruby development.

Basic software installs


I installed the Java development tools, Eclipse, and Maven with these commands:
sudo apt-get install sun-java6-jdk
sun-java6-plugin maven2 eclipse
To check which version of Java was the default after the install, I ran
java -version
It displayed 1.5.0, so I ran this command to set version 6 as the default:
sudo update-java-alternatives -s java-6-sun
After that when I ran java -version it came back with 1.6.0.

To verify maven2 was installed correctly, I ran the following command:
mvn --version
No problems at this point.

To verify Eclipse was installed correctly, I went to the Applications -> Programming on the main menubar and saw there was an entry for Eclipse. I selected it, saw that it started, and exited. I noticed the version was 3.2. I will check into getting a more recent version later.

Maven configuration


Although maven2 appeared to have installed correctly, I was unable to locate the local repo or the maven home directory or any environment variable settings pertaining to maven. A quick web search failed to turn up any useful information about the default location where apt-get installs maven2.

As far as I could tell, being a n00b and all, the environment variables maven2 supposedly needs to be set were not set, and there was no local repo. I decided to try
mvn archetype:generate
just to see whether it would do anything or complain about missing components or unknown paths or whatever. I chose quickstart when prompted, and it worked perfectly. It also created .m2/repository as it downloaded dependencies. Nice to know.

Upgrading Eclipse to 3.5 "Galileo"


At the time I installed it, the latest Eclipse release wasn't yet included in the Ubuntu distro. John Paulett provides a nice set of instructions for installing it on Ubuntu 9.04 on his site at http://johnpaulett.com/2009/06/26/install-eclipse-galileo-3-5-on-ubuntu-jaunty-9-04/. Using his instructions as a guide, this is how I installed Eclipse 3.5:
  1. Created a directory for Eclipse under /home. John recommends ~/bin/packages/eclipse, and he later installs Galileo in ~/bin/packages/eclipse/eclipse3.5 because he needs multiple versions of Eclipse. I don't need multiple versions, so I installed it in ~/bin/packages.
    cd ~/bin
    mkdir packages
  2. Downloaded the 64-bit version of Eclipse 3.5 (long lines are broken for readability in Blogger):
    cd packages
    wget http://d2u376ub0heus3.cloudfront.net/galileo/
    eclipse-java-galileo-linux-gtk-x86_64.tar.gz
  3. Next, I unpacked the archive in place, in the packages directory:
    tar xzvf eclipse-java-galileo-linux-gtk*.tar.gz
  4. I deviated from John's instructions at this point, and just updated /usr/share/applications/eclipse.desktop to point to the executable I had just installed:
    Exec=/home/dave/bin/packages/eclipse/eclipse

I started Eclipse from the main menu, Applications -> Programming -> Eclipse, and it started the new Galileo version. Eclipse had no trouble opening one of the workspaces I had copied over from my OS X system.

Eclipse configuration


I set the M2_REPO classpath variable in Eclipse to point to the local repo. I started Eclipse and navigated to Window -> Preferences, then expanded the tree menu items Java -> Build Path -> Classpath Variables.

I noticed that this version of Eclipse comes with an M2_REPO already defined. It points to the default location of /Users/dave/.m2. Then I chose Edit and changed the value to /home/dave/.m2.

Migrating Java development projects


I copied my ~/.m2/repository from the MacBook Pro to an external drive, and then from there merged it with the ~/.m2/repository on Ubuntu.

I copied my eclipse-workspaces directory from the MacBook Pro to the external drive, and from there to the ~/projects directory on Ubuntu.

Next step was to try and build the projects I'm currently working on to discover what configuration options I would have to change to get things working on the new system. I've been around the block too many times to expect things to "just work." Somewhere, something must be pointing to a resource that doesn't exist on the new system, or depends on a different version of something than the one I've installed. I decided to try building a Function Point Analysis application I'd been working on last year. It's a good test case for maven2 because it's got multiple components and a hierarchy of POMs.

I was surprised and pleased when mvn compile worked on the first try. I ran mvn test and got two failures out of many, many tests. Old, dusty neurons fired, reminding me that these tests used to fail with maven on my old system, too. They worked under Eclipse. So it was time to see if Eclipse would "just work," too. Wouldn't that be nice? Sure it would. Actually, I knew it wouldn't work because I needed to change the build dependencies in Eclipse to reflect their new locations. But I could at least see that no other, unexpected errors occurred.

The project would not build inside Eclipse because references to external libraries were invalid. I expected this, since I had set things up differently on OS X. I knew I would have to redefine a few things with the new setup. I was satisfied that things were in place and would work. There was just some housekeeping to do since I had decided to organize the files differently on the new system. Java was good to go!

Next: Installing Tomcat - FAIL!

Wednesday, August 12, 2009

Installing support for Ruby development

Previous: Updating Ubuntu.

Ruby


To install Ruby support:
sudo apt-get install ruby-full

Geany (an IDE)


Low let's get Geany, a rudimentary IDE I find handy for Ruby development.
sudo apt-get install geany

Gems (to install other Ruby packages)


This installation procedure is a little different from the usual apt-get thing.

1. Look on Ruby Forge and see what the latest version of Ruby Gems is: http://rubyforge.org/frs/?group_id=126. Hover over the .tgz filename to see the correct URL for the wget command.

2. The Ruby community does not recommend using apt-get to install Ruby Gems because Advanced Package Tool and gems may get out of sync about versions. The recommended way is to open a Terminal window and enter the following commands (in this case the version I found in step 1 was 1.3.4). Long lines are split for readability in Blogger. Use common sense.
cd ~
wget http://rubyforge.org/frs/download.php/57643/
rubygems-1.3.4.tgz
tar xzvf rubygems-1.3.4.tgz
cd rubygems-1.3.4
sudo ruby setup.rb
3. Note which executable was installed (a message appears near the end of the installation) and define a symlink to it. In this case it was version 1.8.
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
4. If the installation worked, the following command will display version information. In this case we want to see "1.3.4". By changing directories first I help myself believe the PATH was updated. I hear it's good to believe.
cd
gem -v

MySQL server


I use MySQL for Ruby on Rails development (and other things, too). To install:
sudo apt-get install mysql-server
Of course, you should set the MySQL root password to something other than "empty" when prompted. The installer starts mysqld. To be sure it worked, run
ps ax | grep mysql
and look for /var/run/mysqld/mysqld.pid.

After installation, you can stop and start MySQL through System -> Administration -> Services on the main menubar. Alternatively, you can start and stop MySQL from a Terminal window using the commands:
sudo /etc/init.d/mysql start
and
sudo /etc/init.d/mysql stop

MySQL GUI client


To install a gui client for MySQL, choose Applications -> Add/Remove Applications from the main menubar. If prompted to update the list of available packages, do so. Under Show, choose "All available applications". Select "MySQL Administrator" for a GUI client and "MySQL Query Browser" for a GUI tool for running queries. After the installer finishes, the two applications will appear under Applications -> Programming on the main menubar.

Ruby bindings for MySQL


Open a Terminal window and enter the following commands:
cd ~
sudo apt-get install libmysql-ruby libmysqlclient-dev
The package libmysqlclient-dev is a virtual package. When you run the command above, you will see an error message that shows the name of the real package. Substitute it in the command line and run it again. When I ran it, it showed libmysqlclient15-dev, so I ran the command this way:
sudo apt-get install libmysql-ruby libmysqlclient15-dev
Run this command to build it:
sudo gem install mysql

Rails


Use Gems to install Rails. Open a Terminal window and enter the following command
cd ~
sudo gem install rails
If the installation succeeded, the following command will display version information:
rails -v
Verify the installation by generating a trivial rails app:
cd ~
rails myrailsapp -d mysql
or, for sqlite3:
cd ~
rails myrailsapp
In myrailsapp/script, run the command:
./server
If all is well, a WEBrick server will start and will listen on port 3000 for HTTP requests. Try loading the following URL in a browser. You should see a welcome page.
http://localhost:3000

Testing tools


These are tools for test-driven-, behavior-driven-, and storytest-driven-development:
  • Autotest - continuous testing (part of ZenTest)
  • Cucumber - storytest tool
  • RCov - coverage tool
  • rspec - BDD tool
  • Webrat - browser simulator (used by Cucumber)

On Debian variants (like Ubuntu), you have to install a couple of libraries before installing Webrat. They are needed by Nokogiri, the XML libary used in Webrat.
sudo gem install ZenTest
sudo gem install rcov
sudo gem install rspec rspec-rails
sudo gem install cucumber
sudo apt-get install libxslt1-dev libxml2-dev
sudo gem install webrat

Some conveniences


I'm rather slow-witted, so I find it helpful to follow a few conventions even though I'm the only person working on my system or on my little side projects. I put my software development projects under a directory called /projects. I nearly always use Geany for Ruby on Rails development. I use rspec and Cucumber with these projects. So it's convenient to have a quick way to set up a new Ruby on Rails project in the usual directory that includes the elements I usually want and that creates a Geany project file. To that end, I created a shell script in ~/bin that sets these things up for me. The script newrailsapp looked like this as of the time I posted this information:
#!/bin/bash
if [ -z $1 ]; then
echo "usage: newrailsapp appname"
exit
fi
if [ -e $1 ]; then
echo "Can't create $1 because it already exists. Quitting."
exit
fi

# Create the rails app

rails -d mysql $1

# Generate rspec support for the app

cd $1
./script/generate rspec
./script/generate cucumber

# Create a geany project file for the app

echo "Creating geany project file $1.geany"
cd ..
echo "[indentation]" > $1.geany
echo "indent_width=4" >> $1.geany
echo "indent_type=1" >> $1.geany
echo "indent_hard_tab_width=8" >> $1.geany
echo "detect_indent=false" >> $1.geany
echo "indent_mode=2" >> $1.geany
echo " " >> $1.geany
echo "[project]" >> $1.geany
echo "name=$1" >> $1.geany
echo "base_path=/home/dave/projects/$1/" >> $1.geany
echo "make_in_base_path=false" >> $1.geany
echo " " >> $1.geany
echo "[files]" >> $1.geany
echo "current_page=-1" >> $1.geany
Also created these aliases in ~/.bash_aliases:
# Start Geany (IDE)
alias geany='geany &'
# Start and stop any Rails test server
alias server='script/server &'
alias server_stop='~/bin/server_stop'

The alias geany just starts Geany in the background. Saves a couple of keystrokes.

The purpose of server is to start a Webrick server for dev-testing a Rails app. It's meant to be run from a command line when you're in the appropriate project subdirectory. The server script looks like this:
#!/bin/bash
script/server &
The purpose of server_stop is to stop a Webrick server. It looks like this (with the usual caveat about long lines)
#!/bin/bash
kill -9 `ps -o pid,cmd --no-heading -p $(pgrep ruby)
| grep script/server | awk '{print $1}'`
The assumption is that there will only be one Webrick server running at a time. It's a safe assumption because all of this is set up for a single user environment.

Next: Installing support for Java development

Updating Ubuntu

Previous: Toshiba Satellite Ubuntu-Vista dual-boot configuration.

With the basic install of Ubuntu done, it was time to bring the instance up to date. To do that, I ran the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
The first two commands download and install various software updates for the OS.

The build-essential package consists of C header files, libraries, compilers and so forth necessary for building software.

Next: Installing support for Ruby development

Tuesday, August 11, 2009

Toshiba Satellite Ubuntu-Vista dual boot configuration

Previos: The Great Laptop Quest Part 2: The Hardware.

It should be a straightforward matter to configure a machine to boot into alternate operating systems. Resize, move, and/or create partitions on the hard drive or drives; install the operating systems into the appropriate partitions; mount any shared data partitions in each operating system; and "To start, press any key."

It should be a straightforward matter.

In reading about the particular hardware and software products I intended to configure on the Toshiba Satellite laptop, I learned about quite a few problems people were having when trying to set up a dual boot with Windows Vista. Vista, it seems, is a bit non-standard in the way it manages its boot partition. What's more, it's fairly unfriendly toward those who try to muck with it. The salient points are:
  1. Vista has to boot from the first primary partition on the hard drive.

  2. Vista writes a special "boot code" into bytes 63 through 2047 of the boot partition. The "real" partition data starts at offset 2048. This appears to be designed to defeat partition management programs that were not published by Microsoft Corporation. If that was the design intent, then it has succeeded.

  3. When you use a non-Microsoft partition management program to shrink the Vista boot partition to make space on the hard drive for a second operating system, the program might innocently rewrite the partition data starting at offset zero. After all, why shouldn't it? At that point Vista is broken.

  4. Did I say "broken?" I'm sorry. I meant to say, "unrecoverable." There's no option but to reinstall Vista from scratch using the original installation DVDs. Unfortunately...

  5. ...you don't have the original installation DVDs if you purchased an OEM system with Vista pre-installed.
On my first attempt to set up the dual boot environment, I followed the tutorial at http://apcmag.com/how_to_dualboot_vista_with_linux_vista_installed_first.htm, which seemed to me to be well throught-out and reasonable. I used Vista's Disk Manager utility to shrink the partition. Then I installed Ubuntu using a Live CD burned on the Mac. The installation went smoothly and there were almost no issues on the Ubuntu side. I spent a few hours tracking down a problem with Ubuntu recognizing the Intel 5100agn wireless chipset, and there was an issue with power management settings causing "shutdown" to terminate Ubuntu but not to turn the machine off. When I booted into Vista the first time after the Ubuntu install, there were no errors related to the partition resize.

So I had a functional dual boot configuration. But the resulting configuration was not quite what I had in mind. Disk Manager would not allow the Vista boot partition to shrink any smaller than about half its original size. That resulted in a Vista partition of about 154 GB. Since my goal was to create a shared data partition occupying most of the hard drive space, most of the Vista partition would simply contain wasted space. What I really wanted to do was shrink the Vista partition to about 16 GB. Neither Disk Manager on Vista nor the partitioner in the Ubuntu install process offered a way for me to set up the partitions in this way, although the Ubuntu installer did have an option to set up all partitions manually. Under the circumstances, I wasn't confident that doing so would leave Vista undamaged or recoverable.

What I had in mind was a configuration like the one described in this description of a partitioning scheme: http://www.psychocats.net/ubuntu/partitioning. Although Ubuntucat considers this approach outdated and currently favors Wubi, I think the partitioning scheme shown below would be ideal for my needs:



What about the risk of destroying my Vista installation? I sifted through many online forum postings, blog entries, and articles. I kept finding contradictory information. It occurred to me that the apparent contradictions might simply be due to timing. Many of the horror stories about repartitioning causing a broken and unrecoverable Vista installation dated from 2007. Reading more carefully, I learned that gparted version 0.3.4 and later are reported to be able to resize a Vista partition without damaging it, although moving a Vista partition may require a system recovery using a bootable Vista installation disc. Well, I wasn't planning to move the partition, was I?

Furthermore, I read on a couple of forums (for instance, here: http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=45393&tstart=0) that Toshiba ships its pre-installed Vista systems with a recovery partition on the hard drive, as well as a utility to create a bootable recovery disc based on the contents of that partition. It was claimed that the recovery disc can fix the problems that resizing the Vista partition might cause. "Recovery" in this case means restoring the factory settings; that is, putting the factory-installed Vista back where it was when the unit shipped. That would wipe out any user data or installed applications as well as the Ubuntu partitions. But it would (hopefully) get the machine back into a usable state so that I could continue to break it again and again in the process of learning how to get to the configuration I really wanted.

This information gave me greater confidence to try to configure the hard drive as I had originally intended. In addition, my risk of data loss was minimal. I had not yet installed anything on the Vista instance or the Ubuntu instance. They were both clean installs. If the Vista recovery disc failed to repair any damage I might do to the Vista partition, I could order an installation DVD from Toshiba for a nominal price (about $20). My greatest cost in that case would be the time lost while waiting for the installation DVD to be delivered. Even if that failed, I could conceivably install Ubuntu alone on the Toshiba laptop and use the little Acer unit for the two Windows-specific applications I cared about. All my current work is safely on the MacBook Pro and/or an external storage device.

So, why not?

I booted from the Ubuntu Live CD and followed the instructions at https://help.ubuntu.com/community/WindowsDualBoot for setting up a dual boot configuration with Windows. The partitioner was unable to resize the Vista partition. After it spun for a long time at 0% complete, it aborted the operation with no further information.

End of story for now. Obviously, I need more knowledge and experience before I can successfully set up a system such as many Linux aficionados consider routine and simple. Frustrating!

Afterwards I tried booting into Vista. It detected a problem with the hard drive and ran chkdsk. It found no errors, yet hung at the point where it says, "Please wait while your computer restarts." After 15 minutes the computer had not restarted. With some apprehension, I powered it off manually and turned it back on. Fortunately, Vista started normally this time.

Next, I shut down Vista and booted into Ubuntu, to ensure I hadn't broken it. It started fine.

For the moment, the configuration has a couple of shortcomings:
  1. I wasn't able to allocate as much hard disc space to Ubuntu as I had wanted; and
  2. My /home directory will be embedded in the same partition as the rest of Ubuntu.
When I've learned enough to configure the system in a more suitable way, I'll be able to save my /home directory contents by making a backup of its contents prior to installing another Linux. That's slightly less convenient than having the /home directory in its own partition, but probably not a big deal.

Next: Updating Ubuntu