June 22nd, 2011 by bhumish.shah §
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. Amazon Cloud Computing is a good choice if you want to deploy very large scale network on the cloud which requires high availability, auto scaling and load balancing features.
In this article I will explain how you can configure High Availability for Microsoft Sql Server 2005/2008 & Web server (IIS) in Amazon EC2. I am assuming that you have basic idea and knowledge of how Amazon EC2 works.
First of all let’s start with Amazon Load Balancing for Web Server.
Assuming that you have created 2 instances for your web server in Different Availability Zones and deployed your web application on IIS.
Just go to Load Balancer tab in EC2 menu,and then click on Create a New Load Balancer

Select Ping Protocol http, Ping Port 80, ping file name: iisstart.htm

Note: Ping Path file should be there to work load balancer, load balancer will check iisstart.htm file at 0.5 minutes interval.
On next page just select your 2 web server’s instances

Just click on create button in next screen.

Make sure that you’re both web servers instances are on different Availability Zone. For example 1 web Server on US-East-1a and other web server’s instances on US-East-1d as shown in above screenshot.
Different Availability Zones means different data centers of Amazon in same Region.
You can check your Load Balancer’s status on below link . Make sure that your both instances are In Service mode.

That’s it your web server is now configured with load balancer URL which Amazon provides.
Now you can access your web Server from Load Balancer’s URL.
For Sql Server’s High Availability we can’t use load balancer but we have different options like Database Replication, Database Mirroring.
Now let’s see how to configure database mirroring in Sql Server 2005/2008.
For Database mirroring just take full database backup of primary database and restore it on secondary server with no recovery option. You also have to install Sql Server in witness server to have automatic fail over of the database.
Sql Server’s Database mirroring uses port 5222 port number so make sure that you have open 5222 port number in your security group (firewall).
After restoring database on secondary server go to primary server, just right click on your database then click on database mirror wizard and follow the instruction as below

Click yes on do you want to configure security to include witness server roles wizard.

Select primary database instances on below screen.

Select your mirror server instances

Select the Witness Server’s Sql Instances

Click finish button to start the database mirroring .
That’s it. Your Sql server’s high availability setup is completed. If your primary server goes down it will automatically switch connection to mirror server and your mirror server becomes active now. So your clients or you will not have any problems at all to access your application!
May 13th, 2010 by bhumish.shah §
This article will describe how you can get started with the subversion server based on Windows.
I’ll use the Visual SVN standard edition. Visual SVN is also available in the enterprise edition but it is not free. The standard edition is free and you can use it in a commercial environment.
Links for the Visual SVN Server : http://www.visualsvn.com/server/
Download links for the Visual SVN standard edition:http://www.visualsvn.com/server/download/
Download it and install with the administrator privileged on the system.

Select VisualSVN Server and Management Console.

Select the location where you want to install VisualSVN Server and store SVN repositories.
You can use 2 types of authentication:
1) Subversion Authentication: The SVN Server uses its own authentication. It will create its own database for users , groups and permission.
2) Windows Authentication : This option will allow you to assign rights to Windows users and groups.

Now, I’ll describe how to use SVN authentication.
After installation open VisualSVN Server Manager. Create a New Repository. You can also use Trunk , Branches and Tags. Here, we are going to create a repository named subversion.
- Create one user for testing purposes and name it digicorp.
- After creating a subversion repository, right click on it and go to the Security tab.
- Remove “Permission to Everyone” or select “No Access to Everyone” and give read/write access to digicorp users.

We are now done with the server aspect of the configuration. A link will be created for the subversion repository like this: https://terminal.digi-corp.com/svn/subversion/
You can also specify the IP address instead of giving a domain name like this: https://192.168.0.204/svn/subversion/
Now I’ll descibe the client aspect of the subversion server.
Download the Tortoise SVN client and install in on a Windows machine. You can not install Tortoise SVN client on a Linux machine. For linux System you can use SmartSvn, KDESvn, etc.
Here is a link to download Tortoise SVN client for Windows: http://sourceforge.net/projects/tortoisesvn/files/Application/1.6.8/TortoiseSVN-1.6.8.19260-win32-svn-1.6.11.msi/download
After installing the Tortoise SVN client, right click on the desktop and select SVN Checkout. Accept Certificate permanently.
URL of Repository : https://terminal.digi-corp.com/svn/subversion

