Tuesday, April 24, 2012

Transaction using yii CDbTransaction

As for my reference and note,
CDbConnection::beginTransaction

$transaction=$connection->beginTransaction();
try
{

   $connection->createCommand($sql1)->execute();
   $connection->createCommand($sql2)->execute();
   //.... other SQL executions
   $transaction->commit();
}
catch(Exception $e)
{
   $transaction->rollBack();
}

Thursday, April 12, 2012

Netbean 7.1.1 problem

1). When create a project finding the Netbean will create a folder (nbproject)
2). make sure to remove when you remove a project from your Netbeans workspace (using the IDE), Netbeans allow you to remove the project without delete the sources. So, when it's done, you must delete the "nbproject" directory that was created inside your source project.

otherwise will get error when try to create new project (from existing source) in the same diretory, Netbean will show this error : 
"Sources directory is already Netbeans project (maybe only in memory)"

so make sure to delete folder "nbproject" in your application diretory.

Xampp 1.7.7, step to enable ldap module

Lately, i am into php and trying to use xampp 1.7.7.
When using ldap extension got error trying to start :-

1) edit file httpd.conf , enable the : LoadModule ldap_module modules/mod_ldap.so (OK)
2) when i enabled the extension in php.ini : error could not load module ldap.dll. When checked ldap.dll exists in the /ext.

So, try again restart xampp and got different error : unable to load  libsasl.dll
solution :-
3) copy libassl.dll to xampp\apache\bin\ (start again xampp and OK)

now i can call ldap_connect from php

Sunday, February 5, 2012

How to auto login Ubuntu 11.10

Go to System Setting->User Accounts
Click Unlock and keyin password, under Login Option set Automatic Login 'On'
Click Lock again to prevent any further changes.


Wednesday, February 1, 2012

Edit Host File In Ubuntu

$sudo gedit /etc/hosts

//format <IP><hostname>
in hosts file enter


10.8.26.35 cipan

then save the file

$ping cipan
//to test host file


Edit text File in Ubuntu

$ sudo gedit Filename

This will open text editor in Ubuntu
Ubuntu 11.10

Thursday, January 19, 2012

Using Synergy sharing keyboard and mouse (windows & ubuntu)


Server : windows7
Client : Ubuntu 11.10

1. On Server site installed synergy 1.3.8 and run launcher.exe
2. On Client site :- ubuntu:~$ sudo synergyc -d DEBUG1 -f 10.0.0.1:25000
                                           or
                                              $ sudo synergyc -d <level> -f <IP:Port>
                                           or sample syntax as (using default port)
                                              $ sudo synergyc 10.8.22.23

Ubuntu command run on terminal still does not automatic startup.
Default port for synergy is 24800