Re-detection of DMA mode in windows xp

My desktop computer was running extremely slow but it wasn’t like this before. Even formatting didn’t help, so I knew for sure that there was a problem with hardware. I was right on that, DMA mode wasn’t being detected by XP.

For your knowledge, DMA (Direct Memory Access) is a mode supported by modern hard-disks/DVD drives for much faster access times to device. To check if your HDD’s working on DMA mode, follow these steps:

1. Open Device Manager.

2. Expand IDE ATA/ATAPI Controllers to display the list of controllers and channels.

3. Right-click the icon for the channel to which the device is connected, select Properties, and then click the Advanced Settings tab.

4. Check the Current Transfer Mode: If it is in PIO mode, that means that it isn’t working in DMA mode. Try selecting ‘DMA if available’ from Transfer Mode and restart and recheck if the mode changes to DMA. If it doesn’t change, that means either your HDD doesn’t support DMA mode or the registry entries need to be deleted so that Windows XP redetects the mode on startup.

Automatic method for deletion of registry keys:

Download this vbs script:
Link

Execute the script and everything will be done automatically. This is the recommended method.

Source: http://winhlp.com

Manual method for registry keys deletion:

1. Open RegEdit.

2. Navigate to the following KEY:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\

3. It will have subkeys such as 0000, 0001, 0002, 0003, and so on.

4. Inside each key, delete all entries of the following values:
MasterIdDataChecksum
SlaveIdDataChecksum

5. Restart the computer. Windows should now redetect the DMA settings.

[Solved] Absolute positioning and screen-resolution problem

Absolute positioning is great for positioning items anywhere on a page but it does not mix well with screen-resolution. It might look fine on your resolution but it might look completely different on another resolution. Element placement changes upon changing the screen resolution or even when resizing the browser window. It is because items positioning is measured from the browser’s window.

To always display it correctly, you can put relative or absolute positioning on the parent element.

Eg:

Hello World!

	

Edit registry without windows

Many a time you will want to edit your registry when you get your windows screwed and it refuses to boot up.
You know what changes should be made in the registry to fix the problem, but you don’t have any way to fix it. I had a similar problem and I used this tool to edit registry:
http://home.eunet.no/pnordahl/ntpasswd/main.html

This is a non-GUI bootable app. You should be familiar with the command-line and how it works before using it otherwise you may get into deeper problems.

This is another tool which I found while googling:

http://www.pcregedit.com/

I hope this helps all you people who are thinking to reformat your computer because of registry errors.

Peace!

Debugging Javascript In Internet Explorer

Internet explorer has always been a programmer’s nightmare. You have finished a wonderful looking site, full of javascript effects just to find out that it doesn’t work in Internet Explorer. Its a real pain in the neck to find out which part of the script is causing errors in Internet Explorer.

In Firefox, we have tons of debugging option including the default error-console, firebug, etc which are very good tools. But in IE, the default error reporting mechanism shows wrong line no. most of the time, so its pretty useless.

I searched for debugging tools for javascript in IE and came across JS Companion. Its a pretty good addon for IE which can help you debug javascript easily. It solved my problems in seconds. They also have other addons for IE which gives pretty much same functionalities as firebug gives in FF but they aren’t free.

Peace!

The best way to earn online

I’ve come across many sites, forums and blogs teaching thousands of methods to earn online. Some would really zoom past your head if you don’t know basic marketing tricks. There are Paid To Click, Paid to Post, Paid to Read, Paid to Write and Paid To *insert anything here*. XD

Anyways, I’ve tried various methods but succeeded in none of them. Maybe because I get bored easily and don’t have so much patience. People would wait for months to earn 10$ from a Paid To Post forums. I just can’t do that. I can’t really post to get paid. If I feel like posting, I will… if I don’t, I won’t. So, these methods were pretty useless for me.

The method that worked for me the best was Freelancing. No, freelancing just doesn’t mean programming. You can freelance for almost anything including writing, designing, programming.. anything you are good at. Freelancing is something you’d love to do. It’d make utilizations of your skills and earn you some money. It will help you earn much more than any other method. Many people do full time free lancing and easily earn their living with it.
Their are many websites offering freelancing services to users all around. Some of them the best are:

1. Scriptlance.com

2. Elance.com

3. Getafreelancer.com

4. Rentacoder.com

5. Limeexchange.com
There are hundreds of more sites like these just a Google away. You can try your skills on these sites and monetize your talent and earn 1000s of bucks weekly/monthly depending upon your capability.

Stop wasting time in other online earning programs. Instead, take some time to develop skills and get on these sites to earn lots of money. No need to start websites or clicking on ads. Just exploit your talent.

Peace!

Happy earning online!

Searching for a text string in all files and directories recursively in PHP

Sometimes you need to edit some part of your website and unfortunately it isn’t made by you. You will, obviously, need to search for the file in which that particular part of site exists. In CMSs/forums/blogs, it get really hard to search it manually.

I was having a similar problem. I needed to edit the footer of my site http://www.techmindz.com but I didn’t know which file, out of 100s, had that particular part. I just made a script for that.

<?php

$query=escapeshellarg($_GET['str']);

$query="find . -exec grep -l $query {} ;";

system($query);

?>

Save this file as textsearch.php in your root directory. Now visit the site www.yoursite.com/textsearch.php?str=yoursearchstring

And voila! You get the results.

Peace!

