Archives for 

How-To

How to fix: Google Earth crash on Ubuntu 10.04 Lucid Lynx

 I got the following error after executing Google Earth application on Ubunto 10.04 Lucid Lynx ubuntu@ubuntu:/opt/google-earth$ /usr/local/bin/googleearth Fatal error in __driConfigOptions line 1, column 0: unknown encoding. Google Earth has caught signal 6. We apologize for the inconvenience, but Google Earth has crashed. This is a bug in the program, and should never happen under […] Continue reading →

How to: dynamically add input field in form, using Javascript

 Recently I ran across this issue on a project. Whereas I need to employ a html textarea when needed (dynamic), plus the delete link. These is the Javascript part: function addElement(fieldType, fieldName, className, ctrl1, ctrl2) { var ni = document.getElementById(ctrl1); var numi = document.getElementById(ctrl2); var num = (document.getElementById(ctrl2).value -1)+ 2; numi.value = num; var divIdName […] Continue reading →

How to: install mod_geoip2 for Apache2 on CentOS server.

 mod_geoip2 is an Apache 2.x module for finding the country and city that a web request originated from. It uses the GeoIP library and database to perform the lookup. Steps: [*] Login via SSH as root to your server [*] Get the GeoIP C Library from MaxMind wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz Wait until finished –09:43:23– http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz Resolving […] Continue reading →

How to: Convert MySQL Hierarchical Data Flat List Result to Multi-Dimensional PHP Array

 Recently, for a fun stuff, I came across a need of an infinite level of categories. I stumbled upon Gijs Van Tulder‘s article of “Storing Hierarchical Data in a Database” at SitePoint. Based of Van Tulder article I’m experimenting on my localhost. Below is the contents of my ‘categories’ table: +—–+——-+——–+———-+——+——+ | id | title […] Continue reading →