Corrupted Windows Registry causes boot failure

If you install a driver, program or just accidentally delete an entry in your registry, Windows can blue screen on your next boot and won’t properly recover. The simple manual fix here requires you drop the hd into another machine or have another bootable disk in the original computer.

1) Pull the busted boot drive out of the bad system and put it in another machine that is working and bootable or just switch bootable drives if you have two boot drives in your pc.

2) Set the permissions in the System Volume Information folder on the boot drive you are fixing to readable by everyone (you should delete the everyone entry when done). If you have xp home, you may need to download this file ( SCESP4I.EXE ) and once extracted right click on the setup.inf to install it -> http://support.microsoft.com/kb/195227/EN-US/ . This will give you the security tab in Windows XP Home that is otherwise not available. Note, you must also be able to see hidden system files which you can change under tools -> folder options -> view -> show hidden files and folders and hide protected operating system files.

3) Once you can get into the system volume information folder, go to the restore folders. Each folder is an RP folder named for the restore point instance. If you look in a detailed view, just select the last RP point by time before your computer went to hell. Go into the RP folder and the snapshot folder.

4) Now you are going to copy:
_REGISTRY_MACHINE_SAM -> %SystemRoot%system32configSAM
_REGISTRY_MACHINE_SECURITY -> %SystemRoot%system32configSECURITY
_REGISTRY_MACHINE_SOFTWARE -> %SystemRoot%system32configsoftware
_REGISTRY_MACHINE_SYSTEM -> %SystemRoot%system32configsystem
_REGISTRY_MACHINE_.DEFAULT -> %SystemRoot%system32configdefault

5) Put the boot drive back in the PC and/or switch bootable drives. Reboot your machine and your computer should now have a recent restored registry.

Basic Stop, Start and Restart commands for Plesk in Fedora Core

Apache Stop, Start and Restart Respectively
/etc/init.d/httpd stop
/etc/init.d/httpd start
/etc/init.d/httpd restart

Qmail Stop, Start and Restart Respectively
/etc/init.d/qmail stop
/etc/init.d/qmail start
/etc/init.d/qmail restart

Courier (IMAP & POP3) Stop, Start and Restart Respectively
/etc/init.d/courier-imap stop
/etc/init.d/courier-imap start
/etc/init.d/courier-imap restart

DNS (BIND) Stop, Start and Restart Respectively
/etc/init.d/named stop
/etc/init.d/named start
/etc/init.d/named restart

Dr. Web Antivirus Stop, Start and Restart Respectively
/etc/init.d/drwebd stop
/etc/init.d/drwebd start
/etc/init.d/drwebd restart

MySQL Stop, Start and Restart Respectively
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
/etc/init.d/mysqld restart

ProFTP Stop, Start and Restart Respectively
/etc/init.d/proftpd stop
/etc/init.d/proftpd start
/etc/init.d/proftpd restart

Reference Documentation:
http://kb.parallels.com/en/3158

How to fix the Auto Industry in 5 simple steps

