This blog has moved!

If you are not automatically redirected to the new address, please direct your browser to
http://www.juxtaservices.com/blog/
and update your bookmarks.

Wednesday, December 20, 2006

Edgy Eft + XGL + Beryl + Java App = Crap

I have been using Zend Studio for all of my PHP development, pretty much ever since I started working at Doba. As an IDE I find it sub par when compared to Eclipse, my previous IDE of choice, but its remote debugging capabilities are pretty reliable and simple to setup when compared to the PHP plugin for Eclipse (as of a year or so ago when I was playing with it). Supposedly, Zend is supposed to be merging its code with Eclipse so maybe someday we will get the best of both worlds. At any rate, I have found the debugging in Zend and its integration with the server side plugin, to be invaluable when trying to solve tough defects.

I previously had Zend Studio installed on Dapper Drake, and it was fairly easy to get it working, so I figured the same would be the case when I reinstalled Edgy Eft and got Beryl running on it. That's what I get for assuming. I was in for a few surprises.

The first issue I encountered was that the Zend binary for Linux was not finding the proper libraries (most of them libc.so.6) when trying to install in Edgy Eft. A quick search found this article on the Zend support site, which seemed to solve the problem by doing the following to the installer binary:

$ cp ZendStudio-4_2_0.bin ZendStudio-4_2_0.bin.bak

$ cat ZendStudio-4_2_0.bin.bak | \
sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > \
ZendStudio-4_2_0.bin

$ rm ZendStudio-4_2_0.bin.bak
This allowed me to execute the installer without the missing library issue, but I soon discovered another problem. Now I was getting an error in finding the JRE. I found this posting that showed how to bypass the JRE that is supposed to work with the installer and instead use the one on my system locate in /usr/bin/java. The command to run the installer is as follows:

$ ./ZendStudio-4_2_0.bin LAX_VM /usr/bin/java

Once again, I thought I was in the clear with this one in place, especially when I ran it and the installer seemed to fire up. I was beat down yet again however! Now in the Java swing window that appeared, there was a message saying that the JRE could not be found! Doh! To solve this I went through and installed the J2SE:

$ sudo apt-get install sun-java5-jre sun-java5-plugin

And also the JDK:

$ sudo apt-get install sun-java5-jdk

$ sudo update-java-alternatives -s java-1.5.0-sun

Move /usr/lib/jvm/java-1.5.0-sun to the top of the list in /etc/jvm
Finally the installer was successful when running the installer with the local JRE, and seemed to install successfully. Woohoo!

Crap! When I fired up Zend Studio everything inside the window was gray! What now!? I was able to locate this vague description of the problem, which is apparently due to the lack of support for XGL rendering in older versions of Java, but as you an see from the posting, it is unclear where to place the fix in the ZDE executable (the executable file to start Zend Studio). Well, since the posting was talking about Zend Studio 5.5, I decided I would try installing that and see if line 1695 in that version's ZDE made sense. Alas it didn't, so I decided it was time to get down and dirty, so I dug through the file until I found a good place for it.

Since the addition was to add an option that would use Sun's AWT toolkit when executing the Zend Studio app, I searched the file for the first instance of options, figuring I could add the specified line (options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"), right after the options variable was declared, thereby ensuring that it would always end up in the execution command. I found the first place where it was declared just after this comment section:

####################################################################################
# Determining VM invocation options to use
#

#
# Verification
#


