Blogs
How to Create form in PHP based Drupal as a module?
Submitted by programmer on Thu, 07/05/2007 - 08:15.
::
<?phpfunction appointment_menu($may_cache) { $items = array(); $items[] = array(
How to find out slow queries in MYSQL to enhance and optimize them for peformance
Submitted by geekyguy on Tue, 06/26/2007 - 05:14.
::
Step by Step solution:
1. Go to /etc/rc.d/init.d/mysqld
2. Locate line: /usr/bin/mysqld_safe --defaults-file=/etc/my.cnf
3. Add option: --log-slow-queries="/var/log/slow-queries.log" to this line. Now the line becomes: /usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --log-slow-queries="/var/log/slow-queries.log"
4. Create an empty file: touch /var/log/slow-queries.log
5. Give permission: chmod 644 /var/log/slow-queries.log
6. Restart mysql
mysqld will log all slow queries to this file.
Drupal multiple sites installation: Tutorial
Submitted by geekyguy on Mon, 06/04/2007 - 07:45.
::
Often with your impressive Drupal installation, you would wish to run multiple sites on a single code base, each independent enough to look like an indepedent site and an independent domain name. As an example, look at the sites www.mplstutorial.com and www.programmingbulls.com installed on the same code base and single drupal installation.
Therefore, www.site1.com would become one site and www.site2.com would become another on a single Drupal installation.
Difference in Forward proxy and Reverse proxy
Submitted by pooni on Tue, 05/29/2007 - 12:20.
::
I came across this problem while reading the architecture of TIVOLI Access Management.Well, after discussing a while with people i found the correct difference between Forward Proxy and Reverse Proxy and the advantage of using them.
How to create a Social Networking Site like Orkut, MySpace using Open Source Drupal or Elgg?
Submitted by programmer on Mon, 05/28/2007 - 12:43.
::
I was evaluating to build a social networking site using open source stuff like Drupal, Elgg. Elgg provides out of the box functionality for a social networking site like Orkut, Hi5, Myspace, but Drupal is far more flexible. It seems Elgg is not tested and used as much as Drupal. I have been working on Drupal for a long time now and my faith on it has only increased, though, I had to make changes to the code and modules at times.
Debugging Drupal or any PHP Application with XDebug and Eclipse PDT
Submitted by programmer on Sun, 05/27/2007 - 19:53.
::
I have been coding in PHP and MYSQL using my favourite LAMPP for a long time now using VIM. And with the growing complexity of sysytems, it was becoming increasing difficult to keep up with VIM. I was working on Drupal and was writing, debugging few modules. I needed a debugger badly and then I stumbled upon Ecipse PDT. It took a while to set up, but once it was up, it was a power tool that I probably should have gotten earlier.
Eclipse Perl plugin too is cool and use it often to debug perl applications. Eclipse PHP plugin is known as PHP Development Tool (PDT).
javax.servlet.ServletException: javax/mail/MessagingException
Submitted by programmer on Mon, 05/21/2007 - 19:14.
::
got a runtime error:Internal Servlet Error:javax.servlet.ServletException: javax/mail/MessagingException at org.apache.jasper.servlet.JspServlet.service(Compiled Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
Warning: MySQL server has gone away query:INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname,
Submitted by pooni on Sat, 05/19/2007 - 19:55.
::
How to handle this error:
Warning: MySQL server has gone away query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp)
VALUES (1, 'php', '<em>MySQL server has gone away\nquery: UPDATE cache SET data =&#039;a:4....
in C:\xampp\htdocs\studentindia\includes\database.mysql.inc on line 172
Solution:
How to start or stop lampp or any other script on linux boot ?
Submitted by geekyguy on Fri, 05/18/2007 - 18:41.
::
If you want your lampp server to start automatically when the linux boots by accident or knowingly, create a following linux script and call it start_lampp.sh
#!/bin/bashservice httpd stop/opt/lampp/lampp restart
Copy start_lampp.sh to /etc/init.d/:
shell> cp start_lampp.sh /etc/init.d/
Give executable permissions:
shell> chmod +x /etc/init.d/start_lampp.sh
Create a symbolic link:
How to know your RAM on linux machine?
Submitted by geekyguy on Fri, 05/18/2007 - 18:03.
::
You can know the RAM on your linux machine using the command: cat /proc/meminfo
This would give the following output: