Ubuntu 9.10 Karmic Koala on Dell Inspiron 6000

October 31st, 2009

Ubuntu’s 9.10 Karmic Koala release dropped yesterday, and I dove right in, downloaded it (via BitTorrent), and installed it on my aging Dell Inspiron 6000 laptop.

I didn’t do an upgrade, I reformatted my primary partition, and installed it clean. I keep my /home directory on a separate partition precisely so that I can do this easily, every 6 months as a new release comes out.

Installation was quick and easy, and so far, I’ve seen no major problems.

Notes so far:

  • As expected, the “Extra” visual effects (Compiz) does not work properly (the laptop has an ATI Mobility Radeon X300). “Normal” visual effects mode works fine.
  • The base installation is missing just about every useful codec. This blog post is a nice guide to installing all of the media “goodies” in Karmic.When I first installed all of the packages listed here, none of the video codecs seemed to work properly, including “Movie Player” crashing whenever I tried to open a video of any type. I figured that I’d either have to uninstall the packages, or maybe just re-install Karmic, and then install one package at a time, until I found the culprit. Fortunately, at this point, I powered the laptop off. When I started it again, everything worked fine, and has continued to do so.
  • I was seriously impressed with the short boot time in Jaunty Jackalope, and Karmic’s boot time is even faster. All I can say is, “Wow!”
  • Karmic has a new login screen, that lists the user names, and has you pick one. Frankly, I don’t care for it. First, my fingers are “trained” to type my user name and password to log in, and now I frequently type my user name in the password field. Second, not that I need to worry about it so much on my home laptop, but displaying a list of the user names lowers the barrier for someone attempting to log in who shouldn’t be able to. Third, I think that the new screen is very ugly. I like Ubuntu, but their themes always seem to suck bigtime. Brown themes, black login page with blocky graphics…ugh. Fortunately, this stuff is easy to change.
  • I don’t do a wide variety of things with this laptop – basically web browsing and Java programming. Occaisional audio editing. Occaisional image editing. Not too much else, so I can’t really comment on the range of applications that ship with this version. I’ll report more as I find anything interesting.

iPhone app development with Linux

October 4th, 2009

My employer, Chariot Solutions, held an in-house, week-long iPhone development course, taught by the folks at Big Nerd Ranch.

The course was great, we all learned a lot, and several of our folks are working on some apps, including one that they announced recently at JBoss World.

80% or more of our consultants have MacBook Pros, however, I opted for a Dell with Ubuntu when I joined Chariot about a year and a half ago.
I borrowed a MacBook for the course (thanks, Ken!), but have been feeling a bit left out since then, as the official Apple development tools (XCode and Interface Builder) only run on OS X.

I had previously whined about the fact that the official toolchain uses GCC under the covers, and that therefore, someone who knows GCC well (as in not me) ought to be able to get something working on Linux. Since then, I’ve seen a few pages on the web with instructions for getting arm-apple-darwin9-gcc working on Linux, but none seemed to have complete instructions on how to get the development environment working.

Well, yesterday, I decided to look harder, and found a site that explains setup of an iPhone development environment on Linux in detail.
With the help of the instructions there, I was able to get the toolchain working under Linux, and with some information gleaned from other websites as well, was able to compile an iPhone app, install it on my phone, and run it. I can stop whining now:-)

So, I’m putting all of the information that I have about this process here, in one place, where I can find it again later – if you have read this far, then I hope it helps you too.

