Category Archives: Computers

WinXP: Capturing screenshot using PrtSc from a Video gives a Black Blank Image.



Many a times, when we try to capture a screenshot using PrtSc (Print Screen) functionality from a playing Video or a Game, the result is only a Black Blank image or the video keeps playing inside that image.

This is because PrtSc copies the Video buffer rather than the actual image.


Disable / Turn off the ‘Hardware Overlay’ feature by going to Display Properties -> Settings -> Advanced -> Troubleshoot -> Move the Hardware Acceleration Slider to None.

For more reference, refer


Error: Not enough permissions when sharing unix / linux directory in Windows using samba share.


It has been seen that many a times even after properly configuring the samba settings, we face many issues when trying to access any linux drive in windows.

This can easily be resolved by following 2 steps:
1) Set the enforce mode of SELInux to Permissive by command ‘setenforce PERMISSIVE’.
2) Disable Linux firewall by command ‘/etc/init.d/iptables stop’.

And voila! You would be able to access all drives of unix / linux in windows.


Error: SVN ‘\’ is not a working copy error.


Many a times, an ‘SVN update’ or ‘SVN commit’ command produces the following error:
“SVN ‘\’ is not a working copy error.”

This usually happens when SVN is installed on a Windows machine and linux drive is mapped using samba service.

This happens if the root of the drive containing the source code is shared and mapped.

To resolve this issue, map the parent drive (and not the root) and then try to update or commit on the root of the drive.

Considering an example, if the source code is stored in drive /home/xyz/www/mywebsite/source-code, then do not map the complete drive.

Instead map ‘/home/xyz/www/mywebsite/’ using samba and then navigate to ‘source-code’ directory and try to do an SVN update or commit.

This will no longer produce this error.

Hope this answers the question.


Win XP: Maximizing a window from taskbar automatically maximizes other window too.


It is often irritating when we want to maximize one window from taskbar and other non-required window is automatically maximized.

Consider a scenario where multiple windows are open in windows taskbar. Call them Window-1, Window-2 and Window-3.

Now we want to minimize and maximize Window-1 by clicking it in the taskbar.

But when we try to maximize Window-1, Window-3 is automatically maximized. This becomes annoying many a times.

So a simple solution to prevent maximization of Window-3 (when we click on Window-1) is as follows:
1) Press “Win + D” to view Show Desktop.
2) Now try to click on Window-1 icon in taskbar and you’ll see that Window-3 automatically maximizes in the background. (This can be verified by minimizing Window-1 again)
3) Click on Window-3 or move the focus to Window-3.
4) Right click on Window-3 icon in taskbar and click ‘Minimize’ link. Doing this, Window-3 will be minimized.
5) Now left click on Window-3 and it will be maximized again.
6) Now try clicking on Window-1 again. This time Window-3 will not interfere in the process.


C programs to print various patterns.

Question 1(a): Write a program to print the following pattern:

1 2
1 2 3
1 2 3 4
1 2 3 4 5



void main()
	int i,j,num_lines;

	printf("\nEnter the number of lines to print: ");
	scanf("%d", &num_lines);

	for(i=1; i<=num_lines; i++)
		for(j=1; j<=i; j++)
			printf("%d ", j);


Question 1(b): Write a program to print the following pattern:

2 2
3 3 3
4 4 4 4
5 5 5 5 5



void main()
	int i,j,num_lines;

	printf("\nEnter the number of lines to print: ");
	scanf("%d", &num_lines);

	for(i=1; i<=num_lines; i++)
		for(j=1; j<=i; j++)
			printf("%d ", i);


Fix js calendar position in IE browser.


It has been seen many a times that if the content of the page is long and if js calendar is included below the whole content, then its position is not as desired in IE browser.

It is positioned perfectly in Mozilla Firefox next to the trigger button. However in IE it is randomly positioned anywhere in the HTML page.

To address this problem, you may refer following links:

Copying from the above links for quick reference:
To fix the IE 8 position issue go to calendar.js file. Somewhere around line 1392 you should see the following block of code:

if (Calendar.is_ie) { br.y += document.body.scrollTop; br.x += document.body.scrollLeft; } else { br.y += window.scrollY; br.x += window.scrollX; }

Replace this code with:

br.y += window.scrollY; br.x += window.scrollX;

That is what worked for me. I haven’t checked if it screws up the calendar position on ie 6, it probably does. But people shouldn’t be using that anyways.


How to send email from perl?


It took me half a day to debug and find out the way to send email from PERL.

Email is the best form of debugging when it comes to PERL or PHP. But first I had to debug as to why email is NOT being sent from PERL.

So I thought the script would be useful for future developers so that they don’t have to spend that much time as I did debugging the delivery of email from PERL script.

Please find below the code snippet to send email from PERL.

[Take a special note of the use of ‘\’ before symbol ‘@’ in email address. This was the thing that I had missed out and spent hours debugging the issue.]

$mailprog = “/usr/sbin/sendmail”;
open(MAIL,”|$mailprog -t”);
print MAIL “To: xyz\ (Test Test)\n”;
print MAIL “From: xyz\ (Test Test)\n”;
print MAIL “Subject: Test Email\n”;
print MAIL “Content-type: text/html\n\n”;
print MAIL “Test Email from perl”;
close (MAIL);


How to enable scripting in your browser?


To allow all Web sites in the Internet zone to run scripts, use the steps that apply to your browser:

Windows Internet Explorer
(all versions except Pocket Internet Explorer)

