This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(Base) { | |
| Base.beforeCreate = function (next, data) | |
| { | |
| this.created = new Date(); | |
| this.modified = new Date(); | |
| next(); | |
| }; | |
| Base.beforeSave = function (next, data) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "clean up start >>>>>>>>>>>>>>>>>>>>>>" | |
| clear | |
| df -h | |
| echo "clean desktop..." | |
| rm -rf ~/Desktop/* | |
| echo "clean download..." | |
| rm -rf ~/Downloads/* | |
| echo "clean trashcan..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void doShareToFacebook(View view){ | |
| Log.d(TAG, "share to facebook"); | |
| final Session.NewPermissionsRequest newPermissionsRequest = new Session | |
| .NewPermissionsRequest(this, Arrays.asList("publish_actions")); | |
| if(Session.getActiveSession()!=null){ | |
| Session session = Session.getActiveSession(); | |
| shareToFacebook(session.getAccessToken()); | |
| }else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Replica set : | |
| P1 : ( Primary ) | |
| S1 : ( Sec 1 ) | |
| A2 : ( Arbiter ) | |
| 1. start mongo with replica in all instance | |
| stop iptables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vi /etc/hosts | |
| add host name before localhost | |
| XXX localhost | |
| vi /etc/sysconfig/network | |
| change HOSTNAME=XXX | |
| hostname XXX | |
| re-login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vi /etc/network/interface | |
| vi /etc/hostname | |
| vi /etc/hosts | |
| apt-get update | |
| apt-get dist-upgrade | |
| apt-get install -y curl g++ make subversion php5-cli php-pear libcurl3 libcurl3-dev | |
| wget http://pear.php.net/go-pear.phar | |
| php go-pear.phar | |
| pecl install mongo | |
| echo "extension=mongo.so" >> /etc/php5/cli/php.ini |