Wednesday, March 09, 2011

Hebrew (utf8) characters in mysql console over putty

Problem:

I have a mysql server running on a debian linux hosted at linode.com some of my data has hebrew characters (utf8) in it.

I am connecting to the server via putty ssh on windows 7.

But when I run the sql admin console (mysql) and execute a select query all hebrew characters are displayed as '?'.

The data itself wass o.k. (I know this because it is also accessed via a web page where it displays just fine).

Solution:

Step 1. Start mysql with the --defautl-character-set=utf8

If you will now run a query it will properly display the hebrew (and even show it right to left). Only problem is that because of this tables get poorly formated and columns switch places when hebrew is displayed in some of them.

so:

Step 2. Go to the session settings of putty and check "Disable Bidirectional text display" under Terminal-Features.

This will now cause Hebrew to be displayed using Hebrew characters but from left to right. But at least to formatting of the results is readable.

I guess a fix for this could be to render the Unicode Character 'LEFT-TO-RIGHT MARK' (U+200E) before each " |" (Pipe) character that separates column results. I wander if this can be customized...




Monday, March 07, 2011

how to set up hot code replacement with tomcat and eclipse

Just so that I have this next time I need to do it.
And maybe you will also find this link helpful.

http://blog.theunical.com/ide-tools/eclipse/how-to-set-up-hot-code-replacement-with-tomcat-and-eclipse/

Sunday, February 13, 2011

Steps in installing a smaple Magento

This is a list of steps needed in the process of installing a sample magento site.

I will be assuming that you have WAMP / LAMP already installed.

  1. go to http://www.magentocommerce.com/download and download magento and the magento smaple data. (versions don't need to match - actually the sample data is from 2008 at the time of writing).
  2. deploy the content of the magento installation to a magentoVirtualRoot directory on you web server
  3. create an empty database (e.g. magento_db)
  4. add the files in the media folder from the sample data to those from the magento installation
  5. make sure you set up and required new hosts / DNS entries if such are needed.
  6. copy the sql text from the sample data into the sql tab of your mysql's phpadmin for the database you created on step 2 and execute it.
  7. ONLY AFTER STEP 5 IS DONE - go to your browser and surf to http://www.yourdomain.com/magentoVirtualRoot and complete the installation proccess.
  8. go to http://www.yourdomain.com/magentoVirtualRoot/admin or whatever url you assigned for the backend and go to system-index management and reindex all your data.
  9. go to the front end of you new smaple shop at http://www.yourdomain.com/magentoVirtualRoot and enjoy.
please not that some steps are not mandatory and some details might have been left out, if you think I left out something really important, feel free to comment.



Wednesday, December 22, 2010

Back To The Future (Why logins might fail on Google and others)

A few days ago I got a call from someone that asked for my help.


He said that he can not login into the management section of some site that he is using,
he said that he talked to the technical personal on that site and they said that the problem is not on their side and he also said that he can use his user name and password to login to that site from another machine.

The symptoms on his machine where such that after he entered his username and password he would be sent back to the login page. so I played with it for some time.
I looked for browser hijacking and odd network activity and found none. Eventually I found that if he does not check the "remember me" option he can login and there is no problem.
So I left him sort of happy that he can now use the said system.

The day after I got another call from him saying that now he can not login even to his Google account. I looked at the problem and the browser (IE) was saying that there was a network problem. ping to google works and telnet to port 80 also gave the expected results... Switched over to Google chrome and got a better error message: Redirect loop...

hmmm.... google to the rescue.

It turns out that the date on this machine was set to about 3 months in the future, causing any cookie that was set to a future time (based on the server time of course) to expire immediately.

I reset his machine's date and voila, everything was working.

so next time google does not work for you, make a note of the date and time.

Eyal

Thursday, December 09, 2010

Avoiding timeout during installation of magento

To avoid "Fatal error: Maximum execution time of" just set "max_input_time" in your php.ini,

personally I changed it from 60 (which caused a timeout) to 240 (which worked great).

 
Clicky Web Analytics