WebGAC Takes the Pain Out of .Net Dependencies

My good friend Paul Jones, has released a great tool called WebGAC to github.  WebGAC is a great way to manage .net assemblies and adding them to .Net projects from a centralised repository of binaries.  As someone who has used this tool on literally dozens of projects for nearly 2 years now, Its a must have tool for all Visual Studio developers.

Managing binary dependencies in .NET can be a complicated task. For small projects, checking the dependencies into source control tends to work just fine. So does requesting that all developers have various binaries available in their GAC. Grow much bigger, or add more projects, and managing that starts to get very difficult. The Java world has had a solution to this problem for a long time, in the form of Maven and Ivy. Remote servers store the binaries, and the build tool automatically downloads them on demand.

WebGAC adds the core of this functionality to .NET, but without requiring you to switch build tools, or maintain a separate configuration file. Dependencies are specified just the same way as normal, but if you don’t have them when building your project, WebGAC will fetch them for you automatically.

WebGAC is available at http://github.com/paulj/webgac. Browse over there for more information and installation instructions, or continue reading here for more details.

Has Your Windows Mobile 6.1 QuickGPS Stopped Working?

A few months ago, I had a very sudden and strange thing happen to the QuickGPS app on my Windows Mobile HTC Touch Cruise smartphone.  My GPS signal would take forever to get a signal and when I opened QuickGPS and clicked Download now I got the error “Connection failed. Please try again later”.  Needless to say, later didn’t help. It also said:

Download time: Not yet downloaded
Valid time: Expired

It happened if I was connected over 3G, GPRS, or through USB/ActiveSync. All other data networking is fine.  But nothing worked.   After many hours of googling I found this page. Basically, for some reason one or more of the phone’s registry settings are busted and need to be fixed (at least it was in my case).  I grabbed an application that let you edit the registry on the phone and then verified these registry settings – and my problem was fixed!

[HKEY_LOCAL_MACHINE\Software\HTC\QuickGPS]
"RemindTime"="02151010034724"
"Bias"=dword:fffffed4
"ExpiredTime"=dword:00002760
"folder"="\Windows\"
"region"="US"
"INIDate"="20060531"
"remind"=dword:00000001
"actSync"=dword:00000001
"auto"=dword:00000000
"NotifyID"=dword:00001960
"INIFile"=""
"path"=""
"EEFile"="xtra.bin"
"curRegion"=dword:00000000
"curIP"=dword:00000000
"pwd"="1"
"authname"="1"

If editing the registry doesn’t sound like your kind of thing, someone in the forum of the above link has a cab file that makes the changes for you.

How To Install Phusion Passenger on a CentOS/cPanel Box

The Usual Disclaimer
Please beware that even if these instructions work, that they may break your setup.  While these worked fine for me, you should take extreme care applying them to your situation.  Follow these instructions at your own risk. They work fine for me on a CentOS 4.6 box with cPanel 11.23.4-R26138 and WHM 11.23.2.

First off, Phusion Passenger only works with Apache 2.x so if your server doesn’t have that thats the next thing you’ll have to do.  T o upgrade Apache, go to your main control panel at https://server.ip.address:2087/ and click the “Apache Update” link on the left.  If given the option, I highly recommend that you choose Apache 2.2 instead of 2.0.

Next, download Passenger. Assuming you already have Ruby and RubyGems installed on your server, simply run (as root) gem install passenger. This will pull the passenger library and code down to the server and place it with your other RubyGems.  It’s important to know that this does not install Passenger into Apache, so obviously its non-operational.  If you don’t have Ruby and RubyGems, you’re way too far down the line with reading this article and need to get up to speed with actually getting those on to your box.  Google can help with that!

At this point it’s probably useful to have the Passenger User Guide up on screen, just for reference.

Third, you need to compile and install the Passenger module within Apache. This sounds worse than it is, but before you do it, it is important to set a couple of environment variables to make it work properly.  In your SSH console type thrse two commands into it:

export APXS2=/usr/local/apache/bin/apxs
export APR_CONFIG=/usr/local/apache/bin/apr-1-config

Next, run:

passenger-install-apache2-module

It might take a few minutes, but if everything goes well you’ll eventually end up with Passenger telling you to add a few lines to your Apache configuration file (the code you get may differ slightly):

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.2/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.2
PassengerRuby /usr/local/bin/ruby

However, despite what it tells you, do not put it in the httpd.conf file – cPanel can rewrite that file and your changes can be lost breaking your passenger configuration and virtual site.  Instead, add it to /usr/local/apache/conf/includes/pre_virtualhost_global.conf – this file might not exist until you make it, but that’s okay.

Lastly restart Apache and if you didnt get any critial errors, you should be in business.  I have had issue on other servers where the Rails app failed to load because the RubyGems version was too old, so keep your eye on the error_log file if Apache starts but it still doesn’t work.  Also refer to the Passenger User Guide for further configuration and usage information.