I intended to post similar content in Summer 2008 when the big 3 automakers were just starting to bleed money but I feel these concepts are valid today as well:

    1. Globalize the crash and emissions standards between modern industrialized nations. Today this largely means Western Europe, Japan and North America. Auto manufacturers spend billions on the minutia of local safety and emissions standards. The excessive time and energy spent to bring an already designed and produced car to another market prevents the most appropriate cars from being sold in the appropriate markets. GM and Ford DID and DO make great small cars that would have competed wonderfully against the best from Japan and Korea during our recent $4+ gas price spike. The problem is that GM and Ford only sell them in Europe and couldn’t bring them over because they cost billions and several years to do so. Now imagine if those costs and time were eliminated due to a homologation of standards…. GM and Ford would have a strong full line of great products to pull from at will as the market demands. Concurrently GM and Ford could have been serving Japan and Europe with some of the muscle cars they crave (albeit in smaller numbers). Personally I’d like to see some of the great turbo diesel high performance vehicles lay into the sedate and uninteresting hybrids for some real competition for what a “green car” will be. “Green” doesn’t have to mean boring as seen by many great diesel cars only sold in Europe.
    2. Create “fair trade” laws. We allow cheap imports from Japan, Korea and China to come into this country with few tariffs while our exports are HEAVILY taxed to those countries. Japan, Korea and China want Harleys and Levi Jeans but we can’t deliver them due to massive restrictions. Go to Japan with a suitcase full of stylish, modern US clothing and you may have enough profit for a free trip! On the flip side, we want cheap TVs and vehicles made in these countries on which we place few taxes and restrictions. Ironically the world is tightening it’s trade allowances and raising tariffs but the USA would arguably not have the massive trade imbalance today if we forced a “fair trade” policy in which we levy reciprocal restrictions and tariffs. Japan wants to tax 65% and place limits on Harleys and Levi Jeans? I argue the response should be to tax 65% on all Japanese goods until Japan lets US companies trade fairly in Japan. This either leads to a massive increase in domestic and NAFTA manufacturing or Japan quickly caves and we are once again able to shift the trade balance. Relative to Japan and Europe, the US is a lower wage but skilled workforce with excess manufacturing capability due to losses in manufacturing over the last 25 years.
    3. Kill incentives, rebates, special deals, etc. Most people cannot haggle a strong deal on a car and in the modern world, few US citizens haggle for pricing on their products. I periodically argue the benefits of haggling and have been able to help family and friends purchase items in special conditions under cost but this is rare. Most people strongly dislike the car buying experience, sleazy sales people and stories of our friends, parents and grandparents being ripped off at a car dealership at the sales or service level. Car buying in general needs a revitalization in the US where the sales people need FAR more training on their product and far less training on how to squeeze the most out of their customers. Carmax, Saturn and Scion have attracted customers for years with fixed pricing leading to happier, more loyal customers.
    4. Change the dealer model. The current vehicle sales model holds the dealership as the manufacturer’s customer and the end customer (eventual vehicle owner) at an intermediary level. Dealers want to move what is on their lot with Machiavellian advertising in the local paper for cars that don’t actually exist (GM Malibu on the lot for $1!… you go there and you are told it already sold an hour ago). This process needs to change from the top down where the real customers (eventual vehicle owner) become the manufacturer customers. These customers should not be pushed into what is on the lot but rather what that automotive manufacturer has to offer. Carmax does this in part now with the ability to move cars among local facilities but manufacturers have FAR more leverage to build a vehicle to order or to find one easily within a vastly larger network. I purchased a new truck in 2005 and remember every local dealer saying the options I wanted didn’t exist. I hopped on the internet and using the manufacturer’s website in an unintended way, did a grid pattern search of the east coast, found several vehicles with exactly the options I wanted. I then went to one of those dealerships and made my purchase. When you change this process to focus on product and manufacturer -> end customer and take the focus off of the dealership as the manufacturer customer, everyone wins. Dealerships can still run special programs like free maintenance, track day events, customer focus events, etc to keep customers loyal. Educational material, training and testing for salespeople should be mandatory and we should have a greatly improved training program for mechanics dealing with increasingly complex vehicles.
    5. Drop CAFE and implement taxes on energy. CAFE (Corporate Average Fuel Economy) doesn’t work. CAFE is the politicians way of trying to force better fuel economy but when these regulations went into place, US buyers simply went to unregulated products (trucks) with big engines and drove more miles with the same poor fuel economy as the pre-cafe vehicles. I understand that raising tax on fuel is a flat tax but this could be offset in income tax if politicians are serious about being green and fixing the auto industry. The only way to quickly and effectively change energy usage is to push consumer demand towards better fuel economy. These taxes levied on energy MUST be spent on infrastructure for transportation (roads, high speed rail, etc) and renewable energy / energy efficiency. I strongly support the idea of dumping a lot of this money right back into our domestic auto manufacturers renewable R&D budgets as the Chinese and Japanese have been doing this for years for their domestic manufacturers. Competing auto manufacturers have enjoyed healthy government support while US manufacturers have been pummeled with additional burdens and government criticism.

