Saturday, June 27, 2009

Updates for business critical functions vs twitter updates

Updates for business critical functions vs twitter updates. http://performance360.blogspot.com/2009/06/irony-updates-for-business-critical.html

ManageEngine Interop TV Interview

OK time for some shameless self promotion.

Last month we (from my company) attended the Interop Tradeshow in Las Vegas. Well I had the opportunity (by chance) to be interviewed at the show for ManageEngine.

You can find the video here http://www.youtube.com/watch?v=H-a2K9nxJDg

Thanks Alex for taking the pain to record it.

Monday, June 22, 2009

Turn off windows beep error sound

If you get in to trouble with some parameter for a command line tool in windows, you get an annoying - LOUD noise. Irritating to say the very least. Now you can turn this windows beep sound by running the below 2 commands in a command prompt. 

prompt>net stop beep
prompt>sc config beep start= disabled



Wednesday, June 17, 2009

Troubleshoot Apache Module Rewrite

Simple troubleshooting tips to get Apache Module Rewrite to work. This is most probably an idiots guide so geeks excuse.

If you have been trying to get Apache Mod Rewrite to work for the last 2 hours, then welcome.
Some keywords : mod_rewrite errors in windows or ubuntu linux. I got it working with Apache 2.2 and PHP 5.2.9.2.

Simple troubleshooting steps to make it work.

This is only a troubleshooting article for getting mod_rewrite to work. There are lots of others on the web that are useful for setting mod_rewrite up. Basically I went wrong where I had "Indexes" for my "Options". The most irritating thing in many forum posts is the incompleteness / assumption that others know how to put the entries.

There are basically 2 ways of configuring mod_rewrite.


Approach I Setting the required "Options" in the httpd.conf file
Approach II Setting the required "Options" in the .htaccess file

NOTE :
x) MAKE SURE YOU USE YOUR OWN SYSTEM PATHS FOR THE FOLDERS AND FILES !
y) Please note the parent folders .htaccess could affect your sub folder's .htacess file's setting. Hence it is recommended you try out examples given on the web as it is, including using the same folder path
z) The rewrite rules you see in this page are for 2 popular rewrite examples found on the web.

Two simple examples for Mod Rewrite / mod_rewrite
http://www.wallpaperama.com/forums/how-to-test-check-if-mod-rewrite-is-enabled-t40.html
http://www.workingwith.me.uk/articles/scripting/mod_rewrite

Approach I Setting the required "Options" in the httpd.conf file

So below changes are to be tried in the httpd.conf or our apache's equivalent httpd.conf.

1) When hitting the URL http://localhost/test-programs/modrewrite/alice.html if you get
Not Found
The requested URL /test-programs/modrewrite/alice.html was not found on this server.

then most probably your problem is you have set to AllowOverride to None.

AllowOverride None. Change this to AllowOverride All

2) Forbidden
You don't have permission to access /test-programs/modrewrite/alice.html on this server.

The above error you get if you have set the folder's Options to

Options Indexes MultiViews

Change to
Options MultiViews

i.e remove the "Indexes" and make sure you also have Options All set explicitly.

The below is sure to work if you have set it in the the right location. Use the whole configuration below EXACTLY AS IT IS, except for the folder path.

Alias / "C:/wwwroot/"
Directory "C:/wwwroot">
Options All MultiViews
AllowOverride All
Order allow,deny
Allow from all




Note MultiViews has to be added for sure.


OR the below one. Note it is required to have "FollowSymLinks" or "SymLinksIfOwnerMatch" in the options, but you still need MultiViews.

Alias / "C:/wwwroot/"


Options FollowSymLinks SymLinksIfOwnerMatch MultiViews
AllowOverride All
Order allow,deny
Allow from all


Some places to look around for errors :
Apache Error log file to check messages in :
C:\Program Files\Apache Software Foundation\Apache2.2\logs\error.log

Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: C:/wwwroot/test-programs/modrewrite/alice.html

REFERENCE:

For your benefit, I am putting all the relevant httpd.conf entries below. This is how mine looks.

I access it on my PC as http://localhost/test-programs/modrewrite/alice.html

MAKE SURE YOU USE YOUR OWN SYSTEM PATHS FOR THE FOLDERS AND FILES !


DocumentRoot "C:/wwwroot/"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#

Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all



#
# This should be changed to whatever you set DocumentRoot to.
#

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes
#Options Indexes All
#Options Indexes MultiViews

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all



ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"
LoadModule dir_module modules/mod_dir.so

The below is required only if you also want PHP to be working.

LoadModule php5_module "C:/SoftwareInstallations/PHP5292/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/SoftwareInstallations/PHP5292"