Now we have completed both the server and client aspect of the configuration.
Visual SVN Server has the backup and restore functionality also. But we have to use the command line.
Go to the following location on Server: C:\Program Files\VisualSVN Server\bin\
Execute the following command to Take backup: svnadmin.exe dump subversion
This is a Simple SVN Server solution and is very useful for smaller organizations that want to start or test the Subversion functionality. For use in bigger organizations you can try Linux-based Subversion Server which is very stable and more reliable as well.
September 11th, 2009 by amit.shah §
Table of Contents
- Introduction
- What is FCKEditor?
- When Should We Use FCKEditor?
- The features that attracts the user to use it
- What are improvement needs in it?
- Integrate FCKEditor Step by Step
- How to apply Themes
- How to apply Language
- Conclusion
- Bibliography
- References
- History
Introduction
There are many editors available in the market. Each editor has its own features, benefits and drawbacks. FCKEditor is top one of them in Open Source category. In this article, I will explain some of good features.
What is FCKEditor?
FCKEditor is HTML text editor brings to the web much of the power of desktop editors like MS Word. FCKEditor is powerful tool which provides the html editing, theme to suit your web interface, multiple language supports, selection of tools to be displayed as per requirement, image upload, flash file upload and many more. It’s lightweight and doesn’t require any kind of installation on the client computer.
The features that attracts the user to use it
- Open source
- User friendly and easy to integrate
- Toolbar selection facility
- Support of multiple language
- Support of skin to suite web page UI
- Light weight
- Image and flash file upload
The improvement which could be done
- Inbuilt facility to select theme at client side
- Inbuilt facility to select language at client side
- More font type and font size to improve user interface
Integrate FCKEditor Step by Step
- Download FCKEditor source code from following link: http://sourceforge.net/projects/FCKEditor /files/FCKEditor /2.6.4.1/FCKEditor _2.6.4.1.zip/download
- Create new/ Open existing web project/ website

- Copy FCKEditor source code folder and paste it to website root directory.

- Copy FCKEditor FredCK.FCKEditor V2.dll file from source code and paste it to website Bin folder

- You have to register FCKEditor to use it in your page. There are two way to register it. Manual: Following script will register it. You have add this script in every page you want to use FCKEditor.
From Toolbar: : You can Otherwise, you can browse FCKEditor by right click on Toolbar >> Choose Items. A dialog box will appear as shown in following image. Select .Net Framework Components >> Click on Browse button located at right hand bottom. Choose the .dll of FCKEditor from the bin directory of your application. An item called FCKEditor will be added to your Toolbar. Now you are ready to drag and drop editor in your page. If you place editor in your page, it will also add same code in your web page as we have done in manual method. 
- Run website, you can see the FCKEditor in your browser with default theme and default English language.

How to apply Theme?
FCKEditor having a great themeing feature. User can apply the theme in two ways. One way is dynamically and another statically. The site of FCKEditor provides 3 themes to be downloading. There are many third party open source themes available to download. I have shared few themes with this article.
[1]. Default Theme
[2]. Office2003 Theme

[3]. Silver Theme
Now, how can assign default theme and apply dynamic theme?
Answer is here:
First of all you can set default theme from fckconfig.js, look at below image:

You can also set the language from .aspx /html /php page where you have declare FCKEditor .
Just set the SkinPath Property.

Now run the application you can view the office2003 theme in FCKEditor as you have set in above page.

How to apply Language?
FCKEditor provides a great multiple language support feature. User can able to change the language dynamically or set default language as per website language.
FCKEditor provides 56 languages that is you can use as per your requirement.
Now, how can assign default language or apply dynamic language?
Answer is here:
First of all you can set default language from fckconfig.js, look at below image:

You can also set the language from .aspx /.html /.php page where you have declare FCKEditor.
Just set the DefaultLanguage Property.
Now run the application you can view the Arabic language in FCKEditor as you have set in above page.

Conclusion
FCKEditor is very simple, easy to integrate and can be used in almost all the web application as html editor/ rich textbox editor.
Bibliography
FCKEditor
References
FCKEditor
History
4th September, 2009: initial post
- Run
-
- website, you can see the FCKEditor in your browser with default theme and default English language.