What you need:

  • A computer running Linux
  • A Jailbroken iPhone (see my previous blog post for instructions)
  • A Wifi network to enable your computer to communicate with your iPhone
  • A copy of the phone’s firmware – since you just jailbroke your phone, you have a copy of this – it’s the .ipsw file
  • The IPhone 3.0 SDK (see http://developer.apple.com/iphone/)

The steps:

  • Make sure that the Cydia package manager is installed on your iPhone – if you followed the instructions linked above, it should have been installed as part of the jailbreaking process.
  • Use Cydia to install OpenSSH – this installs an SSH Daemon on your phone, so that you can ssh into the phone from your computer. Your makefiles will include ssh and scp commands to get the app to your phone and install it properly. Before moving on to the next step, make sure that you can get OpenSSH running, and can successfully ssh into your phone as root, and get a shell prompt. If you need help with this, look here.
  • Use Cydia to install Apt. Sometimes things are just easier from the command-line.
  • Use Apt (or Cydia) to install the “ldid” package. Some makefiles that you will encounter will use this to pseudo-sign the app directly on the phone.
  • Follow the instructions at http://code.google.com/p/iphonedevonlinux/wiki/Installation to install the toolchain, including installation of the packages listed there.
  • Follow the instructions to download and build the HelloToolchain application. Note: make sure that your phone and computer are both connected to the same wifi network, that the SSH daemon is running on your phone, and that you know your phone’s IP address. To make things easier on myself, I set up my wifi router to recognize the iPhone’s mac address, and to always give it the same IP address. Now, I can use a shell script to invoke make with the proper address, and I don’t have to check the phone’s address each time.

Once that simple app builds, installs, and runs, you are almost in business. The major issue is that HelloToolchain, being a simple test app, doesn’t show you how to structure things for a “real” application. And if you’re not a Makefile geek, it may not even be obvious how to build an app that consists of more than one source file. So, go to http://code.google.com/p/apiexplorer/ and download the iPhone API Explorer project. It demos just about every user interface object, and has a really well-thought-out Makefile (be sure to use Makefile.linux) that shows how to build a complex project.

If you have gotten this far, you are probably tired by now of typing in the password for your phone three or four times for each build.
To set up public key authentication for your phone:

  • ssh into your phone, use apt to install vim if necessary, and then use it to edit /etc/ssh/sshd_config
    • uncomment the line: PubkeyAuthentication yes
    • use the ssh-copy-id script to copy your public key to the phone.

That should do it. Happy iPhone programming!

Why I Won’t Be Downloading The CNN iPhone App

October 4th, 2009

CNN released it’s new iPhone app with a big splash last week.

It’s a paid app – $1.99 at the App Store. The rub is, it apparently has in-application advertising too.

Apparently quite a number of people are just fine with this, but I find it pretty appalling. You can either charge me for your app, or push advertising to me when I use your app – but not both. CNN does this on cable t.v. too. I don’t care much for that either, but at least I can timeshift that with my DVR, and then fast-forward through the commercials.

I would imagine that CNN will get most of it’s revenue from the advertising, and relatively much less from the $1.99 app purchase price.. I would prefer that they, like the New York Times and MSNBC,  make their app free – and I’m voting with my wallet.

Switching J2EE Application Servers

September 12th, 2009

I’ve seen a lot of articles lately that talk about the nuts and bolts of moving from one J2EE server to another.

I’ve also seen that a number of companies are struggling with this issue, sometimes even just when upgrading to a newer version from the same vendor.

Umm…folks…J2EE is supposed to be a standard.

Remember, “write once, run anywhere” ? That was supposed to be especially easy on the server side.
Well, actually it is, if you resist the temptation to use proprietary, non-standard features.

I have never willingly written a line of vendor-specific J2EE code or configuration – and I suggest that you don’t either.
There’s almost always a standards-compliant, or at least portable way to do whatever you need.
If you’re having an issue moving your J2EE application to a different server, you’ve probably done something horribly wrong. Frankly, this is true of databases as well (see my “stupidity rant” from earlier today).

Ok, so you have a legacy app that uses vendor-specific features. Maybe you didn’t write it – you’re just stuck maintaining it.
Remember this when you are rewritng your legacy app – stay away from vendor-specific features this time, and don’t create another instant-legacy app.

Infinite Stupidity

September 12th, 2009

As Albert Einstein has been quoted as saying, “Two things are infinite: the universe and human stupidity; and I’m not sure about the universe.”

*** Warning: this blog entry is a rant. The opinions expressed here are entirely mine, and do not necessarily represent the opinions of my employer, whose website links here.

The more I observe human behavior, the more I agree with Einstein on this issue.
I’m not, as you might expect, just talking about the domain of software engineering, but of course, that’s included too :-)

Here are some of my favorite recent examples:

- The current healthcare reform “debate” in the U.S. – many people who have insufficient health care coverage or who are a single medical event away from potential bankruptcy argue vehemently against reform of healthcare delivery and insurance. This is in direct opposition to their own self interests, and seemingly serves no-one but the insurance companies. In the expression of their opposition, they do radical things, like continually repeating bald-faced lies, and verbally assualting the President during a formal address, on live television. Yet they call themselves “conseratives”, and so does the Media. All of these actions seem to me to be blatantly stupid.