Here are the alias entries with relevant permissions.

Alias / "C:/wwwroot/"


Options All MultiViews
AllowOverride All
Order allow,deny
Allow from all



For more help content, search for "MultiViews" in your httpd.conf file. If you have apache2.2, maybe your main conf file for Apache maybe its apache2.conf. Best do a search for "MultiViews" in all your conf files and make sure you read the help content too.


Approach II Setting the required "Options" in the .htaccess file


If you are not allowed to modify your httpd.conf, then you can also set the "Options" properties in your corresponding .htaccess. Please note the parent folders .htaccess could affect your sub folder's .htacess file's setting.

I donot have .htaccess file in my C:/wwwroot/ or test-programs/ but only in my C:/wwwroot/test-programs/modrewrite/ folder.

That means my httpd.conf alias permissions entry is as below

Content of httpd.conf

Alias / "C:/wwwroot/"

#Options All MultiViews
AllowOverride All
Order allow,deny
Allow from all


Content of .htaccess is below

Options All MultiViews
RewriteEngine On
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
RewriteRule ^alice.html$ bob.html


OR AS BELOW

Options Indexes SymLinksIfOwnerMatch MultiViews
RewriteEngine On
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
RewriteRule ^alice.html$ bob.html


For performance reasons it is recommended to have .entries in the httpd.conf itself instead of every folder.
The above 2 rewrite rules are for 2 popular rewrite examples found on the web.

Labels:

Wednesday, May 06, 2009

Mounting jumpdrives on RedHat Linux

Login as "su" super user on your linux machine and add the line below that helps you mount the jump drive on boot up.  Addd the line in bold below.

my  -  /etc/fstab  file


LABEL=/                 /                       ext3    defaults        1 1
none                    /dev/pts                devpts  gid=5,mode=620  0 0
LABEL=/home             /home                   ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda7               swap                    swap    defaults        0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0
/dev/sda1               /mnt/jumpdrive          auto user,noauto,unmask=000 0 0
/dev/hda8               /mnt/ddrive             vfat    auto,umask=0 0 0
/dev/hda9               /mnt/edrive             vfat    auto,umask=0 0 0
/dev/hda10              /mnt/fdrive             vfat    auto,umask=0 0 0
 
/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0

Additionally if you just want to mount a jumpdrive for a one time use, you can just use the "mount" command.

#
mount /dev/sda1 /mnt/jumpdrive

If the folder /dev/sda1 does not exist create it.


Monday, May 04, 2009

Gold Prices to remain stable ? China is buying gold.

US tops based on Gold held by Govt.   China is also buying gold to diversify its reserves. See new article on this story here. This is good for the overall Gold market as prices could remain stable for more time. People are slowly moving out or diversifying out of the dollar ?

To see a listing of countries based on Gold held - http://www.elitetrader.com/vb/attachment.php?s=&postid=2086287





PM Manmohan Singh : Iron Fist in Velvet Glove

PM Manmohan Singh : Iron Fist in Velvet Glove : A nice articel about the PM in rediff.com. I agree that this is one of the better Prime Ministers we have had. The achievement of this man starts right from 1990 with economic reforms. Kudos to Congress President Sonia to choose him as PM instead of herself !

Some excerpts from the article

Even on the nuclear agreement he was willing to let the Left Front take credit for securing a final agreement that was in the nation's interests! This was a compromise formula communicated to the prime minister by a senior Left leader. When the final 123 agreement between India and the United States was made a public document, one view within the Left Front was that they should take credit by claiming that they had helped secure a better outcome than what the prime minister was capable of securing from the Americans.


Clearly, Singh was willing to stoop to conquer. But when this compromise formula was rejected by the hardliners in the Left, Singh had no option but to show the iron fist in his velvet glove. Never under-estimate the determination of a self-made man!

More often than not Singh would get his way through patient consultation.

But apart from this formal consultation, he would be on the phone with UPA leaders like M Karunanidhi [Images], Sharad Pawar [Images] and Lalu Prasad and keep them informed on every major decision, and get their concurrence before acting. His is a classic cabinet style of functioning. On major policy issues he would keep even the Left in the loop. ...............The downside of such a consultative process is, of course, that decision-making takes time and tough decisions don't always get taken. But that is the price we pay for having diverse coalitions. There is a paradox in the liberal angst about politics and policy in India. On the one hand we celebrate coalitions as a mirror of our diversity; on the other hand we want 'tough' leaders who will impose their will.
 

Full article
http://election.rediff.com/column/2009/may/03/guest-pm-symbolises-iron-fist-in-velvet-glove.htm