Note To allow scripting on this Web site only, and to leave scripting disabled in the Internet zone, add this Web site to the Trusted sites zone.

1. On the Tools menu, click Internet Options, and then click the Security tab.
2. Click the Internet zone.
3. If you do not have to customize your Internet security settings, click Default Level. Then do step 4

If you have to customize your Internet security settings, follow these steps:
a. Click Custom Level.
b. In the Security Settings – Internet Zone dialog box, click Enable for Active Scripting in the Scripting section.

4. Click the Back button to return to the previous page, and then click the Refresh button to run scripts.

Mozilla Corporation’s Firefox version 2

1. On the Tools menu, click Options.
2. On the Content tab, click to select the Enable JavaScript check box.
3. Click the Go back one page button to return to the previous page, and then click the Reload current page button to run scripts.

Opera Software’s Opera version 9

1. On the Tools menu, click Preferences.
2. On the Advanced tab, click Content.
3. Click to select the Enable JavaScript check box, and then click OK.
4. Click the Back button to return to the previous page, and then click the Reload button to run scripts.

Netscape browsers

1. Select Edit, Preferences,Advanced
2. Click to select Enable JavaScript option.


Load Balancing Methods for web servers.

Load Balancing Methods:

Round-Robin load balancing
Round-robin is one of the simplest scheduling algorithms for processes in an operating system, which assigns time slices to each process in equal portions and in order, handling all processes without priority. Round-robin scheduling is both simple and easy to implement, and starvation-free. Round-robin scheduling can also be applied to other scheduling problems, such as data packet scheduling in computer networks.

The name of the algorithm comes from the round-robin principle known from other fields, where each person takes an equal share of something in turn.

Both WebMux and DnsMux has round robin modes. For WebMux, the round-robin, or weighted round robin is preferred scheme used in layer 4 based load balancing. For DnsMux, round-robin mode is vs. the fail-over mode. Please see the user manuals for details.

Persistent Round-Robin load balancing
Persistent Round Robin is similar to round robin load balancing, except for each visiting client, they will stay with the same server till they log off, or till the inactivity timer expires.

Weighted Round-robin load balancing
Weighted round robin take counts the server capacity. For more powerful servers, the weight can be higher. The older or less powerful servers, the weight can be lower. WebMux will load balance based on the weight on each server. Please use minimum normalized weight number. Instead of having weight 99 and 100 for two servers, use weight 1 and 1. In stead of using weight 80 and 60 for two servers, using weight 4 and 3, or even 2 and 1. Because WebMux will send the requests to one server the number of weight times before sending to next server.

Persistent Weighted Round-robin load balancing
To keep the user session stick to the same server, WebMux supports the persistent weighted round robin load balancing method. This is a layer 4 method. Same client will stay with the same server during the time of visiting. The persistent timeout is based on the user’s inactivity, which can be adjusted in the “setup” screen.

Least Connections load balancing
Since 1998, WebMux supports a least connections method that distributing vistors to a site to multiple servers based on the number of connections already on a server. WebMux distributes new connections to the server has least connections based on a few factors.

Persistent Least Connections load balancing
Persistent least connections is a load balancing method that WebMux has been using since 1998. It will keep the same client session with the same server, until the client sign off, or the inactivity timer expires. Please note the persistent is actually against the least connection, so the result may not be the most desireable.

Weighted Least Connections load balancing
WebMux allows user set a weight to each server, so that new and old servers can serve the same site/farm together. The weight is preferrable minimum normalized number. Please note that the weight is served by WebMux from one server to another, so the smallest weight is desireable.

Persistent Weighted Least Connections load balancing
This is also a load balancing method WebMux supporting since 1998. Although both persistent and weight algorithms are against the least connection algorithm, WebMux still trys to sending the connections to servers based on all three factors. The net result may not be the user desired.

Weighted Fast Response load balancing
WebMux distribute the load to servers based on the weight and the server response time. Although this method sounding really good, but to achieve the best result based on server response, one must consider also the server resources. We recommend to use custom health check method to best load balancing the traffic.

Persistent Weighted Fast Response load balancing
The persistent weighted fast response load balancing method is also not recommended. Consider using custom health check method. In the custom health check method, customers can write their own cgi code on their servers detecting all situation to best feedback to WebMux for increament, decreament, or totally not sending any load at all to the server.

Layer 2/3/4/5/7 Load balancing
WebMux can load balance vistors in different network layers. For network layer definitions, please visit this page. Please note that WebMux is obey the ISO/OSI layer definitions.

Layer 7 URI load directing
WebMux can manage traffic based on layer 7 rules. One of the layer 7 rules is the load directing based on the URI. URI is a portion of the complete URL. The match pattern can be archored from start of the URL, or anywhere in the URL. When more than one servers have the same URI to match, the incoming requests will be round robin between the servers. Since URL is layer 7 protocol, one must enable WebMux’s SSL termination to be able to use any Layer 7 traffic management algorithm.

Cookie Persistent load balancing
WebMux supports load balancing in layer 7 protocols. One of the layer 7 protocol is the cookie based load directing, also called cookie persistent. WebMux will track the cookie server placed into the browser, thus same client will always send to the same server till the cookie expires.
Layer 7 URI load directing with host name MIME header matching and cookies
Cookie and URL are part of host MIME header. For details of the MIME header, please read the HTTP protocol RFC 2616. WebMux can match part of the MIME header to achieve the traffic management tasks.

Newer algorithms are being added to the WebMux supporting different load balancing needs.