- Several years ago, I worked for a small software consultancy (not my current employer), where I “inherited” the maintainence and continuing development of a custom application for a State agency. The application had been written as a one-off “solution”, was written in MS Visual Basic, and used an Oracle database. The VB code was hard to maintain, which tended to drive up the cost of maintainence and new feature development, and after a year or so, the customer also noticed that the Oracle license was costing them a huge pile of cash each year, as was the Windows Server license. They asked if we could switch to a different database. Unfortunately, the cost of doing so was prohibitive, because much of the business logic was in Oracle stored procedures. About a year later, the consultancy signed contracts with the equivalent agencies in two other states, to provide them with software with functionality similar to that in the software for the previously mentioned agency. It wasn’t workable to modify the original software, both because it was so specific to that particular customer (again, it was a custom “solution”), and because of the same issues that made it hard to maintain. A ground-up approach was in order. Lessons learned would be applied. I led a team that wrote a framework for the general problem domain, and then customized implementations on top of that framework for both new customers. We used Java, and ran it on Tomcat on Linux. We used Hibernate, and put all of the business logic in a coherent, well-designed “business tier” of the Java application. We were able to switch databases effortlessly, and did so. The application ran on mySQL, Oracle, and SQL Server, with only a simple change to one configuration file. No vendor lock-in required. No licenses required. All “free” software. Success! Fast-forward a few years – I recently heard that the original state agency (the one with the VB app.) finally got together the funding to completely re-write their application. My former employer did it in C#, no doubt with SQL Server, on Windows Server. Cost – unknown. Vendor lock-in – complete. Stupidity – infinite.

- On my current consulting project, the customer is already heavily invested in the Seam framework, so the new application that we are writing for them is also using Seam. I’ve never worked in Seam before, so I’m just coming up to speed – reading documentation, looking at sample code, etc. I’m mostly working on JPA code, but within the Seam environment. Yesterday, I wrote code to satisfy the first few use-cases. Domain objects, services, and some database access via JPA. Ok, now it’s time to test that code. I read the Seam documentation – it shows how easy it is to test Seam components, even JSF functionality. I wrote up my first test (subclassing SeamTest, as shown), and…the test won’t run. It looks like the SeamTest has failed to set up the JPA environment, and it’s looking for an “InitialContext” so that it can get the transaction manager from JNDI. Ok, that’s not too surprising – so I go back to the documentation to find out how to set up a test that includes JPA – except that there apparently isn’t any. A trip to Google-land shows about what I expected – hundreds of individuals asking about how to solve this problem, and not one single coherent, step-by-step answer. Further reading turned up the gem from the Seam folks that they don’t believe in unit testing, only integration testing. Looks like they believe that integration testing means “slap all of your code together, from all tiers, untested, deploy it, and try out things from the user interface”. Apparently, they think that this approach makes software development faster. The point that they clearly missed is that actual contruction of software (i.e. writing code) is typically a very small percentage of the time and cost involved in the total software lifecycle. The real costs come over time, after initial deployment, when the code has to be maintained, and new functionality added. That’s when unit and integration tests are priceless. Even in that initial construction phase, on-time delivery of a quality product still demands good design, good planning, and early, frequent, comprehensive testing at all levels – and this includes both unit and integration testing. The Seam folks and their adherents think that they are saving time by not testing properly. This makes about as much sense as re-writing your application exclusively using Microsoft technologies because you have been burnt in the past by vendor lock-in. It makes about as much sense as poor people arguing against reform of the healthcare industry, or for big tax breaks for the rich.

Stupidity is indeed infinite.

MULE Classpath

August 13th, 2009

Working with the Mule open source ESB project today, I was struck by the need to deploy project-specific jar files to Mule’s lib/user directory. This is fine if your Mule installation only needs to support a single instance of Mule, or multiple instances using the same jars.

Mulesource‘s recommendation for supporting multiple instances is to run their bin/setup_local_instance script, which essentially copies the bin and conf directories to a new location, and then creates a new lib/user directory in that new location.

This certainly works, and is probably the best thing to do in a production envrionment. However, in a development environment, deploying your jar(s) to mule’s directory is an extra step. For instance, in this case, I was using Maven to build my Mule project. I like Maven quite a bit, and find it preferable to ANT, but, following it’s convention over configuration approach, it puts it’s packaged binary in your project’s target directory, and there’s no simple way to have it copied somewhere else. You can, of course, modify your POM, and do some fairly arcane stuff to get it copied, but ultimately, deployment to a server environment isn’t Maven’s thing.