September 1st, 2009 by bhumish.shah §
This article shows how to configure raid 1 mirroring into your linux server
you must have two hard drive installed on your linux server with the same capacity
You can listed them using the following command
fdisk –l
This will display your currently installed hard drive on your linux server
/dev/hda/
/dev/hdb/
Then you have to create a logical partition on both hard drives with same capacity
Following command willl create a new partition on your linux server , for first hard drive (/dev/hda)
fdisk /dev/hda
This will ask for primary or extended partition
Type e for extended partition
Next will ask for cylinder size of your partition , don’t change anything
Next will ask for actual space for your extended partition
Type +10000M
Type w for write partition table
Now you have to create a logical partition using the following command
fdisk /dev/hda
N for new partition
L for logical partition
Just enter with the default configuration (cylinder size)
Type the size of your logical partition +5000m
Type w for write partition table
Remember by default when you create a new partition linux uses partition id number 82 .
You have to change this partition id fd for raid configuration with the following command
fdisk /dev/hda
Type l for change partition id
This will ask you which partition id would you like to change type your partition number
For example 5
Type fd for raid partition id
Type w for write partition table
You have to complete the same procces on second hard drive
Now you can start your raid 1 configuration using the following command
But before do this please check mdadm rpm package is installed or not
You can check this using rpm –q mdadm
You can also install this package using the following command
Type rpm –ivh mdadm
Now run the following command to create raid array
Type mdadm –create /dev/md0 –level=1 /dev/hda5 /dev/hdb5
This will create a raid partition on your linux server
You can see the details using the following command
Type mdadm –detail /dev/md0
Now you have to format this partition to use them
Type mkfs –t ext3 /dev/md0
This will write ext3 file system on your raid partition
Then you have to mount this raid partition on some directory using
Type mount /dev/md0 /raid1
If one of the hard drive faild on raid 1 type the following command to remove them from raid1
Type mdadm /dev/md0 –f /dev/hda5 (to fail your harddrive in raid1 )
Type mdadm /dev/md0 –r /dev/hda5 ( to remove your hard drive from raid1 )
Now you can join a new hard drive create logical partition with same capacity & join into you raid1 partition using the following command
Type mdadm /dev/md0 –a /dev/hdc5
You can see raid1 will syncs the data with the new hard drive using
Type mdadm –detail /dev/md0
August 13th, 2009 by mehul.brahmbhatt §
1. Record the script which you want to perform for stress testing.
For Example: if you want to add 1000 records then just record add functionality script.
2. Now just add a loop for that script which contains add record functionality. See below example
For i=0 to 1000
Put your add record script code here. It will repeat the add record loop till 1000 entries will be done.You can insert 1000 records using For.. Next loop.You can also insert more than 1000 or more.Just change your for loop condition for that.
Next will increase your loop counter
Next
Below code is a full example of the stress testing:
For i=0 to 1000
Below code will insert first name jigar. For unique name you can pass value of i so it will insert unique name each time.
Browser(“PMS”).Page(“PMS_3″).WebEdit(“txt_Name”).Set “Jigar” & i
Below code will enter address in the address field.
Browser(“PMS”).Page(“PMS_3″).WebEdit(“txt_Address”).Set “Surat”
Below code will enter mobile number in the mobile number field.
Browser(“PMS”).Page(“PMS_3″).WebEdit(“txt_No”).Set “9992426690″
Below is code to save the details
Browser(“PMS”).Page(“PMS_3″).Link(“btn_save”).Click
Next
This is a script to add 1000 records.
July 21st, 2009 by jigar.parvatia §
How to connect database with application running in QTP to check data in DB dynamically?
An example is shown connecting QTP with SQL Server
A simple script is shown below with necessary comments :
Dim con,rs,column_count,column_name,i,column_value
Set con=createobject(“adodb.connection”) // Its a connection object
Set rs=createobject(“adodb.recordset”) // A record set should be defined
// Necessary connection string should be their
con.open “provider=sqloledb.1;server=.\SQLEXPRESS;database=DBNAME;user id=XYZ;password=XYZ”
// Finally the record set is defined to fetch the value of particular fields according to the query passed.
rs.open”select * from tbl_newsMaster where username=’admin’”
// Checks the record set till the end until any record is found.If any record is found then it stores the values in “rs” record set.
Do while not rs.eof
For i = 0 To rs.Fields.Count -1
‘ msgbox rs.Fields.Count //counts the number of records in record set “rs”
column_value=rs.Fields(i).value //Fetches the value of particular field stored in record set “rs”
column_name=rs.Fields(i).name
Msgbox “Record Exist :” & column_name&” ” &column_value
next
rs.movenext
Loop
July 13th, 2009 by gaurang.tripathi §
How to Enable/Install Spell Checker in Firefox:
(1) Go to https://addons.mozilla.org/en-US/firefox/addon/3497
(2) Browse through the page and click add to Firefox.
(3) Software installation Dialog box will appear and click install.
(4) After installation completed, click restart Firefox.
In order to enable/disable spell check Right Click on the composing area and click spell checking to enable or disable it.
How to lookup for Definition:
(1) Go to https://addons.mozilla.org/en-US/firefox/addon/2083
(2) Browse through the page and click add to Firefox.
(3) Software installation Dialog box will appear and click install.
(4) After installation completed, click restart Firefox.
While composing select the word, right click on it and select “Inline Definitions” From popup menu. You will see the meaning of word.
June 27th, 2009 by divyang.shah §
Facebook has always been touted to have strong privacy controls. To most extent it is true and it is much better than most of the other social networks. But as a biggest social network they do have loopholes which can be easily exploitable by atleast developers like us.
Today I am going to talk about one such exploit:
How to view albums of people who are not your friends?
So when we search for interesting people on Facebook most of the time you will find their profile having restrictions. Mostly you will be able to see their profile photo and will be able to send message to them. So to see their full profile or albums we have to send “add friend” request and if they approve then and then only we can see their photos and profile.
But here is one way to bypass this:
First you have to add developers application in Facebook which can be added from following link:
Link: http://www.facebook.com/developers/?ref=sb
Then go to this link
http://developers.facebook.com/tools.php
It will open below page and choose you response formate and also method = photos.getalbum as shown in below image.

