Gerald Nunn's Blog

Intel Graphics Issues in OpenSUSE 11.3

Wednesday, August 25, 2010

I recently upgraded my laptop (Dell e6400, Intel GMA4500HD graphics) from openSUSE 11.2 to 11.3 and immediately ran into one annoying issue. With any sort of compositing effects enabled my laptop would lock up from time to time, usually about three to four times a day. As you can imagine this really killed my productivity.

After doing some research there appeared to be three potential solutions to this issue as follows:

  1. Upgrade to a new kernel.
  2. Switch to the intellegacy driver after updating X11, mesa and libdrm from the X11 repository
  3. Upgrade the Intel video driver to 2.1.0

I reviewed the options and I opted to try the third one first as it was the least invasive and easiest to back-out if I ran into an issue. Fortunately it appears that this change does indeed fix the problem as my computer as been running continuously for the last 24 hours without an issue. Detailed instructions on making this change can be found in comment #45 of this bug report.

Note that you can ignore step #5 about removing intellegacy as that is only necessary if you tried the 2nd option above first. Also, if you run the 64 bit version of openSUSE as I do note that the path the driver needs to copied to is /usr/lib64/xorg/modules/driver rather then /usr/lib/xorg/modules/driver.

Posted by Gerald Nunn at 9:34 AM | Categories: Linux | Permalink |


Installing Oracle XE in openSUSE 11.3

Thursday, August 12, 2010

Installing Oracle XE in openSUSE 11.3 is pretty straight-forward except for one gotcha which I'll cover below. If you look at the openSUSE forums you will find posts like this one that make it sound complicated but it's actually much easier then it is made out to be. Here are the steps I use:

  • Start Yast and open the software management, make sure you have libaio and glibc installed. If you are running the 64 bit version of openSUSE make sure that the 32 bit version of these libraries is also installed.
  • Download the Oracle XE 10g rpm from here http://www.oracle.com/technetwork/database/express-edition/downloads/index.html.
  • Install the rpm using the command sudo rpm -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm, note the oracle xe rpm file name may have changed so put the right one here.
  • After you install the package some of the post-install scripts will fail because openSUSE is more stringent now in package requirements. As a result we need to set the password for the oracle user manually. To do this, su to root and then type in passwd oracle and change the password to whatever you wish.
  • Once you do that, while still the root user run the command /etc/init.d/oracle-xe configure to configure the database. Follow the prompts and enter the information as necessary.
  • The database should have been started automatically once the configuration is complete, run ps -ef|grep oracle to check the Oracle processes are running. You should see the TNS listener process as well as a bunch of database processes.

That's all it takes to install Oracle XE on openSUSE, simple eh? Note that openSUSE is not an officially supported platform for Oracle XE, while I find it runs fine for development I would not recommend openSUSE for hosting a production Oracle database.

Posted by Gerald Nunn at 3:40 PM | Categories: Linux | Permalink |


Switching to Linux

Wednesday, August 11, 2010

I switched to Linux from Windows on my laptop about eight months ago and I thought it might me interesting to write a blog post about my experiences. As an Enterprise Java and Android architect and developer, most of the work I do can be done equally well on Linux as on Windows. Many of the applications I work on end up in a Linux or Unix type environment but I don't typically have much to do with the Linux servers on a day to day basis since they are managed by operational staff. While I was comfortable with a Unix command line I really wanted to increase my general Linux skills and using it on a daily basis provided an excellent opportunity to do so.

The first, and best, decision I made was to overwrite Windows when installing Linux and jump in all the way. My reasoning is that with a dual boot system I would be too tempted to go back to the familiar than pushing forward and learning something new. So after backing up all my documents to a portable hard drive I went ahead and installed openSUSE 11.2 on my Dell e6400. I have to say the install experience was significantly better then the last time I played with Linux a few years ago and the process went quite smoothly. The only exception was I had to install a proprietary Broadcom wireless driver manually but other than that it was all good.

