Thursday, 29 January 2015

I can ping ip, but failed to ping hostname on redhat linux


  1. check DNS server configuration to see if there is a record for the server.
  2. check /etc/resolv.conf file to see if the DNS server is correct, and if there is a domain, 
    • search <domainName> (if there is no this line, need to check /etc/sysconfig/network-script/ifcfg-eth0 to see if there is a "DOMAIN=<domain server ip>" existed
    • nameserver <ipaddress>

Thursday, 22 January 2015

How to use findByIdAndUpdate on mongdb2.4

backbone client update a model property:
ocase.save({ currentStep : theStep },callback);
server side mongoose code :
OCase.findByIdAndUpdate(req.params.id,
        req.body, callback);
it works fine on mongodb2.6, but it doesn't work on mongodb2.4, and the error is :
update err:MongoError: exception: Mod on _id not allowed
so I tried to remove "_id",and only save other attributes:
OCase.findByIdAndUpdate(req.params.id,
            {subject    : req.body.subject,
            description : req.body.description    
        },callback);
then I got another error :
update err:TypeError: Cannot read property '_id' of undefined
I am really confused, what can I do now?
Finally, I have to query(findById) the document first, and then call "save" method to update.
OCase.findById(req.params.id,
        function(err,ocase){
            ocase.set(req.body);
            ocase.save(function(err,ocase){
                res.send(ocase);

            });
        });

com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=T0.TASK_MODE, DRIVER=3.65.77

com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=T0.TASK_MODE, DRIVER=3.65.77

=-==============================
Column "T0.TASK_MODE" is not existed.

Wednesday, 17 December 2014

Marionette region close doesn't work

MySpace.dialogRegion.close();

debug console :
 Uncaught TypeError: undefined is not a function

--
use empty() rather than close();

Thursday, 11 December 2014

Install Alfresco community edition 5c on Tomcat with MySql


  1. Setup MySql
    • mysql -u root -p
    • mysql>create database alfresco CHARACTER SET='utf8' COLLATE='utf8_bin';
    • mysql>create user alfresco identified by 'alfresco';
    • mysql>GRANT ALL privileges ON alfresco TO 'alfresco'@'localhost';
  2. Setup Tomcat
    • http://docs.alfresco.com/community/tasks/configfiles-change-path.html
  3. start application
    • http://docs.alfresco.com/community/tasks/alf-war-install.html
  4. login alfresco : http://localhost:8080/share   (admin/admin)

Tuesday, 9 December 2014

Uncaught TypeError: Cannot read property 'localStorage' of undefined

When I changed localstorage to backend services, I got this error :

Uncaught TypeError: Cannot read property 'localStorage' of undefined

so I commented the reference of localStorage, then it did work.

<!-- script src="http://cdnjs.cloudflare.com/ajax/libs/backbone-localstorage.js/1.0/backbone.localStorage-min.js" type="text/javascript"></script> -->