Archive for August, 2006

JetBrains Resharper is a fat slow pig

Almost two years ago, I found a utility called Resharper.  There were a lot of people talking about all of the cool things it did, including refactoring.  At the time, I didn't know what refactoring.  It basically comes down to rewriting your code so that it does the same thing, but in a simpler fashion.  Resharper also claims to simplify a lot of the repetitive tasks in Visual Studio.

I downloaded it, installed it, and loved it.  There were definitely some features that I love, including "Encapsulate Field", which will take a private field and put a public wrapper around it for encapsulation.  You can also easily rename variables, methods, classes, etc., and it will almost instantly update all references and calls so that they keep on working.  It will also automatically add "using" statements if you're missing one for a type that you're trying to use.  That one sure is slick.

What I didn't know was that all of this functionality would come at a horrible price.  I quickly realized that the performance of Visual Studio was significantly worse than usual.  I ended up uninstalling it, and things sped back up.

I kept coding like I always did, but no I had to go through withdrawls.  It was tough losing all of those cool features.

Recently I gave Resharper another shot.  I installed their 2.0 version for Visual Studio 2003 and 2005 (they are separate installs).  Again, for a while, the penalty almost seemed worth it.  Then I installed SP1 for Visual Studio 2003, which had a lot of fixes, but now it seems to have broken some of the bizarre hacks that Resharper would use to do its thing.

A new version of Resharper was recently released, and it was probably at least partially in response to the new service pack.  Looking at the list of fixes, I'm not even sure what to make of it.  They apparently had a LOT of bugs.  Of course I was already aware of many, due to their bug reporting tool that would constantly pop up.

I installed the latest version HOPING that I could finally have my cake an eat it too.  It turned out being a little faster, but still very pathetic.  Not only that, but the thing takes FOREVER to install and uninstall.  I'm not sure what these guys are doing.  I was also having problems because the intellisense in Resharper and the built in intellisense appear to be fighting, and the only victim is me.

So if you want my advice, avoid using Visual Studio 2003 if you can, because you can't really win that game.  If you can use Visual Studio 2005, do so, because at least you get some refactoring, but it is slow.  2005 is great in the fact that it loads insanely fast, it's tough to live without that.

So now I'm waiting for Resharper to uninstall, and it's been going for almost 30 minutes so far, and it looks like it's 2/3 done.  How can it possibly take that long?  What could it possibly be doing?

Ok, while I'm at it, one more thing.  Why the @#$^ did they put unit test stuff into Resharper?  That is completely stupid, especially since the code coverage add-on is separate.  I don't want the unit tests integrated.  I want separate pieces so that I can pick and choose what I want.  I would rather use Test Driven.NET because of all of its features.

The Resharper guys need to do SOMETHING.  This is rediculous.  Maybe they can release a lite version, so that I can at least get a couple of critical features.  Please?

Another Dead Router - Netgear Support Sucks

Over a year ago, I started having problems with my Netgear wireless router. Everything worked great except that it would block incoming port 80 traffic at random times. I love Netgear, because their UI's are great, and their wireless signal strength is unbelievable. At the time, I wanted to get a router that I could rely on, so I opted for a business class router from Netgear, the FVS114. I still use the wireless router as an access point, and it still works great.

The new router worked great for months, until it started blocking outgoing SMTP traffic to certain servers. It sounds extremely unlikely, but that's the conclusion I made. From any other location, I was able to access the servers just fine. If I would bypass the router on my own cable modem, it would work just fine. To make things worse, it was intermittent.

Netgear tech support was a nightmare. I first opened an online help case, and they didn't know what was wrong. They told me to call and 800 number, and they would be able to help me. What ensued afterwards was horrific nightmare that I wish I could forget.

Of course I had to first talk to a guy in India that barely spoke English. I later found out that he put the name "Sara" on my case instead of "Jason". Yes, it was that bad. I explained the problem to him, and I was able to answer his questions before he could even finish them. It was apparent that he actually knew nothing about routers, but had some common technical problems listed on his computer.

He asked me if I had the outgoing SMTP port open, and I told him that I had ALL outgoing ports open, which is the default. He then told me to set up INCOMING SMTP ports. I asked him why that would matter, since this is outgoing traffic. He didn't have an explanation, but I did it anyway. Surprise, that didn't work!