After using it now for eight months I have to say that I have been really happy to make the switch. In general I find my development tools run much faster then they did under Windows. Java development tools such as Eclipse, BEA Workshop and JDeveloper tend to be quite heavyweight but feel much more performant under Linux then they do under Windows. I imagine most of this is likely due to the fact that Linux tends to be a lighter weight operating system and you generally run less cruft, not having to run an anti-virus scanner for example probably helps quite a bit.

One big thing I like about Linux is the fast boot time and that once the system is booted it is fully ready for use. Under Windows the boot time was longer plus once it booted to the desktop the system still wasn't really useable until all of the background boot processes finished, starting a program right after boot often entailed a painful wait.

I have not been able to completely ween myself off of Windows though and have Windows XP available in a VirtualBox Virtual Machine (VM) for the times when I need it. VirtualBox is a great application that is free, since it can suspend a guest OS starting and stopping the WinXP VM only takes a few seconds. The performance of XP in the VM is very good with the only noticeable slowdown having to do with disk access. I primarily use XP for the following programs:

  • Microsoft Office. While OpenOffice is a great program it doesn't have 100% fidelity when modifying documents in the MS Office format. Since I work in a client facing position I can't afford to have problems in documents I pass around. I tend to use OpenOffice for reading documents but if something needs editing I'll use MS Office.
  • Microsoft Visio. I use Visio all the time for diagramming various things such as network topologies, class diagrams, sequence diagrams, etc and I've have not found a good equivalent in Linux. There is a program called Dia but the user interface is just awful and it won't read and modify Visio files.
  • Netmeeting. Many clients will use Netmeeting for ad-hoc screen sharing and I'll need to connect to a host machine to view their screen. For hosting meetings I put together a Netmeeting equivalent using VNC and Flashlight VNC Viewer which I blogged about previously.
  • Internet Explorer. Sometimes I need to deal with corporate or client web applications that only work with IE. Fortunately these instances are quite rare and I expect the need for IE to diminish even more over time.

Having to use Windows in a VM highlights one of the weaknesses of Linux in a corporate environment, for better or worse the world around you is Windows based and you have to be able to inter-operate in that environment. Having said that, the Linux applications are getting better at this and knowing the complexity of the Office file formats I was really impressed with how well OpenOffice handled them. I'm optimistic that things will continue to get better with the noteable exception of Visio, there doesn't seem to be anything happening on that front in the Linux community.

As an aside I am fortunate that in my workplace there is support for Linux and we do not use Outlook or Exchange which could add another wrinkle to using an alternative operating system.

So in summary I have been very happy with switching to Linux and would have a hard time switching back to Windows. I feel I am much more productive in a Linux environment and generally prefer the way things work in Linux versus Windows. Overall for Java developers I would strongly recommend considering Linux.

Posted by Gerald Nunn at 12:21 PM | Categories: Java, Linux | Permalink |


OnTrack 2.5.6 Released

Thursday, July 29, 2010

I have uploaded OnTrack 2.5.6 to the market, this is primarily a bug fix release with the following issues corrected:

  • The dashboard has been adjusted to fit properly on small screens like the HTC Tattoo
  • Fixed a problem where the backup file could be truncated in rare cases.
  • Added an option to e-mail the backup file.
  • Fixed problem with re-ordering categories and subtypes on larger screens where list entries would shrink when drag was completed.
  • Increased the font size under the buttons on the dashboard on medium and large screens
  • Fixed problem where dashboard wallpaper looked squeezed when viewed in landscape
  • If you changed the date/time when adding an entry and then changed the phone orientation the date and time changed to now. This has been fixed.
  • The calculation used for the auto-selection of a category based on time was off resulting in the wrong category being picked in some circumstances, this has been fixed.

Posted by Gerald Nunn at 8:42 AM | Categories: Android | Permalink |


OnTrack and HTC Sense UI Startup Problems

Sunday, July 11, 2010

As most of you know the lastest version of OnTrack introduced a new start screen for OnTrack, unfortunately it appears that there is a bug in the HTC customized home screen Sense UI that is causing OnTrack not to start correctly. The issue is I changed the class name of the launch activity and once you update the application the HTC home screen has issues because it tries to use the class name it previously cached.