<nbsp;>
<nbsp;>

Once you add these changes up, I should be able to go to a Ford dealership where I can get information on the vehicle I wish to purchase. I should be able to choose the options I WANT where the dealer can tell me either where the nearest one is or the closest vehicles with similar options are all via computer in real-time (not wait 20 minutes and come back with sparse poorly considered information). I should also be able to choose, say a Ford Mondeo family sedan with a great 2.2L Turbo Diesel engine getting 40+mpg (even if not sold in the US directly, I should be able to choose a european model due to global standards and perhaps pay a bit more to transport the exact model that I want that is sitting somewhere in Germany right now).

Being an engineer in the automotive sector, I believe all of the above issues are logistically possible and would lead to a quick turnaround of the automotive industry in general. There are a lot of complexities that I don’t have time to go into except to say that the issues can be readily solved and that the Global Standards would be for very safe and very clean vehicles first and manufacturers and countries wanting to adopt the standards could do so but not at the risk of bringing the standards to the lowest common denominator.

Perhaps most interesting is that manufacturers like GM have stated that major improvements in fuel economy are too costly as they will add a great deal of complexity to the emissions systems. I argue that this is exactly the wrong approach and wrong way to look at the situation. Let’s take a look at a 1997 Honda Accord V-6 and 2009 Honda Accord V-6. The 2009 Honda Accord V-6 is 268 Hp and gets 19 city / 29 highway MPG. The 1997 Honda Accord V-6 is 170 Hp and gets 17 city / 23 highway MPG (adjusted at fueleconomy.gov for new standards). Now lets complicate this a bit with a 2009 Honda Accord Inline 4 cylinder with 190 Hp and gets 21 city / 30 highway MPG. Honda’s Inline 4 cylinder gets better fuel economy and makes more power than their V-6 from just 12 years ago. The current V-6 makes a solid 100 Hp more! Frankly, this is ridiculous as a late 90s sports car would be envious of the power a 2009 family sedan has? Heck, this 2009 Honda V-6 family sedan makes just a few Hp short of a Nissan 350z Sports Car in 2003.

My point here is that our scale has been altered by US consumers putting power before economy in a perceived boom time from 1999 to 2007 and that all needs to change now. Rather than ADD complexity and cost to a vehicle, I believe the family sedan should drop significantly in power and fuel economy. Fuel costs will eventually go up and government should drive them up artificially now with fuel taxes to force the free market to create better vehicles before we have a repeat of times past. GM can’t do this easily because when they do offer smaller engines with better fuel economy, consumers simply choose the larger engines or go to another manufacturer. CAFE does not solve this problem, only increased fuel costs can do so.

The alternative is a group of headstrong manufacturers fighting amongst themselves for bigger and better numbers. At the time of the last fuel crisis the heavy domestic auto manufacturers were caught off-guard by small, reliable inexpensive Japanese cars. The Korean manufacturers have been making inroads on cost and reliability this time and they are also taking share from the Japanese. Manufacturers should learn this repeated lesson and offer small efficient cars rather than letting every vehicle drift into bigger, more powerful packages endlessly. The only way to maintain such a relationship is to follow a higher fuel cost strategy which necessarily puts efficiency as a primary concern for the vast majority of the market as is done presently in Europe.

Soon a wave of cheap Indian and Chinese cars may be taking even more share from the domestic manufacturers until they realize that greater complexity and cost is not the answer to every problem. Small, efficient, light and reliable has been a necessary staple market proven since the at least the 1960s. So to GM, I say you don’t need greater complexity and cost to meet CAFE. You need light, reliable and lower power offerings. Unfortunately the catch-22 here is that US consumers keep choosing big, heavy and more powerful vehicles which is why only a fuel tax and government intervention will drive development in the right direction for all parties involved.