So after that enter facebook user id whose photos you want to see, in “uid text box” as shown in below image and then press “call method button”.
Get the facebook id from the address bar/url bar or find the “add as a friend” link in the web page and move your mouse cursor over it and you will get facebook id in the status bar as shown in image.

And you will get details of all the albums of that user if he or she have albums as shown in below image in right side box.
Just you have to copy link content from right box and paste it to another browser or tab and press enter and then you can see all photos from that album without adding the user as a friend.

Note: I have changed all the ids they are not real.
I hope with the help of this article and community, facebook will notice this bug and will resolve it.
So enjoy peeking on stranger’s albums. 
Update: It seems that Facebook has resolved this bug now.
June 27th, 2009 by Supriya Agnihotri Jagani §
Here is the customized design that would give a new look to your radio buttons & check boxes.
You can use different images you show the checked/unchecked check boxes & selected/unselected radio buttons.
Here is how your customized Check box & Radio buttons will look.

customized checkbox

customized radio button
View Demo
You can change the images (the css has the image paths) to give that different look to your radio button & check box elements.
Browser Compatibility: Script is compatible & checked in Firefox, IE 6 7 & 8, Safari 2.0, Opera 9.0 & above & Google Chrome.
Click to download the .zip file with the script, css, html page & images; to give that much needed customized look to your form elements.
Script reference taken from: www.flog.co.nz
June 15th, 2009 by Brijesh Patel §
This Article is just an introduction to .Net Remoting. We will see in which situation .Net Remoting is useful and technical view of .Net Remoting.
What is .Net Remoting?
In General, Remoting is communication between two application domains. One application domain can communicate with other application domain with help of some kind of medium. This is how .Net Remoting works.
Now let’s see how .Net Remoting is useful in our real life scenario.
Suppose there is one company name ‘ABC‘.
It main office is in Ahmedabad city location. And there are some branches are in Ahmedabad city only but in different areas. And Outside Branches also there may be in different cities like Surat, Baroda, and Mumbai etc.Now all the branches are connected with main office and all the transaction done through main office only. So all the branches in all the places should connect with main office and communicate their data also.
So in this kind of situation .Net Remoting is very useful technology.
.Net Remoting works on three tier Application.
1. Client
2. Interface
3. Server
In this Client side, generally UI is there where user can directly interact with the application. They put some input and get some output in any format like reports, graphical or any.
And in Server side all the business logic is there. If user input some data then all the transaction is done in server side. And last one is interface. Interface is medium to connect server and client. So many clients are connected with one server only through interface.
For example,
In above situation of ‘ABC’ company.
Server application is installed in Ahmedabad main office only and all other branches clients are installed. So all clients are connected with server means Ahmedabad main office. In main office there is main server is there and database is also there.
So when one client application sent some request through interface then that will come into the main server machine and then if they want to some data from data base then go to database and get it back to server application and back data to the client. If data is huge then data base server is installed in different machine other than different machine where server application is installed so transaction gets very fast.
Now we understand how .Net Remoting works internally.
DCOM is replace by .Net Remoting. By using .Net remoting, we can make remote object calls which lies in different application domain.
What is Application Domain?
Before we start to understand .Net Remoting, we just go through what is Application Domain?
Generally process used their owned security boundaries. In the Process there are number of application can run and one process has its own virtual memory and does not effect or overlap to other processes virtual machines. So one process can’t crash with other process. So same thing this concept used in .Net and more over ahead of this, concept of Application Domain are used. In Application Domain, Multiple Application can run in same process without influencing each other. In that, if one application domain throws errors it does not affect or stop whole process and not effect with other application domain. To invoke method in an object running application domain .Net Remoting is used.
General Concept of .Net Remoting and its Architecture
Remoting has at least three sections:
• Interface
• Client
• Server
in .NET Remoting, the client does not call the methods directly. A proxy object is used to raise methods on the remote object. All the public methods that are defined in the remote object class are also available to be called from clients.
This method of calls is called Message. These messages are serialized using formatters and then send message through channel from client. Thus Client channel communicate server channel and there server channel receive message and de serialised through server formatter and sent to the server remote objects.Generally .Net Remoting can be used across any protocols.
Any objects are created outside to the boundaries of Application Domain then it is called remote object to the AppDomain. These remote objects can access by references or by value.
What is marshalling and different kind of Marshall?
Marshalling is used when object are converted. So these objects can travel throughout the network by channel and formatter.
There are two types of marshalling in the .net remoting.
• Marshall-By-Ref
• Marshall-By-Values
In the MBR, create proxy to communicate with other side of the network or remote object and create ObjRef instance that itself serialized.
ObjRef Returns by all Marshall () methods and it contains location of remote object, Hostname, Port Number and Object name etc.
For example:
MarshalByRefObject obj =(MarshalByRefObject)RemotingServices.Connect(typeof(Ilogin), “tcp://LOCALHOST:65101/ITestEndPoint”);
// Set a reference to the service. After this, you use testRemoteReference
// just as if it was a local instance of ITestImplementation.
loginreference = obj as Ilogin;
Whereas in MBVs objects, Copy of the object is created on the other side (i.e. server side). The object to marshal is stored in to a stream, and a stream is used to crate copy of the object.
So Marshalling is a process of packing object and a call and its arguments made by an AppDomain on a remote object into a unit that’s easily transferable across the network. In other we can say that Marshalling is process to transfer message from one place to other means its destination. Once marshal reached its destination, an unserialized process is taken place and returns its original data by this.
Difference between MBV and MBR
MBVs is that they get serialized with all the private and public data members. But that may be cause problem if a client intercepts the serialization/de-serialization phase to harm application.
While MBRs, only clients decide which objects can travel across there network. He doesn’t have to load entire copy of the object if he wants to call some functions or some procedures only. And MVB execute in its original native places only where it governed by CLR. So Application May misbehaviour in some cases but that is happened vary rarely.
In .Net Remoting there are two ways to create remote objects.
Server activated objects (SAO)
Client activated objects (CAO)
SAO has two modes named ‘Single call’ and ‘Singleton’.
Single call is an object that object created with every method all or server trip. So all these objects are stateless. And after use of that object it is destroyed and every time creates new objects. Single Call objects are useful in scenarios where the objects are required to do a finite amount of work.
While in other side, in Singleton the object is created only once and the object is shared with all clients. So this kind of objects is used for share object through out the application. So singleton objects are useful in many applications like chat application etc.
CAO is not stateless compare to SAO. Client holds proxy to the server object on the client side which is created on server object on server side.
Example of Single call and Singleton:
Singleton:
// Register the interface and end point.
//
// Each service has a unique endpoint and this endpoint is how a client
// accesses a specific service on a remote server.
Type ilogin = Type.GetType(“login”);
RemotingConfiguration.RegisterWellKnownServiceType
(ilogin,”IloginEndpoint”,WellKnownObjectMode.Singleton);
Singlecall:
// Register the interface and end point.
//
// Each service has a unique endpoint and this endpoint is how a client
// accesses a specific service on a remote server.
Type ilogin = Type.GetType(“login”);
RemotingConfiguration.RegisterWellKnownServiceType
(ilogin,”IloginEndpoint”,WellKnownObjectMode.SingleCall);
In next article we will see more about .Net Remoting like Channels and Formatters, Object Activation and Lifetime and simple example of .Net Remoting .