Unfortunately this is not something I can fix as it is a problem in HTC's code, stock Android phones have no issue with the change. Changing the launch activity back to the old one will just cause the same issue for everyone that has already worked around this problem or new users who installed it for the first time.

Fortunately there are a few ways you can try to correct the issue and I have had reports that at least one of these will work:

  • Upgrade to 2.5.4. I have attempted to fix the issue by creating a new activity with the old class name that forwards to the right OnTrack home screen. Try upgrading to this version to see if it corrects the issue.
  • Replace icon on home screen. The easiest thing to try first is to replace the icon on the home screen. To do this, hold you finger down on the OnTrack icon on the home screen and drag it to the trash. Then open the sliding drawer and replace the icon on the home screen again If this doesn't work move on to the next item.
  • Reboot phone. In this workaround first remove the OnTrack icon from the home screen, turn your phone off and on (reboot) to clear the HTC internal cache and then add the icon back to the home screen.

  • Re-install OnTrack. In this step we uninstall and re-install OnTrack from the Android market. To do this in a way you don't lose data please follow the steps below.

Here are the steps for re-installing OnTrack without losing any data:

  1. Open the OnTrack application from the Market application and select the Tools icon on the new home screen. Select the Backup tool and press the Backup button. You should see a progress bar go from left to right backing up your data.
  2. Validate your data is present by connecting the phone to a computer and checking that the file backup.xml is in the OnTrack folder on your SD Card. Copy the file backup.xml to your computer to make an additional backup.
  3. Disconnect your phone from the computer, very important otherwise restore step will not work.
  4. Uninstall the OnTrack application from your phone.
  5. Re-install the OnTrack application to your phone from the Market.
  6. Go into the Tools menu again and select the Restore option, this will restore your data from the backup.xml file.

If none of these work please send me an e-mail at Gerald Nunn and I will try to assist you further.

Posted by Gerald Nunn at 8:26 AM | Categories: Android | Permalink |


OnTrack Updated to 2.5.3 in Market

Friday, July 09, 2010

Just a quick note to say I updated OnTrack to 2.5.3 in the Android market. Apparently the Android home screen caches the application activity to start when the application is launched. This means the new screen was bypassed along with some important initialization causing an error. I've moved the initialization to an Application object, which I should have done in the first place, and hopefully that will correct the problem. Another way to workaround it is to simply remove the OnTrack icon from your home screen and then add it back.

Finally there was a small issue where the backup progress bar wasn't working correctly, that has been fixed as well.

Posted by Gerald Nunn at 8:38 AM | Categories: Android | Permalink |


Linux alternative to NetMeeting

Thursday, July 08, 2010

I switched to Linux full time from Windows about eight months ago and haven't looked back, for the work I do and the software I use Linux has worked great. My Java based development tools are more responsive under Linux and generally everything feels snappier. I have found approriate alternatives to most of the software I used in Windows with a few notable exceptions. One exception for example is MS Office and Visio however an easy way to workaround that is to use Windows in VirtualBox to run MS Office and Visio. VitualBox starts so fast from a saved state that it doesn't bother me at all.

One piece of software I have been struggling to find an equivalent to is NetMeeting though. As a technical consultant I pretty much spend all my time at client sites working with their staff and 99.99% of the time the staff are running Windows. Fair enough, I have no issue with Windows however invariably the client will need to do some add-hoc desktop sharing over the network and usually the tool of choice for them is Netmeeting. When the client is hosting the meeting, for example when they want me to watch them perform an install of something, I usually just run Netmeeting in the VirtualBox Windows VM and it works great. The more problematic scenario is when they need me to host a meeting and share my desktop with multiple people.

It's not that Linux isn't capable of doing this, VNC can fill this need in a pinch but the issue I initially had is very few people in the Windows world have VNC clients installed on their machine or worse even know what VNC is. I needed a way to share my desktop with multiple people on the same LAN in way that works regardless of the platform the other folks have. One solution is to use a web conferencing product like Yugma or Webex which support sharing a Linux desktop. These are not slam dunks though, the problem with Webex is that it costs money and the company I work for won't cover it. Yugma on the other hand has a free account however it didn't work for me through the client's proxy. Finally the last issue is sometimes I deal with sensitive information and I'd prefer not to route the connection over the Internet, Netmeeting keeps everything on the client's corporate network.