Other solutions are possible, including sym-linking Maven’s target directory insto Mule’s lib/user directory, using an external deploy script, etc., etc. One thing that does not work is simply setting the classpath before invoking Mule, as the Mule startup script sets it’s own classpath.

It’s not well documented, nor recommended for production use, but it turns out that Mule supports a MULE_LIB environment variable, the contents of which get appended to Mule’s custom classpath, the same as if they were in lib/user.

Jailbreaking the iPhone 3G via Linux

July 16th, 2009

redsn0w linux

I recently succumbed to the call of the iPhone.
I’ve had it for about a week, and I like it a lot.
All except for the fact that it’s tied to Apple’s App Store.

There’s a whole world of third-party apps out there, but they’re not available in the App Store.
So, I decided to take a chance, and “Jailbreak” my phone, which involves using third-party software
to patch the iPhone’s firmware.

Information on how to do this from Windows or OS X is pretty easy to find, but instructions for doing
it on Linux are sparse.

Generally speaking, you can find the instructions for downloading and using redsn0w to jailbreak your phone here.

The missing instruction for Linux users is that you must run redsn0w using “sudo”.
If you run it as a “regular” user, it will hang when it first says, “waiting for reboot”.
I didn’t investigate very deeply, but my guess is that a non-root user doesn’t have permission to write to the usb device.

Once I ran “sudo redsn0W”, it ran as advertised, worked perfectly, and installed Cydia.
Now I’m off to play in a new universe of apps!

Google Chrome OS

July 8th, 2009

It was widely reported today that Google is working on “Chrome OS”, a Linux based operating system targeted at netbooks.

The apparent purpose is to have an OS that boots very quickly on low-end hardware, and which mainly supports running Google’s Chrome Web Browser.

To sum it up, instant-on access to Google and Google Applications like GMail, Google Docs, etc., which directly drives Google’s ad revenue.

Many of the business and tech web pundits have been offering their opinions that this project is ill conceived and doomed to failure.

They complain that it won’t allow users to run desktop programs like Photoshop, MS Office, or whatever.

Frankly, these pundits just don’t get it.
This has the potential to be huge for Google and the general computing public.

One person who does “get it” is Adrian Kingsley-Hughes at ZDNet.

Here are my thoughts, in no particular order:

  • Google will have a great jump on this, because they don’t have to actually write an OS, they just need to customize an existing Linux distro. Or will they just use the Linux kernel, and build their own lightweight distro?

  • Given how quickly the latest Ubuntu version (9.04) boots, it should be possible for Google to actually deliver on their promise of an OS that boots in just a few seconds

  • The pundits that complain about not being able to run heavy desktop apps on the new OS miss the point of netbooks entirely. The point is to get connected to the internet, and use Software as a Service (SAAS) apps, not to lug around a heavy, slow-booting piece of hardware with proprietary software. They also miss the point that Google is not positioning Chrome OS to compete with desktops OSes – it’s meant to capture the new netbook market.

  • This is likely to be successful because it’s aimed at the low end of the price scale. In these economic times, that just makes sense. Google doesn’t need to make a profit directly from Chrome OS – it can probably give it away for free (and it is rumored that it will be open sourced). The whole point here is to drive more eyeballs to Google ads. Period. Microsoft does not know how to compete in this arena. It should be interesting to watch

  • Those who complain that the Google applications will be useless when they’re not connected to the web apparently missed the whole Gears thing

Subversion 1.6.x on Ubuntu 9.04

July 1st, 2009

As with the situation in an earlier post, the version of Subversion that is in the official Ubuntu repository is not the latest that is available elsewhere. The version that you currently get by installing Subversion on Ubuntu via apt-get is version 1.5, and 1.6 is out.

Fortunately, Anders Kaseorg has provided a deb package for Subversion 1.6 for Ubuntu 9.04 “Jaunty Jackelope” at https://launchpad.net/~anders-kaseorg/+archive/subversion-1.6

There are versions there for hardy and intrepid as well.

Happy versioning!

JavaOne 2009 Photos

June 30th, 2009

Here’s some pictures of the JavaOne 2009 conference at the Moscone Center in San Fransisco, CA.