On line 1236 (please don't assume this to be the line where you should stick it), I placed the following command:

options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"


Lo and behold, It finally works! After all that, I think I am going to contact Zend and charge royalties for fixing there broken crap software.

Windows Just Keeps VM-waring On Me

Next post in the Ubuntu rebuild series is here! There are times when I still haven't been able to shake the need to use some Windows only apps, but since I've cut the cord with mother MS (or crazy aunt MS, might be better suited), I'm no longer going to be wasting my time with a dual boot. Instead, thanks to the bounteous goodness of virtualization giant VMware, I now have a much more attractive option. I am going to be stepping through getting VMware Server installed and running on my system. Not really very hard to do, but might as well go through it.

Doing this will allow me to install Windows (or another other useful OS for that matter) on inside my Ubuntu install and also allow me to start and stop it at will, all for the cost of a few minutes of setup. I figure you can't beat that. Once I get the basic install setup, I will save the virtual hard drive onto my file server, and thereafter, within a couple of minutes, have a fresh and so clean, clean install of Windows. Not that I really plan to use it too much, but there are always a few Windows apps that come in handy every once in a while. Not that I am anti-Windows either, because it has its place, it's just not in my everyday life anymore!

First thing's first, I need to gather the appropriate file and registration key to continue with the install. I first went out to the VMware website and downloaded the VMware Server install for Linux (.tar.gz). Doing so requires accepting their license agreement, but for free, who cares! I also had to register and request some licenses to install a copy of it. I just signed up and requested them, and then received an email containing the key. If you want, you can even ask for multiple keys at once. This really is pretty sweet, since a while back I was thinking about purchasing a copy of VMware Server, and the cheapest I could find it was for $150!

After downloading the software and getting the registration key, I used the following steps to get it installed and running:

1. Double click the installer tar.gz file and extract it.
2. cd into the vmware-server-distrib folder that you extracted.
3. Execute the install script by typing:

$ sudo ./vmware-install.pl

This should bring up a bunch of prompts that I just went through and accepted the defaults on. At one point I had to scroll through a whole hoarde of lines of the EULA, but once again, can't really complain because its so awesomely free. Then problems again. When trying to probe for an unused subnet, the program encountered an error saying that /usr/bin/vmware-ping was not found. I killed the script and tried again, getting the same error.

The fix was in this posting, where it suggested the following command:

$ sudo
apt-get install ia32-libs


After installing ia32-libs, I reran the vmware-install.pl script and this time I almost all the way through, but there was an issue with the configuration script finding inetd, so I installed it:

$ sudo apt-get install inetd

I also had to create the inetd conf file, and added a blank line to it:

$ sudo nano /etc/inetd.conf

Finally, running /usr/bin/vmware-config.pl finished successfully:

$ cd /usr/bin
$ sudo ./vmware-config.pl


4. Firing up Applications->System Tools->VMware Server Console now starts up the app!

Monday, December 18, 2006

"Beryls" of Fun and Other Optical Ubuntu Confections


Alright boys and girls, what is your favorite kind of candy? Some like snickers some like taffy, but my favorite kind is eye candy! Delicious! The last couple days I have been hard at work rebuilding my Ubuntu system. After a poorly performing upgrade from Dapper Drake to Edgy Eft (the AMD64 version upgrades pretty crappily), and a trip to the warranty repair shop for some hardware fixes, I decided it was time to rebuild from scratch.

After such a lame experience with the Edgy upgrade, I decided to stick with Dapper, which I installed forthwith. However being one to sometimes push the envelope, I delved into the world of graphical gratification and soon rediscovered Beryl. I had seen it before, but never got around to trying it out. Basically, it is a heshin' sweet piece of desktop graphic rendering sweetness, that adds some snazzy graphical effects such as zoom, animations, etc. right into the desktop software (in the case of my Ubuntu install, Gnome). Well, once I realized what it can do, I knew I had to taste of its sweet nectar, so I set about installing it into Dapper. Soon however, I discovered that again the support for the AMD64 kernel and software was kinda basic, so I was forced to make the upgrade to Edgy. By that point however, I had discovered that my mishaps with the previous upgrade (the installation of a not-64 bit kernel, the horribly slow graphics rendering when scrolling in Firefox, broken drivers, etc.) were the result of poor support for upgrades in the AMD64 branch.

I set about to install Edgy, and to my surprise thing are working relatively well. The fresh install from the live CD worked beautifully, and so the remainder of this post will detail how I was then able to install Beryl and get some new themes setup to take advantage of the graphics capabilities of my nVidia GeForce 440 Go graphics card. So, once I had the basic install done, the following is a list of steps I took to get Beryl up and running. Most of these steps were found on http://wiki.beryl-project.org/wiki/Install/Ubuntu/Edgy/nVIDIA

1. The first step is to get the graphics drivers installed since Beryl takes advantage of OpenGL to render graphics in the GPU. Since I have an nVidia card, I needed to install the nVidia beta driver. I decided to do this by pulling down the drivers from the mirrored repository. To do this, I added the repository by putting the following in the top of /etc/apt/sources.list:

deb http://nvidia.limitless.lupine.me.uk/ubuntu edgy stable

2. Next, I added the GPG key for the location by running:

wget http://nvidia.limitless.lupine.me.uk/ubuntu/root@lupine.me.uk.gpg -O- | sudo apt-key add -

3. Updated the package list and installed the driver by running:
sudo apt-get update
sudo apt-get install linux-restricted-modules-$(uname -r) nvidia-glx
4. Next I had to make some changes to /etc/X11/xorg.conf to use the new driver ("nvidia"). I first made a backup in case there were problems:
Section "Device"
Identifier ...
Driver "nvidia"
BusID ...
EndSection

5. After modifying the xorg.conf file, I rebooted the system. When it loads, it now shows the nVidia splash.

6. To insure that the nVidia driver and graphics card are actually being used, I call the OpenGL gears program (pretty much on most X systems). If the gears turn smoothly and there are no errors, the driver is working fine. Type the following in a terminal:

glxgears

7. Next I added the beryl repository to /etc/apt/source.list with the following entry:

deb http://ubuntu.beryl-project.org/ edgy main

8. After that I added the GPG key by issuing the following:

wget http://ubuntu.beryl-project.org/root@lupine.me.uk.gpg -O- | sudo apt-key add -

9. Then I made sure my system was up to date:

sudo apt-get update
sudo apt-get dist-upgrade

10. And finally issued the command to install beryl and emerald (the theme manager):

sudo apt-get install beryl emerald emerald-themes

11. Once this was done, I made a couple more changes to /etc/X11/xorg.conf:
Added the following Option line in the "Screen" section:

Section "Screen"
[...your configuration...]
Option "AddARGBGLXVisuals" "True"
EndSection
Added this to the bottom of the file:

Section "Extensions"
Option "Composite" "Enable"
EndSection
And at the expense of more graphics RAM usage I added the following to help smooth the performance:

Section "Device"
[...your configuration...]
Option "TripleBuffer" "true"
EndSection

12. To finalize these changes I then rebooted to make sure that X and Gnome would start properly with the new xorg.conf file.

13. After a successful restart, I logged in and opened a terminal before typing the following to fire up beryl:

beryl-manager

14. At this point, I was not getting any borders on my windows, so I went into /etc/X11/xorg.conf and changed the "DefaultDepth" to "24" in the "Screen" section.

15. Once I was sure that was working properly (you'll know if its not), I added it to the startup script so that it will launch at login. This is done by going to "Preferences->Sessions" and then clicking on the "Startup Programs" tab and clicking "Add". In the dialog, I entered "beryl-manager" (without quotes) to be run at login.

15. At this point, I decided to go out and find some a new theme and login prompt to go with the my new 3D graphics. There are alot of awesome graphics and theme related configurations (including many for beryl) at www.gnome-look.org
I have to admit I am pretty stoked about the sweetness of this new install. Now all I need to find is a code monkey program to write some code for me and I'll be set. My system is a Compaq Presario R3040US with an AMD64 processor and an nVidia GeForce 440 Go graphics card, so if you have a similar setup, this should work for you as well. There is also a pretty useful wiki setup at http://wiki.beryl-project.org, that also had alot of helpful info. If you get in a bind, feel free to get in touch with me and I'll be glad to help if I can.

Stay tuned for some more info on Ubuntu configuration as I finish rebuilding my machine. There's more to come in future posts.

Tuesday, December 12, 2006

New Meaning to My "Single-Handed" Halo Skills



Ok kids, so it has been forever since I have posted. This is due to a combination of "fear factors" including but not limited to: the fear of over-caffeination (side-affect of too much Dr. Pepper to offset my lack of sleep); the fear of spousal condemnation for spending more time thinking about work than my family while at home; the fear of a DNA sucking evolutionary monster coming to cut the top of my head off with his mind before stealing forever my mutant power to spend more money than I have, while my time warping friend is powerless to stop it; and last but not least my fear of the higher education gods booting me from their presence forever after taking my future economic well-being and leaving me standing in the gutter dripping with the disappoinment of a splattering from a fresh pile of half-finished research. If you have no idea about anything that I just said, trying to explain futher will do little good, so I won't. Suffice it to say that I've found my marbles with most of those phobias so I'm back.

In the spirit of togetherness, today's post deals with the wonderful feeling of camaraderie that comes from a fellowhip of souls coming together to blast the crap out of each other's virtual alter egos in what the old fogies call "Hello Too". In this XBOX thriller, man and fanatical religious alien alike meet to take turns head bashing and high balling in attempt to win bragging rights and a few seconds of glory. Sadly however, this euphoric togetherness cannot be shared by all. There are those left out of the mix. Until now that is.

In a tribute to my good friend the "One-Armed Bandit" (I told you I'd blog about something you'd like in reward for your faithful and possibly singular following of my posts), I'd like to share with you this ergonomically brilliant hack of an XBOX 360 controller to make it...yes folks...1 handed!

Finally freedom for all! A regular doer-of-good over on one of my favorite sites hackaday.com, Ben Heck has created a 360 gamepad mod that allows the gamer to use one hand and one leg to perform the very same virtual functions that it takes most men (and women) two hands to do! Tell me that 'aint worth a Nobel Prize. At least a Newberry Award! Anyways, it is a pretty brilliant hack, assuming that the setup is really playable. I don't want to steal any of Ben's thunder, mearly suppliment it with my own "hurrah", so check out the details of the full hack over at his site. Until next time, keep the D&D dice rollin'!