Archive for software

Push Email on the Windows Mobile Platform

A few months ago, I went ahead a bought an HTC Touch Smartphone. I initially wanted the Pocket PC platform, so that I could easily sync up with Outlook and have all of my contacts and appointments with me at all times. Synchronizing that information with a typical phone is very painful.

image

At first, I didn’t really like the HTC Touch. It’s slow (compared to a standard phone or an iPhone). The biggest issue was getting push email to work. The guy at the Sprint store claimed that you would just enter your email credentials, and push email would magically be enabled. I ensured him that it wasn’t that simple, but he still insisted.

With pocket Outlook I was able to set up access to my GMail account using IMAP. The problem was that it was slow, and push email didn’t really work at all. Research led me to the conclusion that Pocket Outlook really sucks at IMAP. I even tried another email client (Flexmail), but I still wasn’t satisfied.

Then, I found out that you could use the "Live" application on the phone to get real-time email from Hotmail using the option on the device for receiving emails "as items arrive". I signed up for a Hotmail account, and set my GMail account to forward a copy of all messages. This option proved to be very flaky, but the email delay wasn’t too bad. After doing some research, it seems as though this option pretends to be push email, but is in fact very frequent polling. I would occasionally lose my data connection, and the mail application would just give up.

image

Now on to the option that actually works, and the ONLY option that has worked consistently, reliably, and without much delay (5-15 seconds). Sign up for the "Live" option on Mail2web. This basically gives you your own free Microsoft Exchange account. Set up your email accounts for forward a copy of your messages to this account. Then use the credentials they supply to connect your device. On Windows Mobile 6, you can set it up in ActiveSync on your desktop, or through the device itself.

This option has worked flawlessly for me, even when I can barely get a signal. I get email no matter where I’m at, and I can save time because I don’t need to compulsively check my computer for new mail. I’m guessing this is really the only well supported option for mail, because this is how business customers would set it up.

For extra credit, I copied the XP email notification sound off my system, amplified it (using Audacity), and then set that as my mail notification. I get the recognizable email sound, which is pretty confusing to those around me when there are no computers around.

Enjoy your real-time push email!

Windows 2008 and Visual Studio 2008 Launch Event

I attended the "HEROS happen {here}" event in Milwaukee Wisconsin. This launch event covered Windows Server 2008, Visual Studio 2008, and SQL Server 2008. I’m including my notes here in case they are of use to anyone.

Microsoft always does a good job putting on events, and this was no exception. There were a lot of third party vendors, and there was no lack of freebies from all. Microsoft gave everyone a nice lunchbox with a decent breakfast inside.

Microsoft also gave out copies of Vista Ultimate SP1, Windows Server 2008 Enterprise (including a virtual key), and Visual Studio 2008 Standard. Stay tuned for a post where I’m going to have details about giving away some of this software to you.

500563220_a2b1f718f9

Windows 2008 Server

  • Powershell can easily manage remote machines, including executing a command line remotely.
  • Group policy is now a service
  • Group policy now has extensive logging
  • Custom group policy (preferences) allows you to arbitrarily add registry settings or files.
  • RSAT - Allows you to manage your 2008 policy settings with Vista.
  • WinRS is basically an SSH alternative for Windows.
  • You can set up a custom view to filter (search) for event log events for all computers in your network.
  • The old 64KB receive Window limitation has been replaced with a receive window system that auto-tunes. This provides a significant increase in network speed. The benefit increases as the latency increases.

Virtualization & Hyper-V

  • The feature set appears to be one step ahead of VMware Server in many ways. For example, you can do CPU throttling and multiple snapshots.
  • There is a version that will give you a bare bones version that is ONLY Hyper-V, and it’s only 40,000 lines of code.
  • Application Virtualization (SoftGrid)
  • Requires VT extensions
  • Can be scripted using Powershell
  • Based on the OS you buy, you can get free Windows licenses for the virtual machines. For example, if you buy Datacenter Edition, you can run unlimited Windows 2008 virtual machines on it without buying multiple licenses. Enterprise edition covers 4 virtual machines. Standard covers 0. You actually get virtual keys for the virtual machines.
  • Licensing is per socket, not per core (which is the same as VMware licensing)
  • Terminal services features EasyPrint so that virtual printers don’t have to be installed. It uses XPS (think MS PDF) as a common communication format.
  • You can set up a terminal services gateway to provide access to any terminal server behind your firewall.

