Sunday, October 23, 2011

amChart Cache Issue

Add random parameter after the file path i.e. data.xml?<?php echo microtime();?>

Hope this helps to save your time.

Monday, October 17, 2011

Reading initial communication packet system error 34

I checked the configuration of MySQL in /etc/mysql/my.cnf and found that by default MySQL is bind with other ip address that I have.

This situation occurred when I tried to map my system with other ip-address.

If this does not work try below methods

1) Edit file "/etc/hosts.deny" and commented out the default access list rule as shown below.
# ALL:ALL

2) Next I included that statement in "/etc/hosts.allow" as shown below.
ALL:ALL or mysqld: 127.0.0.1 : ALLOW

Wednesday, October 12, 2011

Images not showing in IE

A very difficult problem with very simple solution.

When you run Internet Explorer, the Internet Explorer cache is not used as you expect when you run innerHTML code to insert the same image multiple times.

Here’s the problem: Internet Explorer forgets to look into its own cache when inserting HTML via JavaScript DOM manipulation (read: if you use img tags or any tags with CSS background images, Internet Explorer will always try to redownload these images).

To work around this problem, try following steps:
  1. Preload the image in a DIV element with the display:none attribute:
    <DIV style='display:none'><IMG SRC='image.gif'></DIV>
  2. Create a brief time-delay so that Internet Explorer has enough time to verify whether the image is in the cache, and then call the innerHTML property.
    setTimeout (function(){},2000);
Note: Make sure to add width and height of image otherwise it may display in very very small size like a dot.

Tuesday, August 30, 2011

Internet Explorer with Ubuntu 11.04

First you need to install wine to get it through:
sudo apt-get install wine

Steps to get Internet Explorer are:

1. Open winetricks (Applications->wine->Winetricks)
2. Choose the option, "Select the default wine prefix" (confusing to me since I don't know what a prefix is and it sounds like I'm doing something that will be the default for everything in wine)
3. Click "OK"
4. Choose option, "Install a Windows DLL or component"
5. Click "OK"
6. Now choose IE6, 7, or 8 from the list and check the checkbox
Note: Choose one option at a time as wine need to restart after each install.
7. Click "OK"

After installation it will ask for "restart", this will not restart your system but restart the "wine".

You also get some error messages, just click on OK.

From now on, if you need to run the installed program then go to Applications -> wine -> Browse C: Drive -> Program Files -> Internet Explorer -> Run "iexplore.exe" with "wine"

So, would you ever say that you can not run Internet Explorer on Linux? :)

Friday, August 26, 2011

Downgrade PHP


This post is all about downgrading your PHP 5.3.x to PHP 5.2 because some of your old packages will not work with the PHP 5.3.x.

Essentially, all you have to do is tell the apt system where to find Karmic packages and then tell it that you want it to use Karmic's PHP packages.

So put the "karmic.list" in /etc/apt/sources.list.d and the "php" into /etc/apt/preferences.d.

Then:
sudo apt-get update

sudo apt-get remove php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache

sudo apt-get install php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache

If you had not already installed apache, php, and mysql, you can do that with the above files in place and get the right versions without removing anything:

sudo apt-get install apache2 mysql-server php5 libapache2-mod-php5 php5-xsl php5-gd php-pear libapache2-mod-auth-mysql php5-mysql php5-curl php5-memcache

Note: Your php.ini will have been replace, so you have to reset custom settings like memory_limit.