DisclaimerPlease note that this should be used only by webmasters as a quick tool to find specific strings within all files without having to download all the files to local computer. While this method is not recommended, this can be used as a temporary tool only. This file (textsearch.php) should be deleted as soon as your work is done with it for security reasons. I won’t be held responsible for any damages caused.

Solution to “MySQL Server Has Gone Away” Problem

Seriously guys, I got this error and I was laughing hard. The error is just too funny, don’t you think? Yes, it is but not for developers like me. Problem to this error is almost undetectable and there are more than a dozen reasons as to why this occurs and this often baffles developers.

This error generally comes when :

MySQL connection times out.

The MySQL server shuts down.

The connection is interrupted.

The query you are performing is too large for server to handle.

The query you are performing takes more space than allowed (default: 16MB).

While these are some common reasons, there maybe some unknown reasons to come across this error. I faced one of those unknown reasons.

My PHP code looked somthing like this:

<?php

function one()

{

….

}

function two()

{

….

}

function connect2db()

{
…..    //this connected to db

}

// Around 10 more functions

// Then:

connect2db();

one();

two();

/* Couple more function calling, a few loops, a few conditions and then the query: */

query = “Select id from users”;

$result = mysql_query($query) or die(mysql_error());

?>

I just tried so many solutions to solve the problem. I copied the query and pasted it in phpmyadmin to check if there was a problem with the query but it was not. The problem was on the PHP side.

When I tried everything else, including repairing and optimizing the tables and changing tables’ engine to innoDB, and the problem wasn’t solved, I just changed my code to immediately execute the query after the connection. For that I modified my code to look like this:

<?php

function one()

{

….

}

function two()

{

….

}

function connect2db()

{
…..    //this connected to db

}

// Around 10 more functions

// Then:

one();

two();

/* Couple more functions calling, a few loops, a few conditions and then the query: */

query = “Select id from users”;

connect2db();

$result = mysql_query($query) or die(mysql_error());

mysql_close();

?>

I did this at every instance of query, and voila the problem disappeared.

Happy developing, Guys!

Cheers!

Moved my blog to new domain

You might be shocked but I moved my blog to a new domain – www.absolutelytech.com, just after one day at www.insanelyme.com .
Actually, that blog was more of a general life-based blog. I felt it wasn’t suitable for a tech blog. Hence the new name.

It roughly took me 5 minutes to do the job. Thats the magic of wordpress. I just love it.

Thats all fellas.

Hope you like the new domain.

Got a new domain for my blog (How I moved my blog to new domain)

Just bought www.insanelyme.com for my blog. As I consider myself insane (most of you will agree with that), I found this name suitable for my blog. I bought it in the same instant when I saw it was available.

I added the domain in cPanel as addon domain but unfortunately it didn’t support second level directory (example.com/tech/blog). So I copied all the files from the directory and pasted it in a directory on top level. I pointed the domain to it and it worked. I changed the Blog URL in admin panel and it worked.

Now, there was this problem of redirection. There always is a problem of 301 redirection with new domains. I had Page Rank and pages listed in search engines which I didn’t want to lose. So, I needed a 301 Permanently Moved redirect. I made a .htaccess file in my old directory and put this:

redirect 301 /blogs/ http://www.insanelyme.com/

I figured this out after a dozen of commands including mod_rewrite. Finally, this worked like a charm.

Bluehost – the best host out there?

Before providing a review for Bluehost, I’ll take to back to the days when I knew nothing about web. When I say nothing, I just didn’t know anything except for normal browsing. Yeah, you heard it right. Through some googling and stumbling on an unknown page, I found out about adsense and its success stories. I made up my mind to do the same and start earning. I had big plans… like earning in thousands of dollars per month. Everything was set. I decided to create a forum but I didn’t have any hosting. I tried few simple scripts on free hosting and I was successful to install them. I forgot to mention – even though I wasn’t familiar with how web worked, I was still a tech savvy out of the web. I could program very well in C/C++ and could troubleshoot almost all of the software and hardware problems myself. So, I tried PHPBB on a free host and I needed a hosting account now to go professional.

After reading some reviews on internet, I found out that bluehost was quite good. Without a second thought, I asked my uncle for a credit card and registered for an account. The cPanel they provide is quite good – nicely organised into categories.

They offered:
UNLIMITED Hosting Space
UNLIMITED File Transfer
UNLIMITED Domains hosting
2,500 POP/Imap Email Accounts
SSH (Secure Shell), SSL, FTP, Stats
CGI, Ruby (RoR), Perl, PHP, MySQL
2000/2002 Front Page Extensions
One Free Domain Forever!
Free Site Builder

Not to mention, their excellent customer service and support.

All this was for 6.99$ per month. It was too cheap for what they had to offer. Its been 14 months since I purchased their hosting and I never had major problems. There was problem for about 10 days when their server went up and down all the time. I asked the support and they said that their was an upgrade being performed on my box. Since, then there hasn’t been any problem. Their 99% uptime guarantee stands out to be true.

If you wanna buy a shared hosting, this host is highly recommended. After all 0.9 million customers cannot be wrong!

This is an honest review from a satisfied customer, that is me.

If you wanna buy this hosting, please follow this link:
Buy your account here.

P.S: So far, I’ve learnt PHP, MySQL, Javascript, CSS, HTML (ofcourse) and I’ve been doing web development for various clients now. No more a newbie to web. xD