I spent quite a bit of time thinking about this and cobbled together a solution based on a few open source projects that in my initial testing seems like it will fill the bill very well. The first part of the solution is the tried and true VNC, specifically the x11vnc project which allows you to share your current desktop easily to multiple people over a LAN. However as mentioned previously, my concern was that most people in the Windows world don't have a VNC client but after some additional research it turns out that there are a couple of ways to skin that cat and make things work.

First, after reading up on x11vnc and vncserver, I found that both products also start a simple http server in addition to the VNC server. This http server is used to serve a Java based VNC viewer, in the form of an applet, to a browser. This allows any browser with a Java plugin to access your desktop without having a VNC viewer installed previously. This is quite helpful however in testing some machines at my client I found that many of them didn't have Java enabled, therefore I needed something more ubiquitous.

For rich applications in the world of the web it doesn't get more universal then Flash and sure enough some kind hearted individual has a Flash based VNC viewer called Flashlight-VNC. If we combine Flashlight-VNC with x11vnc we get the winning combination, a netmeeting like experience served from the browser that should work for almost any client. All you need to do is send a URL to your machine to the people who wish to connect and they simply open it in a browser to view your desktop.

Here are the steps needed to get this working.

Download and install x11vnc

The first step is to download and install x11vnc on your machine. All Linux distributions should have this available in their repository so try downloading it from there first. We are using x11vnc over vncserver because vncserver does not allow you to easily share your current desktop, rather it exposes a different display to remote users.

Download Flashlight-VNC

Next download the Flashlight-VNC package from their website and extract all the files to a folder. At the time of this running 2.0.3 of Flashlight-VNC was available, I would recommend downloading the latest swf from here http://flashlight-vnc.sourceforge.net/swf/Flashlight.swf to avoid the issue described here.

Create Scripts

The next step is to create some scripts to start and stop the x11vnc server and the Flashlight-VNC policy server. I created my scripts in /home/gnunn/bin/x11vnc where /home/gnunn is my home directory, make sure to update the HOME_DIR variable in the script below to reflect your script's location. Here is the start.sh script:

#!/bin/bash

HOME_DIR="/home/gnunn/bin/x11vnc"

rm -rf ${HOME_DIR}/logs/*.out

IP="$(/sbin/ifconfig eth0 | sed -n '/inet /{s/.*addr://;s/ .*//;p}')"
HOST=$(hostname)

nohup x11vnc -forever -shared -viewonly -httpdir ${HOME_DIR}/classes -gui tray -desktop "Linux Main Desktop" -solid "#FFFFFF" -display :0 >${HOME_DIR}/logs/x11vnc.out &
nohup java -jar policyserver.jar >${HOME_DIR}/logs/policyserver.out &

echo "VNC is running on port 5900"
echo "PolicyServer is running on port 1234"
echo "Users can access client at http://${HOST}:5800 or http://${IP}:5800"
echo "Make sure your local firewall is stopped or has these ports open"

The key parameters that we pass to x11vnc are:

  • viewonly. This parameter prevents users from interacting with your desktop.
  • shared. This allows multiple clients to connect to the same desktop simultaneously.
  • forever. Keeps x11vnc running forwever instead of shutting down when the first client disconnects.

Here is the corresponding stop script:

#!/bin/bash

x11vnc -remote stop

Add Web Server Files

In this step we create the files that are going to be served by the x11vnc http server, these are the files that the user's browser will download when they connect to your machine. There are two files, index.vnc which is the default html page served by x11vnc and Flashlight.swf which is the Flash code for the VNC viewer. In the directory where you saved the scripts create two sub-directories, one called classes and one called logs.

In the classes directory, create a file called index.vnc with the following contents:

<html>
	<title>
	$USER's $DESKTOP desktop ($DISPLAY)
	</title>
	<body>