image

Visual Studio 2008

  • MOSS is very popular right now (really?).
  • Expression Web just released version 2.0.
  • HTML 5 is about to be finalized.
  • CSS 2.1 is about to be finalized.
  • Visual Studio allegedly writes decent cross-browser XHTML code.
  • ASP.NET starter kits are available at www.ASP.net, and look pretty interesting.
  • The AJAX control toolkit has some very impressive controls that let you easily add functionality to your pages. For example, there is one that adds a watermark to a TextBox. Another confirms button actions (delete for example).
  • Test inheritance
  • The ScriptManager can localize formats
  • Easily call server methods with JavaScript
  • New profiling tools
  • More tools are available in Professional that used to be only available in higher editions.

Set up a Windows SSH tunnel in 10 minutes or less

Here are step-by-step instructions for setting up a quick and dirty SSH tunnel to another network. This gives you the ability to connect to any machine and port that the remote machine has access to. The process is so simple, it should take you less than 10 minutes.

Why would you want to do this? Well, it’s a pretty slick way to connect to a remote machine on a single port and have access to all of the network resources of that machine. Your connection acts like it’s originating from the server. As a test, I set it up on my development computer running Visual Studio. Visual Studio runs web projects in a special web server that is only accessible from that machine. Using SSH, I was able to make it accessible to anyone on my network using my computer as a gateway.

SSH Diagram

In this example, we’re going to be using two free pieces of software. On the server, we’re going to use a version of OpenSSH that uses a stripped down version of Cygwin to run on Windows. On the client, we’re going to use Putty.

The first step is to download and install both programs. Here are the links to the download pages for each product:

On your the server, where OpenSSH was installed, we need to run a couple of quick commands at the command line (go to start->run and type "cmd"):

  • mkgroup -l >> ..\etc\group
  • mkpasswd -l >> ..\etc\passwd
  • net start opensshd

You’re now running an SSH server! Now we can configure the client (Putty).

Open up Putty. It doesn’t require installation, so you can simply double-click on the executable. In the tree on the left, navigate to Connection->SSH->Tunnels. We’re going to add a list of local ports that will be routed to machines that the server has access to. For example, if we want to access remote desktop on the remote machine, we can put a destination of 127.0.0.1, and a port of 3386. The source port is the port that we’ll connect to on our machine. Remember to click "Add" when adding a forwarded port.

SSH Tunnels in Putty

You should end up with something like this. Now, go to the "Session" section in putty. Enter the host name of the server you want to SSH into. Then, select "SSH" as the connection type. Then press "Open". You’ll be prompted for a username and password, which should be an account on the server you’re connecting to.

Putty Host Name Screen

The beauty of this is that you don’t have to set up the port list on the server, it’s all configured on the client. You can even let computers connect to your computer and have them be routed to the remote machine.

Hopefully that is enough information to get you started. I’m no SSH expert, but it was pretty easy to get set up when doing it this way.

IIS 6 and Apache on the same server and port

This has been written about before, but I just ran into it, and hopefully I can save someone a headache.

Apache Feather 

I installed Apache on my dedicated server, which has 9 IP addresses. Since all my sites have a dedicated IP address, I figured I would just configure Apache to listen on some IP’s, and IIS listen on the others. They both would listen on port 80. I configured it correctly, only to find out that Apache wouldn’t start.

It turns out that IIS hogs port 80 on all IP addresses, whether IIS is configured to listen on them or not. Microsoft has a good knowledge base article on the subject, and of course it’s by design so it’s not going away.