Another licensing issue pushing our workstations away from Microsoft and towards Linux DESPITE being legal paying customers!

I used a Seagate free tool called Seagate DiscWizard (based on Acronis TrueImage) to image my old Seagate drive over to a new Intel X25-M SSD 80GB drive. This is my workstation and not a gaming station so even with XP, Solidworks, Adobe Creative Suite, Quickbooks Enterprise, etc. the installation was only about 25GB (counting the swap file!). This worked well but I got an activation warning. I don’t remember the syntax but basically the oobe service failed whenever I tried to activate. Ok, great. So I do some work not really worrying about this ( I looked into it and tried some solutions but nothing was effective to this point) and reboot my computer about a week later. Here is where the genius comes into play.

When I reboot into windows and click on my profile to login, I get a warning saying:
A problem is preventing Windows from accurately checking the license for this computer. Eror Code: 0x80004005

After this error message, I am logged off automatically. Ok, so this is a catch-22, a loop I can’t get out of because I can’t get into windows but I also can’t activate my product. So I look around the internet a bit and find LOTS of people doing recoveries or plainly performing complete re-installs. Now, this being a business computer, I have WAAY too much time in customizing what I want and even my last image has a lot of changes that I would not like to go through again (image from just 1 week ago). The just reinstall it method is a HUGE waste of my time.

So I do the following based on a few posts like this:
http://www.anetforums.com/posts.aspx?ThreadIndex=27591

Open your computer in safe mode, open a command promt

Register the following DLL s
it should be in the %system root% system32 folder

just type the following statements one by one and see you got success information popup

regsvr32 licwmi.dll
regsvr32 regwizc.dll
regsvr32 licdll.dll
regsvr32 jscript.dll
regsvr32 vbscript.dll
regsvr32 msxml.dll
regsvr32 shdocvw.dll
regsvr32 softpub.dll
regsvr32 wintrust.dll
regsvr32 initpki.dll
regsvr32 dssenh.dll
regsvr32 rsaenh.dll
regsvr32 gpkcsp.dll
regsvr32 sccbase.dll
regsvr32 slbcsp.dll
regsvr32 cryptdlg.dll

Be sure to use Safe mode without networking because the networking will require the same activation! This didn’t solve my problem so I did this:

I have verified these files:

WindowsSystem32secupd.dat
WindowsSystem32oembios.dat
WindowsSystem32oembios.bin

Problem still not solved, next step (Method 2 as listed in this link):
http://support.microsoft.com/default.aspx?scid=kb;en-us;306081

Now this did in fact work! My computer was up for one day and mentioned nothing about licensing. On my next reboot (after Adobe updates and working on enabling AHCI mode for this new SSD drive), I was again stuck in a loop of MS stupidity.

In the end, I had to get a hacking tool which disables the winlogon.exe check title ” Windows 2003 & XP & LH Anti Product Activation Crack 2.0.1″. Normally I do not advocate cracking software but this is a legal copy, all my software is legitimate and there was not “legal” way to fix this waste of my time. Adobe also has some terrible licensing requirements and despite purchasing their software, I have had to crack their software in the past to get my LEGAL copy to work. Apparently we are reaching the point where the hacking solution is faster, more effective and smarter than spending hours looking for the right way to do things. If I had used this XP crack to begin with, I would have saved myself hours of wasted time. Thanks Microsoft!

ACHI with Gigabyte EP35-DS3L ( Intel P35 + ICH9 ) Chipset

I have been installing Intel X25-M SATAII SSD 80GB drives in a few computers here at work and WOW, what a difference! However, this brings up some questions about the computers these drives are being installed in. This weekend I was working with Vista Business 64-bit with a Gigabyte EP45-UD3P board which had almost as many issues as a 2006 install of XP 64-bit edition on a Tyan 2892 board. I was NOT impressed with the errors I ran into and my impressions of Vista continue to be very poor.

