Feeds:
Posts
Comments

Vista SP2 has a Service Pack Cleanup Tool in the C:\Windows\System32 directory called COMPCLN.exe. Incase of SP1 you can use, VSP1CLN.exe

You can start the program by using the following instructions:

  • Click Start > Run
  • Type in CMD and press [enter]
  • At the command prompt, type COMPCLN and press [enter]
  • Press Y when prompted to continue (the application will now start cleaning up the old files)

The size of the WinSXS folder (and others as well) should now have been reduced.

Incase of Windows 7;

  • Open My Computer,
  • Right Click on The Windows System Drive and Click on Properties
  • Then From The Properties Dialog Click On “DisK Cleanup” in General Tab.
  • Wait for a while to Open The “DisK Cleanup” Dialog.
  • Now Here it has a Option On Lower Left “Clean up system files”.Click on it.
  • “DisK Cleanup” Dialog will Re-Open. Now you will find “Service File Backup Files” in “Files to Delete” Box. Just Tick It Out and click Ok.
  • A Conformation Pop-Up Will Open, Click “Delete Files” to Proceed.

 

Cause:

  •     MySQL reserves 4 bytes per UTF8 character.
  •     MyISAM allows keys of max. length 1000 bytes.
  •     UTF8 VARCHAR(255) will require 255 * 4 = 1020 bytes

Solutions:

There are several solutions for this issue:

  •     Changing the size of some columns. For example, if VARCHAR(300) is used to store last names, you can reduce its size to 100 with minimal risk of data loss.
  •     Specifying the partial column length for the character columns in the key. For example, for VARCHAR(1000) column, you can specify only 100 characters to be used in the key.
  •     Changing the charset from utf8 to something else if it suits you.

The best solution would be to reduce the column(the field/fields which we index) size(total size) to fall within 1000 bytes (reducing the size).

If you have changed the default cache path in Rails, then you need to make the updates in apche config as well.

The example config for ‘public/cache/’ dir;

  1. RewriteRule ^$ index.html [QSA]
  2. RewriteRule ^([^.]+)$ $1.html [QSA]
  3. # This directive will look in public/cache/ for cached files
  4. RewriteCond %{REQUEST_FILENAME} !-f
  5. RewriteRule !^cache/(.*) - [C]
  6. RewriteRule ^(.*)$ cache/$1 [QSA]
  7. # If nothing is found, send to rails
  8. RewriteCond %{REQUEST_FILENAME} !-f
  9. RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

In config/environment.rb, change the page cache directory from the default by adding the following line inside the Rails::Initializer.run block.

config.action_controller.page_cache_directory = RAILS_ROOT+”/public/cache/” Also make sure you change the rewrite rules in the webserver configuration. For Apache (public/.htaccess) the first two rules probably need to be changed to:

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
# This directive will look in public/cache/ for cached files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !^cache/(.*) – [C]
RewriteRule ^(.*)$ cache/$1 [QSA]
# If nothing is found, send to rails
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Try the following;

rake environment RAILS_ENV=production db:migrate

instead of just;

rake db:migrate

Need to give dump file an actual name.

“mysqldump -u root -hlo calhost -p password –all-databases >%homepath%\Desktop\backup.sql

opposed to:

“mysqldump -u root -h localhost -p password –all-databases >%homepath%\Desktop”.

To get the 2 items;

SELECT DISTINCT value FROM Table ORDER BY value DESC LIMIT 2

To get the second largest value of a column;

SELECT MIN(value) FROM (SELECT DISTINCT value FROM Table ORDER BY value DESC LIMIT 2) AS t

Please share i you know of  any other better way.

Google Webmaster is a free tool which is very useful for SEO trouble shooting.

It’s very easy to set up, you just need to verify that you’re the site owner (there are a number of ways to do this, so just use the one that is best for you) and later you’ll have complete access to improve your website and your search engine optimisation (SEO).

It gives the following detailed info about our site;

1. Crawl Stats

Crawl Stats give you information in Google’s crawling activity for the last 90 day period. When you click into this report which is located in Diagnostics, you’ll see three reports:

Pages crawled per day: Overall, it’s a good sign to see this graph going up. Whilst there are peaks and troughs, you’ll be able to see if there is a steady incline, decline or no change at all. Spikes in this report are often due to the introduction of new pages or an increase in inbound links.

Kilobytes crawled per day: This graph should bear some resemblance to the Pages crawled per day graph in terms of the peaks and troughs in the graph.

Time spent downloading a page: This graph will be different from the above two and is likely (hopefully) to not show as many peaks. Peaks on this graph could be a server problem as in the norm, Google should not take very long downloading your pages.

These stats are useful for diagnosing problems and gauging performance issues.

2. Not Found Errors

Not found crawl errors are very useful for usability & SEO. If customers are browsing around your site and finding that links are not taking them anywhere, they’re likely to get annoyed and go elsewhere. This tool (which is accessed on the top right of the dashboard) will identify all not found URLs in your site. Be aware, that this can sometimes be slightly outdated, and Google state:

If you don’t recognize these URLs and/or don’t think they should be accessible, you can safely ignore these errors. If, however, you see URLs listed in the ‘Not found’ section that you recognize and would like crawled, we hope you find the ‘Details’ column helpful in identifying and fixing the errors.

So don’t dwell too much on getting this down to 0 errors in GWT, just use the information to improve site usability.

As well as links from within your site that are leading to a 404, this will also show you links from outside sites that are leading to a 404. This aspect is particularly valuable for SEO. Use this feature in GWT to do is identify the linked to pages within your site that no longer exist and redirect those pages to a real page within your site. This tactic will lead to increased link juice and increased visitors.

3. Meta Descriptions and Title Tags

Google Webmaster Tools will provide you with a list of URLs that have problems in their title tags or Meta descriptions, this list will include duplicates as well as incidences of titles or Meta descriptions that are too long or too short. Go into Diagnostics and HTML suggestions to find this information. Duplicate meta titles, especially can affect your rankings within Google and meta descriptions should be snappy and targeted to each specific page to help CTR of each page on your site.

4. Top Search Queries

Whilst you can get your top search queries out of Google Analytics or whatever analytics tool you use, I particularly like the Webmaster Tools version for the simple reason that it shows your average position within Google as part of the data. This enables you to look at your top search terms by position. The reason this is helpful is that when deciding which keywords to push, I particularly like to focus on the keywords that are currently in positions 2-4 as increases in positions at this level will have the most increased in traffic.

5. Site Links

If your site had a list of links below its Google listing, you can use the sitelink section within Site Configuration to control the links that are shown. You can’t actually tell Google which links to show, but you can block links that you don’t want to be shown.

These are just a few of the many tools available in Google Webmaster Tools and Google often add new features to this great tool. Try all of them and make use of it.

We can use “DISTINCT” keyword with ‘count’ to acheive this;

select index, count(DISTINCT number) from <table> group by index;

User.count(field, :group => [:name], :conditions => {:active => true})

To get distinct count; pass  ":distinct => true"

« Newer Posts - Older Posts »