Saturday, April 16, 2011

Change Admin Password in drupal 7

last week i installed drupal 7 but i forgot the admin password and i was looking to change this in database as there was no email configuration on my local pc . after some R&D i come to know this method

put the following code in drupal root directory and then change the $pwd value to your desired password and the visit this file in browser and you will a hash password and update it direclty in databse


UPDATE users SET pass = '[hash]' WHERE uid = 1;

in my case uid was 1 .
$pwd = 'password';

define('DRUPAL_ROOT', getcwd());

require_once DRUPAL_ROOT . '/includes/';
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/');


header("Content-Type: text/plain; charset=utf-8");

echo user_hash_password($pwd);

source :

Change appache port in wamp

Open the httpd.conf file in apace folder where wamp is installed (C:\wamp\bin\apache\Apache2.2.17\conf) , then search for listen 80 and then replace 80 to anyother port that you want.

or you can direct open the httpd.conf file by clicking the wamp icon in task bar as:

Friday, April 15, 2011

How to Edit files in Inetpub folder in Windows 7

Run the following command from an elevated command prompt (right click the "command prompt" icon and select "Run as Administrator").

 icacls %systemdrive%\inetpub /grant %userdomain%\%username%:(OI)(CI)(F) /grant %userdomain%\%username%:F

 This command will add full access for your user account to the INETPUB directory. Now the Administrator privileges which you don't have don't matter anymore because your account and not Administrators grant you access

source :

Configure IIS7 for SQL Server data in App_Data path

  1. Start IIS

  2. Open Application Pools by clicking on it

  3. Right click on DefaultAppPool and select “Select Application Pool Defaults”

  4. Change “Identity” property to “NetworkService”

  5. Save and exit IIS

Source :

Wednesday, April 13, 2011

How to get spaced used by a specific table in sql server

its very simple , just need to call this following sp with table name as argument.

exec sp_spaceused 'TableName' and it will return following fields.

name             rows             reserved                data                 index_size    unused
TableName  38701          206912 KB            188088 KB    248 KB          18576 KB

Firefox 4 does not ask to save tabs on exit and not display them on restart.

i was using fire fox and it was asking to save all open tabs and after saving them it shows them upon restrating the fire fox , but last week i updated FF to FF4 and this functionality was missing.  then i checked it and came to know how to use this feauter in FF4. here is the way

One change in Firefox 4 is to by default stop Firefox displaying the warning message, but it can be turned back on by changing some preferences.

  1. Type about:config into the location bar and press enter

  2. Accept the warning message that appears, you will be taken to a list of preferences

  3. Locate the preference browser.tabs.warnOnClose, if its value is set to false, double-click on it to change its value to true

  4. Repeat this for these 2 preferences browser.warnOnQuit, browser.warnOnRestart

  5. Starting with beta 12 there will be an additional preference that needs to be set to true - browser.showQuitWarning

source :