(Sidetrack – Seriously, how many times do I need to confirm my actions? It is actually easier to go into a command line and sudo my commands in Ubuntu than deal with all this confirmation crap, I am constantly reminded of this Apple commercial when working with drivers and software installations in Vista Click to see Vista Security Video)

One of the issues was making sure AHCI would work to support the highest feature level and best speed of this intel drive. This involves installing the Intel Storage Matrix Manager from this location:
Intel Storage Matrix Manager Download

This worked well once installed despite all the default drivers not allowing AHCI. This brought up a question about another computer here, a Gigabyte EP35-DS3L (commonly misspelled as EP35-D3SL for some reason) which has the same intel drive. This computer had the basic sata II to ide intel drivers. Although this chipset CAN support AHCI, Intel chooses to disallow their AHCI drivers from being used with the ICH9 standard chipset. Many have pointed out this is likely a marketing endeavor but frankly it is stupid. The result is that you have to modify the Intel Storage AHCI driver a bit to work with this chipset. It took a while but I found a workable solution that allowed the setup of the appropriate AHCI drivers which required some bios changes and another reboot or two here:

AHCI on ICH9 Guide which worked in my EP35-DS3L based computer

Another Excellent Guide

How to get new Allworx firmware when your Allworx box fails to download the files

Update: Allworx now requires a valid subscription with a reseller to obtain the latest firmware.  We are on 7.4.16.6 presently and it is much more reliable than prior versions. So if you are on the fence, we recommend you bite the bullet and get this firmware by paying for a 1 year renewal period.

Update 2: We still recommend purchasing a valid subscription but find that the current download links for the firmware are located below as of July, 2013.  The link with pre is the pre-production version while the link with pro is the current stable release.

http://upgrade.inscitek.net/allworx6x/pre/upgrade.auf http://upgrade.inscitek.net/allworx6x/pro/upgrade.auf

Another Allworx phone problem here. I still intend to put up a comprehensive review in the future but for the moment I am only going to cover the firmware issue. In the summer of 2008, I upgraded our Allworx 6x box to version 6.9.3.3 firmware. After this version, every time I went to the web interface and chose Maintenance -> Update -> “download from the web” or “check the web” I would get the error (listed receptive to the errors above):

There was an error downloading the files from the web. Please check your network connection, then try again.

OR

Unable to obtain the information about the latest version of the software from the web.

Ok, so this is another instance where Allworx screwed something up and they are certainly not going to help resolve the issue. I look in the logs and see the following:

7 01/23/2009 09:28:37am tWebT0055: Install: Downloading (/releases/allworx6x/upgrade.dat) from upgrade server
7 01/23/2009 09:28:37am tWebT0055: Web Client: Problem fetching URL (upgrade.inscitek.net:80) (/releases/allworx6x/upgrade.dat)
7 01/23/2009 09:29:35am tWebT0055: Install: Downloading (/releases/allworx6x/upgrade.dat) from upgrade server
7 01/23/2009 09:29:35am tWebT0055: Web Client: Problem fetching URL (upgrade.inscitek.net:80) (/releases/allworx6x/upgrade.dat)

Once I see this, I quickly realize the solution which is to simply download the necessary files from this location:
http://upgrade.inscitek.net/releases/allworx6x/filename

BUT you need to know the file names, so here they are:
installFiles.arc
installFiles.ini
newFlash.sre
oisapp
upgrade.dat

Here are the actual links for those who just want to right click and save:

http://upgrade.inscitek.net/releases/allworx6x/installFiles.arc
http://upgrade.inscitek.net/releases/allworx6x/installFiles.ini
http://upgrade.inscitek.net/releases/allworx6x/newFlash.sre
http://upgrade.inscitek.net/releases/allworx6x/oisapp
http://upgrade.inscitek.net/releases/allworx6x/upgrade.dat