He then asked me to do a factory reset, which I had already told him multiple times that I had already done. At this point I was starting to get agitated. He asked if the outgoing SMTP ports where open. I told him "I did a factory reset, you should know that ALL outgoing ports are opened by default on this router". It didn't even phase him. He proceeded to ask again. This was clearly someone that didn't understand what he was doing.

Eventually, he wanted to remotely access the router. I told him that it was all set up for that, and I could give him the address to connect. He then proceeded to tell my how to set it up. After interrupting him 3 times, he finally got the point that I had it set up. Then I had to tell him the URL. He should know that the external access requires "https", but we obviously can't make any assumptions. It took a couple of minutes just to tell him the address.

He then told me to open up the outgoing SMTP ports. Yes, I am not kidding. I explained once again that they were already open. I also explained that HE had control of the router, not me, so I didn't know what he wanted me to do.

I eventually told him that I wanted an RMA, or our conversation was done. I repeated it over and over and he said he would escalate my case to level 2 support. I then went on the website and told them that their level 1 support was useless. I got a reply saying that they would escalate that case as well. The next day I got an email from a tech support guy saying that they would RMA the router.

I waited a few days, and then I got a call from Netgear. It was level 1 support, and they wanted to help me figure out the problem. I told them that we had diagnosed the issue, and was told it would be RMA'd. He transferred me to level 2 support. Level 2 support asked what the problem was, and I explained the whole situation again. I had to raise my voice for them to finally say that they would RMA it.

Do these guys get fired if they RMA one of these? This was absurdly ridiculous. My time was worth more than the cost of the router. I should have bought a new one right away, and just thrown the old one away.

I ended up sending in the router, and amazingly, 4 days later, they sent me a brand new one. The interesting thing is, I just sent back the router, and they sent back an entire new retail package. I'll probably be putting it on eBay.

I'm actually using a virtual router now, and it's working pretty good. I'll be talking about that in a future post.

Lots of Photo Updates - Tagging, sorting, and more!

I've been busy processing the backlog of photos that I've been taking.  I've made a personal commitment to upload at least 1 new album every day until the backlog is gone.

I've finally worked out a good system for getting them uploaded.  I put all the photos from a particular occasion into a folder.  I then pick out the best ones, and move those into a different folder, which is basically a folder with all the photos I want to share.  I then use a program to go through all of the good ones and add tags.  I also try to add titles if they are appropriate.

I then upload both folders to my Fotki account.  The private photos are contained in a private folder that the general public doesn't have access to.  The only reason they get uploaded is so that I have an offsite backup.

Here is a list of the latest photo albums.  There is also an RSS feed available on that page if you want to subscribe for updates.

 

Here is a photo of Ryan in his new playhouse.  Click on the photo for more photos like this.

Ryan in his new Playhouse!

COM Interop from ASP Automatically Using Latest .NET Version

If you have an application that calls a .NET DLL registered for COM interop using "RegAsm", that DLL will get executed using the NEWEST version of .NET on your computer. That's the information I got straight from the guys at Microsoft.

At work we have an ASP application that uses a .NET DLL registered for COM interop to talk to webservices in an ASP.NET application.  Everything was working fine until our customers started installing .NET 2.0. Or in some cases, they would install SQL Server 2005 which would install .NET 2.0. Our ASP application started to break, because the DLL was not designed to work on .NET 2.0. How would it have been?  It wasn't written when 2.0 was available.

Figuring out the problem ended up being the easy part (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconruntimeinitializationfromcomapplication.asp). The hard part was forcing it to use .NET 1.1.  Microsoft has no information about it, and Google searches proved to be futile. I ended up using one of my MSDN support incidents. They basically allow me to get straight to an expert on the subject, and Microsoft holds my hand until we get it figured out.

Once I got a hold of someone who knew what I was talking about, he told me that you COULD NOT tell it what version of .NET to use, because it was ultimately running under IIS. He did offer some workarounds:

  1. Live with it.  This was obviously unacceptable because it wasn't technically a solution.
  2. Write some kind of bizarre non-managed wrapper that could make a .NET 1.1 call and then use our DLL. He didn't really understand this one, but he had heard it from someone else.  I really don't even know how I would have done that, or what it even means really.
  3. Write a dummy ASPX page in the ASP directory that would get called on startup by the ASP application. In addition, the virtual directory for the ASP page would need to be set to use .NET 1.1. That basically forces the application to start .NET for the virtual directory, and any future .NET calls will use .NET 1.1. This was the method that we ended up choosing.

