Wednesday, August 3, 2011

Large Image File Processing

Combining large image file can be very tricky. After hours of trying and googling, I stumble upon a cool image processing tools named netpbm. It solved my problem immediately.

I have a very large tiff map image files that need to be stitched into 1 large map. Common image processing software such as Photoshop and Gimp will hang on my laptop since the total file size is over 5 GB.

With netpbm, combining those images is a breeze.

1. Download netpbm from
2. Do not forget to download the "dependencies", you'll need it later on
3. Run tifftopnm to convert all tiff files to portable bitmaps format
4. Run pnmcat -lr or -tb to combine the images
5. Run pnmtojpg to produce the end result in jpeg format

Saturday, July 9, 2011

Accessing Microsoft Message Queuing / MSMQ from Clustered Application

Running a generic program in Windows Fail Over Cluster is not as straight forward as I first thought.

I have 2 servers in Domain A running a generic application with Windows Fail Over Cluster.
2 Servers in Domain B running Microsoft Message Queuing and Network Load Balancing.
All 4 servers are on Windows Server 2008 Enterprise.

My application on Domain A Servers is supposed to send Message Queue to MSMQ on Domain B Servers.

This is what I did on my fist attempt:
1. Setup MSMQ private queue on Domain B Servers
2. Run the generic application on one of the Domain A Server
3. The application managed to send the Message Queue over to Domain B servers without any problems
4. Happy with the result, I create a Fail Over Cluster and put the application in
5. To my surprise, the application failed to send Message Queue over

After some searching on the Internet, I realized that:
1. Windows Fail Over Cluster create a Virtual Machine separate from the original host machine
2. Therefore my application is running on a separate machine without access to MSMQ on original host
3. In order to send the Message Queue over, MSMQ resource need to be added into the cluster

Next, I create MSMQ cluster on the Fail Over Cluster and did some simple test:

Notice that there is a difference between Local MSMQ and Cluster MSMQ.
Cluster MSMQ is accessible by right click on the cluster service name.

The solution to this problem: MSMQ need to be added into the Fail Over Cluster

This is how I solved it for my servers:
1. On the Fail Over Cluster Manager, create MSMQ cluster
Note that MSMQ cluster need Cluster Disk, you can use FreeNAS to test on VMWare
2. Add the generic application into the MSMQ cluster
Add MSMQ as the dependency
3. Test to confirm that the application is working correctly

Here's the screenshot of the setup:

Friday, June 17, 2011

Windows Sharepoint Service 2007 - Search Return Unknown Error

Found some strange problem today. Search function in Sharepoint Server which is installed in workgroup mode apparently not working when it is accessed from the Internet.

Below are the details of the setup:
- OS: Windows Server 2008 Data Center Edition
- Software: Windows Sharepoint Service 2007
- Machine: Amazon EC2 - Small Instance
- Authentication: Integrated Windows Authentication (No Domain)

The search function will work when it is accessed from a browser locally on the server, but return "unknown error" when accessed from Internet.

The solution of this problem:
1. Open Sharepoint Central Administration
2. Click Operations
3. Click Alternate access mappings under Global Configurations
4. Click Add Internal URLs
5. Under URL Protocol, host and port type: http://<domain name or ip address>
The domain name or ip address must be the one used by user to access from the Internet
6. Under Zone, select: Internet
7. Click Save

Tuesday, June 14, 2011

Send MSMQ Message to Private Queue on Different Machine

Faced a requirement from client to set up a system that require sending of MSMQ message to remote MSMQ private queue recently.

Below are the steps to set up simple MSMQ system:

1. Install MSMQ on the sender PC (32 bit Vista)
Go to Program and Features > add Windows Component > Message Queuing

2. Install MSMQ on the destination PC (32 bit Windows Server 2008)
Go to Server Manager > Features > Add > Message Queuing

3. Create a private queue on the destination PC
Go to Server Manager > Features > Message Queuing > Private Queue
Right Click Private Queue > New > Name your new private queue
Right click on the newly created private queue > Properties
Go to security tab and allow Anonymous Access

4. The remote queue can be accessed from sender PC with the following Format Name:

Sample Code in C# here

Thursday, January 27, 2011

Slow Mysql Connection Over Firewall

Encountered this problem 2 days ago at work. An application that works perfectly suddenly stop working. Our system consists of an application server, mysql database server and client terminals operating in corporate LAN environment.

The problem starts to occur when the database and application server are separated into 2 different firewall segments. Database connection from the application server to the database slows down significantly. Managed to solve the problem by adding skip-name-resolve in my.ini just under [MySqld] tag.

This problem may occur because mysql try to resolve the host name from ip address but the firewall block this dns traffic. Details can be found in this url:
Published with Blogger-droid v1.6.5