Of course it seems that the actual Allworx software should work and perform this action already when telling it to upgrade but hoping for Allworx support or hoping for their software to work in all cases increasingly seems to be a lost cause. We recently upgraded from 6.9.3.3 to 6.9.6.1 because we purchased a new 9224 phone (which is still NOT DUPLEX SPEAKERPHONE, does not have an actual rj11 port (its a handset rj22 port) for the headset and still suffers from poor audio quality compared to other phones we have on the same system but is better than the 9212 phones we have). I really wish Allworx would stop falsely advertising that they have DUPLEX SPEAKERPHONES among the other falsely advertised features.

After our upgrade to 6.9.6.1, we cannot add speed dial numbers anymore… great.

Ubuntu LiveCD (try without changing anything) + GIGABYTE GA-EP45-DS3L = (initramfs) error

Well here I am on a Sunday trying to change my TiVoHD from a 160gb internal drive and 250gb external drive I added several months ago via MFS Tools to a nice 750gb Seagate DB35 (quiet, reliable a/v drive). I find out that I don’t have an operating workstation here at this moment that will properly identify the SATA controller properly to mount the drives I wish to use when using the MFStools iso to boot. I have some older machines that are already ubuntu that I could use to do this but I would have to start ripping apart more machines.

So the MFSTools 2.0 install fails, it can’t recognize the drives with AHCI on and with it off all drives show up as 137439 MB. I decided I was just going to boot via Ubuntu LiveCD and then run MFSTools. I come to find out that when trying to boot with the Ubuntu 8.04 CD without changing anything (the LiveCD function). This only gets me to a blank screen that just says (initramfs) and goes nowhere. I do a little digging and find some people with a similar problem:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/222176

and used the following advice:

I was able to boot from ubuntu 8.04 HH live CD desktop. After selecting language, install, F6 I entered:

all_generic_ide floppy=off irqpoll

The image booted from cd-rom and the installation proceeded without problem. I am hopeful others will have the same success.

It worked so I wanted to put it here as well to help others on this issue when and if they run into it.

MySQL Tuning Tools

mysqltuner, to quickly get this working just run the following:
wget mysqltuner.pl
chmod 0700 mysqltuner.pl
./mysqltuner.pl

To run again, just use this line:
./mysqltuner.pl

MySQLReport
wget hackmysql.com/scripts/mysqlreport
chmod +x ./mysqlreport
./mysqlreport --user USER --password PASSWORD

To run again, just use this line:
./mysqlreport --user USER --password PASSWORD

Guide for MySQL report: http://hackmysql.com/mysqlreportguide#questions_report:total

and the obligatory diagnostic syntax to restart your mysql server:
/etc/init.d/mysqld restart

Also a nice summary of all your MySQL variables:
mysqladmin -u USER --password=PASSWORD variables | more

We had a query go out of control here and take over all cpu on our server recently so we initiated a cpu load control system with respect to mysql queries. However, do implement this we had to bring apache down too. Here is the appropriate command:
/etc/init.d/httpd restart

How to optimize all databases daily on a linux box or with plesk (no more clicking optimize table, hooray!)

Here is the syntax to optimize all databases from your command line:
mysqlcheck --all-databases --optimize --user=USER --password=PASSWORD

And here are the chron settings for daily optimize:
0 4 * * * mysqlcheck --all-databases --optimize --user=USER --password=PASSWORD

if you also want to repair and check the tables (I don’t recommend this), then here is the syntax:

mysqlcheck --all-databases --optimize --auto-repair --user=USER --password=PASSWORD

Common Settings and/or useful settings when setting up Google Apps or Gmail with Thunderbird

