Category Archives: Troubleshooting

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

Greetings,

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.

Thanks.

Fix js calendar position in IE browser.

Greetings,

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:
http://www.dynarch.com/projects/calendar/old/#Kcomment-202
http://www.dynarch.com/projects/calendar/old/#Kcomment-1955

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.
—————————————-

Thanks.

How to send email from perl?

Greetings,

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.com (Test Test)\n”;
print MAIL “From: xyz\@test.com (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);
—————————————-

Thanks.

How to enable scripting in your browser?

Greetings,

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.

Thanks.

Avast Free Antivirus Error: Cannot connect to server when updating antivirus definitions.

Greetings,

After installation of Avast Free Antivirus, when trying to update antivirus definitions or antivirus software, we get the following error:
“Cannot connect to server.”

This can be resolved by following the below mentioned steps:
1) Open Antivirus Software [Clicking on the yellow icon in the taskbar near watch]
2) Click on ‘Settings’.
3) In the navigation, select ‘Updates’.
4) Click on ‘Proxy Settings’.
5) Select radio button ‘Direct connection (no proxy)’.
6) Click on ‘OK’ button to save changes.

Try updating the antivirus definitions now.

It might be done already!

Regards!

Solved: Drupal 7 incompatibility with mod_security regarding jquery.cookie.js file.

Greetings,

With Drupal 7, it might happen that we are working on configuring and customizing Drupal and suddenly our website stops responding.

We might think there could be an issue with the Internet connectivity. But we observe that all the other websites are responding fine.

So we log a ticket into your host to find out the following response from them:
—————————————————
Your ip was blocked in the firewall due to the mod security we provide you the logs so you need to consult with your programmer.

2012-07-09 ***** /misc/jquery.cookie.js ***** Access denied with code 406 (phase 2). Pattern match “(?:\\b(?:(?:type\\b\\W*?\\b(?:text\\b\\W*?\\b(?:j(?:ava)?|ecma|vb)|application\\b\\W*?
—————————————————

Confused! From this, we can only realize that we are not allowed to access our own website because we are probably trying to hack our own website.

Jokes apart, following conclusions can be drawn from the above message:
1) Our IP is blocked and no further requests can be served from the current IP address.
(We may probably disconnect from the Internet and reconnect to get a new IP which may start working only to find out that new IP is also blocked after a few requests)

2) Something has got to do with ‘mod_security’.

3) Something has probably got to do with the file ‘jquery.cookie.js’.

If we aggregate all these findings, then we come to know that there is some compatibility issue of Drupal 7 with Apache module ‘mod_security’ regarding the presence of word ‘cookie’ in filename ‘jquery.cookie.js’.

Either of the following 2 steps can be taken to overcome this problem:

1) Request your hosting provider to disable mod_security for your website / domain.

2) If Step-1 is not in your control, then login into Drupal as administrator. Go to ‘Configuration -> Performance’ option.
Check the checkbox ‘Aggregate JavaScript files’ and click on button ‘Save configuration’.

Hope these steps help you to solve this issue.

Other References:
1) http://drupal.org/server-permissions
2) http://drupal.org/node/522646
3) http://forums.cpanel.net/f5/mod-security-blocking-jquery-cookie-javascri…
4) http://www.modsecurity.org/tracker/browse/CORERULES-29

Regards!

Drupal 7: Display Taxonomy Menu on your website.

Greetings,

If you are running a Drupal 7 based website, many a times you might have felt a need to categorize your content and display a menu showing a list of categories.

Unfortunately, it cannot be done just using the core modules of Drupal 7.

So if you want to give your viewers a good navigation across your content, execute the following steps:

1)  Login as 'Administrator' into your Drupal 7 website.
2)  Create a proper vocabulary that is required for categorizing the content.
    a. Go to link: Structure » Taxonomy
    b.	Add terms and sub terms as per requirement.
3)  Convert Vocabulary to a 'Required' field by editing the relevant content type.
    a.	Go to link: Structure » Content types » Article » Manage fields
    b.	Check the checkbox which says 'Required Field'.
4)  Ensure that all existing content has been categorized in at least 1 category.
    a.	For general content which cannot be categorized in any category, add a general term called 'Miscellaneous' in your vocabulary.
5)  Set the 'Vocabulary Widget Type' to 'Select List'.
    a.	Go to link: Structure » Content types » Article » Manage fields
    b.	Select tab 'Widget Type'.
    c.	Select option 'Select list' in drop-down 'Widget type'.
6)  Take a backup your existing 'Database'.
    a.	By exporting data in an SQL file.
7)  Install following contributed modules: 
[Just download, extract and keep the folders of the modules in 'modules' directory of Drupal 7]
    a.	Ctools (Chaos Tools)
    b.	Pathauto
    c.	Taxonomy Breadcrumb
    d.	Token
    e.	Taxonomy Menu
    f.	Views
8)  Enable all the above contributed modules from link: Modules.
[Note: Just enable 'Chaos tools' module out of the entire Ctools suite]
9)  Create a new menu which will hold the list of all categories.
    a.	Go to link: Home » Administration » Structure » Menus » Add Menu.
    b.	Give a suitable Title (Ex. Categories) and Description to your new menu.
10) Set the position of that newly created menu from the Blocks.
    a.	Go to link: Structure » Blocks
    b.	Select a specific region for your block to be displayed and Save the configuration.
11) Edit your vocabulary in taxonomy to link it to the menu that was just created.
    a.	Go to link: Structure » Taxonomy » Edit Vocabulary.
    b.	In the 'Menu Location' drop-down, select the name of the menu which you just created.
12) Build appropriate URL aliases [Delete and Rebuild].
    a.	Go to link: Configuration » URL Aliases.
    b.	Go to tab 'Delete Aliases'.
    c.	Select the checkbox 'All Aliases'.
    d.	Click on button 'Delete Aliases Now'.
    e.	Go to tab 'Bulk Update'.
    f.	Select the checkboxes 'Content Paths', 'Taxonomy term paths', 'User paths'.
    g.	Click on button 'Update'.
13) Change the configuration so that content with the child terms are automatically displayed when parent term is selected.
    a.	Go to link: Structure » Views » Taxonomy Term (Enable) » Taxonomy Term (Edit) » Advanced » Content: Has taxonomy term ID (with depth).
    b.	Set the value of 'Depth field' to '1'.
    c.	Click on the button 'Apply (All Displays)' to apply these changes.
    d.	Click on the button 'Save' to save the changes permanently.

Thanks!