Standalone java apps vs JNDI datasources

This is another post as a memory jogger for me.

Whenever I switch back to java I have trouble remembering the evolving history of setting up mysql connections. Back in the dark ages, you used to do this with Class.forName. But by the time I started writing servlets initially, it was being done instead with DriverManager. Then along came DataSources which could be set up in JNDI. A much more elegant solurtion, as long as you have a container to offer the JNDI service. Most of the active java I have is servlets running in Tomcat, and these are happily set up to use DataSource objects, and the DataSources are all described in the context and picked off from there. Continue reading Standalone java apps vs JNDI datasources

Starting Services

There is no great insight in this post, it is only to help me remember how to start services in Fedora and Ubuntu as I have both.  I used Fedora long enough to get used to the old chkconfig stuff, but now thats gone. Ubuntu never did that anyway. They are different, and I get confused about which new syntax to use on which system.

If somebody other than me ever reads this, be careful to check dates and versions before you believe anything I write. It will probably change. This is as of Fedora 16 and Ubuntu 12.04. Continue reading Starting Services

JQuery with Zend Framework

A couple of years ago I incorporated some jquery stuff, and some jquery-ui stuff into a website I had built on Zend Framework. At that time Zend Framework didn’t have its own support for jquery (or if it did, I didn’t know about it).

Now I’m working on a new site, and I find that there is now a jquery view helper to help do jquery stuff. It is located in the “extras” library. I also didn’t know about this library. When did this get added? Anyway, stumbling around on the net I discovered that there is now some jquery support in Zend Framework. Cool. So I set about learning how to use it.

I often find the documentation in the Programmers Reference in Zend Framework to be very cryptic and difficult. Probably this is because I am a very old programmer who learned the craft while dodging dinosaurs back in the stone age. I think people freshly learning to program today have a considerably different perspective (and probably vastly better). Sometimes I just have to go read the code. I had a devil of a time getting the jquery stuff to actually work. These notes maybe will help me the next time I have to do it. Continue reading JQuery with Zend Framework

XBMC Dvdplayer on Ubuntu 12.04

Since installing Ubuntu 12.04 shortly after it was released, XBMC has been unable to play .iso files. This has been the case for me, and for my friend who has a similar setup. I’ve found a way to overcome this.

By way of background, we both have a central shared MySQL database on an Ubuntu 12.04 instance, shared with multiple other XBMC instances running on different platforms. The XBMC instance I mostly watch happens to be Mac OS/X, and that has continued to work. In his case, the “living room” instance that he watches is the same Ubuntu box which houses the database. That XBMC instance is unable to play .iso files. My Ubuntu instance is also unable to play .iso files, though since I rarely watch on that instance it was not a big issue for me. He on the other hand was having to watch movies in another room on a Windows XBMC instance in order to be able to play the .iso files. We are both set up to share the files from the central repository with NFS. Over time we’ve experimented with different protocols, but mostly NFS and SMB, and at the moment we are set up with NFS. Continue reading XBMC Dvdplayer on Ubuntu 12.04

Building The Garage

Been helping my friend Bill build his garage, up in the mountains. I’m 63 years old and out of shape, so doing physical labor for even a few hours at nearly 9000 feet, has proven to be a challenge. But it is coming along. Bill has the whole thing designed in Autocad, and really knows what he is doing. His grandson Josh and I are the hired help. We don’t know much, but we do what we are told. It is coming along.

Over the divide

Today was a little milestone for me. For the first time I took N8132Y over the divide, solo.
Of course I have been over many times, but always with somebody in the right seat. And Of course, what is the big deal anyway?
But when I learned to fly I was constantly admonished that flying in the mountains is tricky. I have known people who have died flying in the mountains. The winds can be difficult. I’ve had instruction from an accomplished mountain flyer, but still… every time I’ve gone up near the divide before there has been enough turbulence over the ridge that I’ve ended up turning back.
Today I went over. I was at 13,500ft, a comfortable margin over Rollins Pass. I flew on up to Granby, Colorado which is just over the ridge, landed, bought some expensive gas, and came back.
I’m very pleased.

Ubuntu 12.04 and luks encrypted root drive

I had trouble booting the last few kernels that came out in 11.10 (3.0.0-16 and 17), and alas the same trouble with booting 12.04 which I installed today.

My root filesystem is encrypted, and I expect during the boot process to get a prompt for the encryption password. This doesn’t happen, and instead the boot drops into busybox. I was able to just keep using 3.0.0-15 under 11.10 but now that 12.04 is installed I can’t do that anymore. Actually have to try to track this down. .

After a lot of digging around, I haven’t completely got it figured out, but I did find some hints in this tread: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/874774 which gave me a start, and at least enabled me to boot. The thread describes a mixup in matching device names from udev to names in /etc/crypttab. If a match isn’t found, you don’t get a prompt for a password, the device doesn’t get luksOpened, and the boot fails waiting for it. So, the trick is to ensure the matching logic finds a match between the udev devname and the entry in /etc/crypttab. I actually didn’t even have an entry in /etc/crypttab for the root device. Silly me. I had entries for a couple of other encrypted devices. I would love to report that all I had to do was put in an entry in /etc/crypttab and it all worked. I alas not – I haven’t yet managed to get the problem solved. But I now know where to look, and more importantly reading the thread mentioned did make clear the short term workaround, which may be clear to everyone but me: it didn’t occur to me that once I dropped into busybox, I could just do cryptsetup luksOpen /dev/sde3 sde3_crypt, type in the correct password, and then exit busybox. The boot process resumes and is successful.

Update: In the normal course of Ubuntu updates I got 3.2.24 and the problem spontaneously healied itself. Now upon boot, I get an early prompt for the root password. Bob’s your uncle.

Try out the flight planner

The new flight planner is available as of 4/25/12 on the FLYING page. I’m sure there are still plenty of bugs.

There is also a Metar Decoder and a Query Tool that retrieves airports, fixes and navaids from the FAA database.

There are plenty of tools for doing similar things. The Flight Planner is a little unique in that it is airplane sensitive, which makes it much more useful to me than other such tools, but equally makes it less useful for anyone else.