1. mail.check_all_imap_folders_for_new -> change to true
2. mail.server.serverX.trash_folder_name (create string if not set) -> [Gmail]/Trash
3. Tools -> Account Settings -> Server Settings -> Advanced…. -> Maximum number of server connections to cache -> Set to 2 (if you have multiple devices or people trying to use one account such as sales, purchasing, etc or have lots of gadgets like blackberry/iphone.
4. Tools -> Accounts Settings -> Server Settings -> Copies & Folders -> Check place a copy in: and choose other: Sent mail on accountname. If using a group account where you want others to see your responses also click place replies in the folder of the message being replied to.
5. Tools -> Accounts Settings -> Server Settings -> Composition & Addressing -> Automatically quote the original message then start above the quote, and place signature below my reply. Once this is set, click ok and go to Tools -> options -> advanced -> config editor -> type in sig_bottom and change all values to false if you want your signature to be at the top. Now restart thunderbird.
5. Add identities as needed, attach signatures for each identity. Be sure the base idenity has the above settings already set so you won’t need to repeat the copies & folders or composition & addressing features. Once done with setting the identities click ok and go to Tools -> options -> advanced -> config editor -> type in sig_bottom and change all values to false if you want your signature to be at the top. Now restart thunderbird.
6. Be certain you have the right smtp gmail server for each account so your sending credentials are accurate. I manage more than one account and found the server assignments for multiple identities to all be set to the default smtp server so every identity must be properly set. To check, go to Tools -> options -> advanced -> config editor -> type in smtpserver and look at the assignments. You can validate this secondarily by looking at mail.identity.idx iterating the numbers for the proper assignments.
7. Tools -> Account Settings -> Junk Settings -> Uncheck the enable adaptive junk mail controls for this account as google should handle this for you.

Important NOTE: After ANY changes to identities you must go back to Tools -> options -> advanced -> config editor -> type in sig_bottom and change all values to false if you want your signature to be at the top. This is a bug the Thunderbird people deny exists and frustrates our admins because any time a change is written to an identity this flag is reset to true regardless of the state chosen in the gui menu.

Here are some more references:
http://www.howtogeek.com/howto/internet/setting-up-gmail-imap-support-in-thunderbird-2x/
http://lifehacker.com/software/geek-to-live/turn-thunderbird-into-the-ultimate-gmail-imap-client-314574.php
http://mail.google.com/support/bin/answer.py?hl=en&answer=78892
https://addons.mozilla.org/en-US/thunderbird/addon/6381
EDIT:

Here are some additional nice notes for gmail with thunderbird ( http://mail.google.com/support/bin/answer.py?answer=78892# ):
From the Tools menu, select Account Settings and highlight your Gmail address.

1. On the Server Settings tab:

Check for new messages at startup > checked
Check for new messages every 10 minutes > checked
[EDITOR NOTE] I recommend 15 minutes and I move our trash to the trash folder as setup in the first part of this post
When I delete a message > Mark it as deleted
Clean up (“Expunge”) Inbox on Exit > do NOT check
Empty Trash on Exit > do NOT check

2. On the Copies & Folders tab in the When sending messages, automatically section:

Place a copy in > do NOT check

3. On the Copies & Folders tab in the Drafts and Templates section:

Keep message drafts in > Other
Other > [Your Gmail address] > [Gmail] > Drafts

4. On the Junk Settings tab

Enable adaptive junk mail controls > do NOT check

5. Click OK to save and close your account settings.

If you’d like to to further enhance your IMAP experience, please carefully follow these additional steps:

In the ‘Tools’ menu, open Options.
On the ‘Advanced’ tab, open the General section.
Click the Config Editor button.
In the ‘Filter’ box, type ‘browser.cache.memory.capacity’
Double-click on the browser.cache.memory.capacity entry to edit its value.
Change the value to ‘30720’ and click OK.
Delete the text in the ‘Filter’ box and type ‘mail.server.default.fetch_by_chunks’
Double-click on the mail.server.default.fetch_by_chunks entry to set its value to false.
[EDITOR NOTE] I recommend searching for ‘fetch_by_chunks’ and changing all servers to false
Close the ‘about:config’ window and then close ‘Options’ by clicking OK.