Once we added some logic to the startup of the ASP application to call the blank ASPX page, any future calls to COM registered .NET DLL's would be made with the .NET version of our choosing. It's strange, but it works.

Installing VMware Tools in Ubuntu Linux - Use VMware server 1.0!

UPDATE!

Most of this post is now pointless, because the latest version of VMware Workstation NOW supports Ubuntu 6.06. It has a copy of the compiled tools, so you can now skip getting all of the Linux source and headers. That used to be the case only with VMware Server 1.0.

The latest version of VMware workstation 5.5 (as of this writing build 19175), does NOT support the VMware tools out of the box for Ubuntu 6.06. Basically, that just means that they are not easy to install, because you would need to have all the files necessary to recompile them for that specific version.  I found that out the hard way. VMware publishes the compatibility guide at this location: http://www.vmware.com/support/pubs/ws_pubs.html.  For 5.5, it specifically says that only VMware server 1.0 supports Ubuntu 6.06.  Of course I wish I had known that before I did all the work to recompile the tools for Workstation 5.5.  Here is the rough version of the commands that I used:

sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install linux-source-2.6.15
sudo apt-get install linux-headers-2.6.15-23-server
cd /usr/src
sudo bzip2 -d linux-source-2.6.15.tar.bz2
sudo tar xvf linux-source-2.6.15.tar
sudo ln -s linux-source-2.6.15 linux
sudo mv /usr/src/linux-source-2.6.15/include /usr/src/linux-source-2.6.15/include.orig
sudo ln -s /usr/src/linux-headers-2.6.15-23-server/include /usr/src/linux-source-2.6.15/include
sudo mount /dev/hdc
** change to home folder
tar zxvf /media/cdrom/VMwareTools-1.0.0-28343.tar.gz
cd VMwareTools-1.0.0-28343

** Run the VMware tools install script here

sudo apt-get remove build-essential
sudo apt-get remove linux-source-2.6.15
sudo apt-get remove linux-headers-2.6.15-23-server
sudo rm -f -r /usr/src/*

sudo reboot

HOWEVER, the much much much easier way they can be installed is by using VMware Server 1.0.  Since it’s newer than 5.5, it has a precompiled version of the tools for that operating system.  VMware Server 1.0 will read 5.5 images, so temporary load the virtual machine with the server, install the tools, and then use it on workstation 5.5.

So you might be asking yourself “Is this really worth it? Why would I do this?”.  That’s understandable. If you’re using the Ubuntu desktop version, you get the cool ability to move the cursor seamlessly between the host and the guest, and vice versa. You also get drag and drop capabilities, and the full client toolbox of nifty things you can use such as “shrink”.

On both the desktop and server versions, you get the advantage of increased network performance, due to the native VMware network card driver.  You also get rid of the nag message in the host window when running the machine.  As last of all, you get heartbeat functionality, so that VMware server can tell if a virtual machine is still alive.

Upgraded to Community Server 2.1

I've upgraded my blog to Community Server 2.1, from 2.0.  It was just recently released.  The entire upgrade was a breeze.  There aren't many major changes that I can take advantage of, but I like to stay at the latest version for upgrade purposes.  They finally support tags, so it is now easier to find posts with a particular subject.  They also support .NET 2.0 directly, which I prefer for managability.

 One thing I've really wanted was a section of related posts for each posting.  I'm going to see if I can get that set up in this version.
 

Polling Remote POP3 Servers for Mail and pushing into Linux IMAP Server

I’ve always struggled with getting my email set up the way I want.  Of course I can’t be happy with the “normal” way of getting email through the web, or through a simple local setup.

Here are my “unusual” email requirements:

  • Very fast when accessed from local network.  I need to be able to click through the messages very quickly.
  • Easily accessed from many machines on local network.
  • Available online, through IMAP or web interface.
  • Easy to backup all messages on the server.
  • No space limits so that I have access to all 10,000+ emails that I currently have.
  • Expandable so that future users can easily be set up.

Using one of the popular email services like Yahoo Mail or GMail are out of the question just due to speed, and even the amount of email I have.

At one point, I tried using Exchange.  It worked good, but I didn’t want to be owned by Microsoft.  It’s just way too much money for the simple scenario I’m using.

Now that I’m starting to really use Ubuntu server, I’ve found another way.  One of my favorite things about Linux is the fact that they give you a lot of gizmos, and you can organize them in whatever way you want, to do whatever you want.  They give you tools for checking mail, and they give you tools for serving mail.  It would seem to be a simple matter of hooking the two up.

To tackle the first part of the problem, I started looking into different IMAP servers that would run under Linux.  I also wanted to make sure that it would store it’s mail in a standard format.  There are two very popular standards for storing mail on a Linux machine.  “mbox” and “Maildir“.  From what I can tell, “Maildir” is usually the preferred choice.

I found a program called Dovecot, which seems to be very popular, easy to configure, and will serve up your email about anyway you can think of.  After looking over the documentation, it took about 30 minutes to set up with their simple configuration examples.  I was then up and running with a full IMAP system capable of serving “Maildir” mail.  I’m not including my configuration file here, due to the length.  I recommend simply looking at one of the configuration examples on their website.  The only thing that was a little tricky, was the fact that I had to create a folder called “Maildir” under my home account, which would signal Dovecot that I wanted to use that mailbox format.  If you don’t, it will assume mbox.  I’m not sure if there is a configuration option for that.

The next piece of the puzzle was getting my email into the system, by having it poll my pop servers.  There is a popular piece of software known as “getmail“, which is built exactly for this purpose.  It will check your POP3 or IMAP mailbox, and deliver it to your “Maildir” mailbox.  It took about 10 minutes getting the configuration file set up for it, and I was able to call a command line to check my email.  I had to set up a configuration file for each account.  Here is what one of my configuration files look like, except that I masked the username and password for obvious reasons:

[retriever]
type = SimplePOP3Retriever
server = mail.SuperJason.com
username = xxxxxx
password = xxxxxx

[destination]
type = Maildir
path = ~/Maildir/

[options]
delete = true

Next, to automate the whole thing, I set up a cron job using crontab.  The easiest way to set up your cron job is to use “crontab -e”, which allows you to edit the cron jobs file.  Once you save it, it will attempt to reload all of the jobs.

My cron job looks like this:

#Call getmail every minute to fetch my pop3 mail and put it into my Maildir
* * * * * /usr/bin/getmail –rcfile=mailacct1rc –rcfile=mailacct2rc –rcfile=mailacct3rc

That’s all there is to it.  Now my system automatically polls my pop servers every minute, and pushes the email into my Maildir, which is accessible from anywhere via IMAP.  This machine is its own virtual appliance made in VMware, so it runs independently off all my other computers.  It just sits there quietly doing its job, and really doesn’t require any maintenance.  It’s great having a powerful yet free email system that meets all of my requirements.

Setting up a virtualized server environment for my home LAN

As I mentioned before, I’m starting to really like Ubuntu Server.  Today I want to talk about my vision for how I’m going to modularize my network server, so that it’s faster, more reliable, and easier to manage.

First, some background information.  I have an eMachines computer that I got a couple of years ago for under $200 at Best Buy during black Friday.  It’s not a top end machine, but it’s not like it has to do that much.  It’s a 2.6GHz celeron.  I’ve upgraded the storage to nearly 500 megabytes of RAID 5 IDE storage.  It helps me sleep better at night knowing that there is some redundancy in my file storage.  I’ve also recently upgraded from 512MB RAM to 1280MB.  It never did run that great with 512, and 1280 will help me run concurrent virtual machines more efficiently.

My server is currently acting as the following:

  • File server - Just stores stuff.
  • SSO server (NT central authentication) - Lets me have the same username and password for each machine.
  • Fogbugz Server - Holds all of my bug reports for my personal web sites, software, and configurations.  This needs to be accessible over the Internet.
  • SQL Server 2005 - Serves the database for Fogbugz.
  • Subversion Server - Holds all of my personal source code, and needs to be accessible for some remote users.
  • WebSVN server (usually broken) - Gives a nice web interface to Subversion for browsing changes and downloading files.  It also hooks into Fogbugz for change management purposes.
  • DNS server - It’s annoying when you want to access another computer, but it can’t resolve the name.
  • Email server - I like to be able to have my email shared between all of my machines, and accessible remotely.
  • Misc - Some other services that I wrote are also running.

It’s great having a server running all the time, so that I can count on it serving up what I need, when and where I need it.  It’s extremely reliable because it just sits in a closet, doing its job.  So now you’re probably wondering why I would want to go virtual:

  • I want to be able to work on machines independently.  Right now, if I reboot the server, everything goes down, and I have to wait for everything to shut down and start up.  Virtualizing  the services will reduce my impact on the whole system.
  • I want to be able to move machines as needed, so that if I end up needing a lot more server power, it’s simply a matter of moving the machines to a server that has more available power.
  • I want to be able to run mixed operating systems.  I want software that is designed for Linux to be able to run on Linux.  I want all the advantages the OS has to offer.  For example, WebSVN is a huge pain to install on a Windows machine, and isn’t well supported.  However, it’s a piece of cake on a Linux machine.  There are also enterprise level applications that will run only on Linux, that are free.  I want to be able to take advantage of those as well.
  • Very high cool factor.
  • I can slowly phase out Windows software in favor of open source software so that I can save some money.  Of course I’m keeping my maintenance time in mind as well.
  • If my server dies, I can move the machines on to any type of hardware, and be up and running very quickly.
  • If I want to upgrade my server, it’s as easy as copying some files.

Here is the network topology I’m trying to set up:

Network Topology

I’m trying to set this up in steps.  I installed VMWare server on my server, on top of Windows.  I’m trying to get all of my virtual machines created and running.  Once that is done, I can run the machines temporarily on my desktop computer.  I can then get Linux installed on the server, and install VMware server.  Once it’s all set up, I just just copy over the virtual machines, and I’m done!

I still haven’t finalized this design.  I’m trying to avoid running Windows 2003 Server, so I might switch that to Windows XP, or maybe even 2000.  I might be able to get a server license for a reasonable price since 2000 is the old version.  I also don’t like the fact that Windows is pretty loaded up.  The problem is that Windows has much higher resource requirements, so running many of them can be resource intensive.  It also means that I’m responsible for more licenses, which is very bad.

While I’m at it, I’m going to try to run some benchmarks, so that I can find out if Linux runs VMware server faster than Windows 2003, and if so, by how much.  I’ve been curious about that for some time.  I would love to see a performance increase.  If that is the case, I’m guessing it’s simply because of the low overhead of the basic Linux install.  There is much less polling going on by default.

Starting to love Ubuntu Server

I’m always trying to give Linux an honest shot at winning me over.  I’m not a big fan of paying Microsoft massive amounts of money for every little thing I need.  I’ve been particularly interested in Ubuntu lately, for the sole reason that it has a massive community.  Each time I’ve tried it, I’ve tried the live version inside of a virtual machine, so that it’s isolated and controlled.

Now that Ubuntu has version 6.06 out, I gave it a try as usual.  I was very impressed that you can power up the live CD, and then perform the install while still using the OS!  Very cool.  It gives me something to do during the install.  The complete install took about 15 minutes, which was incredible.  Once I fired it up, it was very responsive, and impressively identified all of my hardware.

By day, I’m a Microsoft .NET software engineer.  By night, I’m a tinkeraholic.  Ubuntu desktop is great, but it just doesn’t do what I want it to do.  I just use way too many pieces of software that only run on Windows.  Microsoft Money, Visual Studio, Outlook, TortoiseSVN, etc.  That’s also the reason that I can’t really recommend it to anyone I know.  If I ever were to install it on someone elses machine, I would inevitably get a call asking why they can’t get their Scooby Doo game to run, or they can’t get Firefox to correctly show SomeCrappySite.com.

Anyway, even though I know I can’t really switch, it doesn’t lower my curiosity.  However this time when I was reading about the latest version, I noticed that there is a server version available.  The memory and hard drive requirements are very low, and it’s very stripped down.  I’ve gotten quite a bit of time to use it, and I must say it is AWESOME.  It’s as little or as much as you make of it, which is great for a server environment.  Installing software is actually EASIER and BETTER than in Windows.  To install Subversion for example, you can simply type “sudo apt-get install subversion”, wait about 3 seconds, and boom, you’re done.  It’s that rediculously easy.

The simplicity is all do to the fact that Ubuntu is a distribution of Debian.  Debian has a major advantage which is their package manager, which makes all this installation magic so great.  There are literally 20,000+ packages out there, all ready for you to start exploring.  If the install needs input from you, it will ask you during the install.  If you ever upgrade that software later, it will remember your answers, and make everything as automatic as possible.

In some future posts, I want to go over some of the great things you can do with Linux (that I have done), in the following topics

  • Setting up a virtual, modular server, using pre-built VMware appliances, or building your own
  • Setting up a virtual router using a program called Monowall
  • Remotely administrating your Linux server, using a web-based interface known as Webmin
  • Setting up VMware server, and installing the VMware tools in your Ubuntu virtual machine