<script type="text/javascript">
document.writeln("<object id='Flashlight' width='100%' height='100%' type='application/x-shockwave-flash' data='Flashlight.swf'>");
document.writeln("<param name='movie' value='Flashlight.swf'/>");
document.writeln("<param name='allowScriptAccess' value='always'/>");
document.writeln("<param name='wmode' value='opaque'/>");
document.writeln("<param name='FlashVars' value='host=" + window.location.hostname + "&port=$PORT&viewOnly=true&shared=true&autoConnect=true'>");
document.writeln("</object>");
</script>			
	</body>
</html>

Next copy the Flashlight.swf file from the Flashlight-VNC download into the classes directory.

Copy policyserver.jar

In this step we need to copy the policyserver.jar file from the Flashlight download to the directory where we created the start.sh and stop.sh scripts. This policy server is required by Flash in order that it can retrieve a security policy that allows Flashlight-VNC to make a VNC connection to your machine.

Start the Server

We are now ready to start the server, open a terminal windows and run start.sh. If everything worked correctly you should see the x11vnc tray icon appear in your system tray and a small floating window sating that the Policy server is now running on port 1234.

To test the connection, open a browser on a different machine and connect to the URL given by the script. If the host name doesn't work try the IP instead. If it is still not working make sure firewalls are turned off on both machines

Conclusion

There is a lot of room for improvement in this setup but hopefully that is enough to get you started and thinking about the possibilities. Some areas for improvement, should you be so inclined include:

  • Give the user a choice of Flash or Java connection options by modifying index.vnc
  • Eliminate the policy server by having the x11vnc http server return the policy
  • Alternatively, improve the policy server so it doesn't display a window on the desktop and supports being stopped remotely like x11vnc.

Posted by Gerald Nunn at 10:26 PM | Categories: Linux | Permalink |


OnTrack 2.5.1 release in the market

OnTrack 2.5.1 has been released to the market, the new features are listed in my previous post. Unfortunately the new log book didn't quite make it into this release, I hope to have it ready and available later next week.

Posted by Gerald Nunn at 8:04 PM | Categories: Android | Permalink |


OnTrack 2.5.0 coming soon

Sunday, July 04, 2010

Work on OnTrack 2.5.0 is progressing and it should be released in the next week or two. In this release the major emphasis was on improving useability, particularly for new users, The following changes were made in this version:

  • A dashboard screen as the new OnTrack home screen has been added, however an option to use the old home screen as the default is available.
  • In line with the new dashboard screen, the navigation to features which were buried in menus or settings has been improved.
  • Added a new scatter graph that shows Glucose by Time of Day, allows user to better discern when low and high scores typically occur.
  • The backup feature now backs up OnTrack settings in addition to data.
  • Added disclosure indicator to menu like screens to better indicate to click to move to next option.
  • Added 'Delete' option to pop-up menu when viewing an individual entry, category or subtype.
  • Force blood pressure to use 'Phone' keyboard type.
  • Made 'Phone' the default keyboard for new users.
  • Fixed problems with entering HbA1C.
  • Added support for Body Fat type.
  • Allow two decimals in medication entry.

I'm also hoping to have a new logbook feature in this version as well, this will create an HTML document that mimics the format of a logbook.

Finally I have received a few requests from people with regards to how to donate to the development of OnTrack, as a result I added donations link to the OnTrack pages.

Posted by Gerald Nunn at 9:00 PM | Categories: Android | Permalink |


OnTrack 2.1.0 Released

Sunday, April 04, 2010

The next version of OnTrack, 2.1.0, has been released to the Android Market. The following changes were made:

  • Added support for pulse and HbA1c types.
  • Added ability to switch graph colors to black on white for better printing.
  • Added ability to specify keyboard preference type for numeric keyboard. This keyboard allows the user to switch between phone and numeric and was required because some handsets had issues with the phone style keyboard being used for entering numbers.
  • Fixed bug where HTML export should specify UTF-8 character set and it did not.
  • Fixed various bugs that were sent by remote stack trace reporter.
  • Made graphs more resilient to orientation changes.

Posted by Gerald Nunn at 7:51 PM | Categories: Android | Permalink |