Wednesday, April 18, 2012

How to install PhpDocumentor on lampp (xampp on Ubuntu)

1. open terminal and run the command (we are installing phpdocs version 2.0.0a2)
sudo /opt/lampp/bin/pear install channel:pear.phpdoc.org/phpDocumentor-2.0.0a2

2. add lampp bin to $PATH variable so that phpdoc can be called from anywhere
echo 'export PATH=$PATH:/opt/lampp/bin/' >> ~/.profile

3. reload the .profile
. ~/.profile

4. Test by running the phpdoc on the terminal.
phpdoc


References:

Saturday, May 14, 2011

How to log queries in MySql (Mysql 5.1.4)

This article based is based on:
MySql version: 5.1.4 (logging on a file)
OS: Ubuntu 10.04
Stack: lampp
note: Mysql version 5.1.6 and above support logging on file and table[2].

There are 2 methods:

Method 1: Enable logging on run time
1. Enter mysql prompt
mysql -u root -p
2. Enable logging
mysql> SET GLOBAL general_log = 'ON'

3. Find out the default mysql log file
mysql> show variables like '%log_file';
+---------------------+--------------------------------------------+
| Variable_name | Value |
+---------------------+--------------------------------------------+
| general_log_file | /opt/lampp/var/mysql/ruby-desktop.log |
| slow_query_log_file | /opt/lampp/var/mysql/ruby-desktop-slow.log |
+---------------------+--------------------------------------------+
4. View the log on a terminal
sudo tail -f /opt/lampp/var/mysql/ruby-desktop.log

Method 2: Enable logging in my.cnf
1. edit my.cnf
sudo vim /opt/lampp/etc/my.cnf
2. enable logging, under [mysqld] section of the file.
# The MySQL server
[mysqld]
general_log = 1
3. Find out the default mysql log file. (inside mysql terminal type the following)

mysql> show variables like '%log_file';
+---------------------+--------------------------------------------+
| Variable_name | Value |
+---------------------+--------------------------------------------+
| general_log_file | /opt/lampp/var/mysql/ruby-desktop.log |
| slow_query_log_file | /opt/lampp/var/mysql/ruby-desktop-slow.log |
+---------------------+--------------------------------------------+

4. view the log on a terminal
sudo tail -f /opt/lampp/var/mysql/ruby-desktop.log

Reference documents:
1. logging in file / table (based on MySQL version ) (mysql >= 5.1.6) (you can view the output in mysql query browser too.)
http://lserinol.blogspot.com/2009/02/mysql-general-query-log.html

2. logging variables
http://bugs.mysql.com/bug.php?id=32748

3. The General Query log (always check the documentation for the mysql version installed in your system )
http://dev.mysql.com/doc/refman/5.1/en/query-log.html

4. Logging queries with MySQL
http://www.electrictoolbox.com/logging-queries-with-mysql/

Monday, February 21, 2011

How to reboot in safe mode inside Virtualbox?

Guest: Windows XP.

In Virtualbox, when you have Windows XP as guest os and you need to reboot in safemode MSconfig utility gives you an option.


  1. Start Msconfig (Run > msconfig)
  2. Select the 'BOOT.INI' tab.
  3. Check the '/SAFEBOOT' option under 'Boot Options'.
  4. Apply > Ok and reboot.
Un-check the option to boot normally.

Hope that was useful.

Thursday, November 18, 2010

Git support for Netbeans

Git support for Netbeans
http://nbgit.org/
NbGit is a module for the NetBeans IDE that adds support for working with the Git version control system.

Wednesday, November 10, 2010

PHP Exceptions

PHP Exception
http://www.w3schools.com/php/php_exception.asp

Tuesday, November 9, 2010

Where is the mysql data folder in lampp?

In lampp (xampp for linux) version 1.7.3a mysql data folder is at:
/opt/lampp/var/mysql

Tuesday, July 7, 2009

Simply Scheme (CS) book goes online, Cassandra DB

Goto in php
http://php.net/manual/en/control-structures.goto.php

Goto in javascript
http://www.summerofgoto.com/

books: Simply Scheme - Introducing Computer Science
http://www.cs.berkeley.edu/~bh/ss-toc2.html

Up and running with Cassandra (bigtable like distributed database)
http://blog.evanweaver.com/articles/2009/07/06/up-and-running-with-cassandra/