The only thing to remember is that the instructions are for specifying the IP addresses that IIS should listen on. For some reason, I was thinking the opposite initially, which obviously caused some frustration.

RE: Switching from Linux to Windows 2008

I’ve gotten so much feedback from my post “I switched from Linux to Windows Server 2008” that I think I need to clarify a few things. The responses have ranged from agreement to personal attacks. I’m impressed by the emotion of the people that really believe in their operating system. Personally, I’ve always tried to use each tool for different situations.

Most importantly, I’d like to explain why I wrote the post. I was simply sharing my personal experience, which may or may not be your experience. I know that Linux is very popular, and my opinion is that it is a superior operating system in many ways.

Now for a little history of my experience, which may help understand my feelings.

Confused!

Years ago I was running Windows 2003 for a home server. I was frustrated by the poor performance, high resource usage at idle, and tricky to configure. I have years of Windows experience, and I could never quite get it set up the way I wanted. I also wanted to avoid the cryptic Windows licensing, and their policy of locking you into the products of their choosing.

So, I built a brand new computer, and installed Ubuntu Server 64 bit edition. I spent weeks getting it configured (not continuously of course). I kept notes, and I was pleased at the fact that I could use a single command line to install pretty much everything I needed:

Sudo apt-get update; sudo apt-get upgrade; sudo apt-get -y install ssh subversion dovecot-imapd samba xinetd build-essential getmail4 p7zip-full ia32-libs mdadm bind

 

How cool is that!

I was very happy, except when things would go wrong. For example, 4GB of memory wouldn’t work with Linux, but anything less would. It turns out that I had to blacklist the “intel_agp” module. I really wish I could get back the hours of my time that were wasted. Am I any better for the experience? No. Can this happen in Windows? It certainly can.

Here were the additional problems I had, which subsequently wasted additional hours of my time:

  • The software RAID array would stop working 50% of the time when rebooting. It’s not fun having your heart sink when it says that there is a problem with the RAID array that all of your data is on (yes, I have off-site backups, but it’s still a hassle).
  • The VMware server console would not work when I reinstalled the host OS. VMware itself worked fine, and I used the “vmrun” command over Putty to manage my virtual machines. Believe me, that is not fun.
  • Samba was ridiculously slow. Try searching for samba optimizations in Google. Why isn’t the performance better out of the box?
  • Random network errors would appear on the server console. Sometimes the network would simply fail. Sometimes it took a reboot to get it working again. Simply calling “sudo restart /etc/init.d/networking” didn’t work.
  • Dual monitor support. Don’t even ask me how many times I’ve modified my xorg configuration file.

Could I have taken the dozens of hours and fixed all of these issues? Maybe. I did my due diligence and searched Google and the Ubuntu forums for help. I even posted my problems without getting answers. I’m certainly not against learning. I’m a software engineer by trade, so I would rather be spending time learning Adobe Flex, Silverlight, MVC frameworks, and new coding methodologies. Is it so bad that I want to choose what I want to learn?

I just want a solution to my problem that works with the minimum amount of hassle, so I can focus on what I enjoy.

That is my opinion, and you can’t say it’s wrong!

Recently I read quite a few articles about .NET developers switching to Windows 2008 as a workstation operating system. I took the leap and did the same. My experience has been very positive, and my opinion is that it’s a great operating system. I intend to write a post specifically about that in the future.

Because of the frustrations I was feeling on my server, I decided to give Windows 2008 a try on there as well. In total, I’ve spent about 2 hours getting it set up, from start to finish. Some of the new setup features deserve an entire blog post (stay tuned!). The only thing I haven’t set up is subversion and my off-site rsync backups. I’ll be running the Subversion virtual appliance for my source code (which coincidentally, is my project).

On person said that I’m just trying to get attention. Well, it’s my blog, and I admit that part of my motivation is to get readers.

Another person said that the post was an advertisement (at least I think that’s what he meant). Well, to prove I’m not being paid by Microsoft, I’ll admit that they have a ton of software that just plain sucks. I’m looking at you Vista.