Maintain the repository using Git

Refer to the thoughbot’s guide,

From these two articles, We can know how to manager the repository using gig and the ways he maintains the repository. I paste all the content of his article below.

While one thing has to be paid attention to:

1 The adding or modifing on config file like config.js would be ignored. Check the file with
nano .gitigore
to see if it’s tracked and ignored.
2 Or
git add config.js -f
to add the files needed to commit.
3 when running
git commit –verbose
to track all the updates. The listed commit have to be uncomment, like
Changes to be committed:
modified: app.js

otherwise, changes won’t be executed.

Write a Feature

Create a local feature branch based off master.

git checkout master
git pull
git checkout -b
Rebase frequently to incorporate upstream changes.

git fetch origin
git rebase origin/master
Resolve conflicts. When feature is complete and tests pass, stage the changes.

git add –all
When you’ve staged the changes, commit them.

git status
git commit –verbose
Write a good commit message. Example format:

Present-tense summary under 50 characters

* More information about commit (under 72 characters).
* More information about commit (under 72 characters).
If you’ve created more than one commit, use git rebase interactively to squash them into cohesive commits with good messages:

git rebase -i origin/master
Share your branch.

git push origin
Submit a GitHub pull request.

Ask for a code review in the project’s chat room.

Review Code

A team member other than the author reviews the pull request. They follow Code Review guidelines to avoid miscommunication.

They make comments and ask questions directly on lines of code in the GitHub web interface or in the project’s chat room.

For changes which they can make themselves, they check out the branch.

git checkout
git diff staging/master..HEAD
They make small changes right in the branch, test the feature on their machine, run tests, commit, and push.

When satisfied, they comment on the pull request Ready to merge.


Rebase interactively. Squash commits like “Fix whitespace” into one or a small number of valuable commit(s). Edit commit messages to reveal intent. Run tests.

git fetch origin
git rebase -i origin/master
Force push your branch. This allows GitHub to automatically close your pull request and mark it as merged when your commit(s) are pushed to master. It also makes it possible to find the pull request that brought in your changes.

git push –force-with-lease origin
View a list of new commits. View changed files. Merge branch into master.

git log origin/master..
git diff –stat origin/master
git checkout master
git merge –ff-only
git push
Delete your remote feature branch.

git push origin –delete
Delete your local feature branch.

git branch –delete


Network problem on the server

I use Asus notebook as the server installed with Ubuntu and ThinkPad with windows as workstation. SecureCRT is used to connect the server with the workstation. Since I want to have the static IP on the server, I have to modify the network config files on nano /etc/network/interfaces. Like the ones below.
Initially, it works. Server can maintain the static IP while days later, while network on server does not work very well. It is offline occasionally. Weird things happen, I ping the server on workstation, remote host reachable. And I can connect the server with secureCRT on workstation and visit server through ftp. while occasionally errors happen. While I ping the workstation from the server, result is that remote host unreachable. I restart the network with commands like

sudo /etc/network/init.d restart
sudo service network-manager restart
sudo ifconfig eth0 down && ifonfig eth0 up

problems remains. And the server seems become unstable and it develope to the situation that network interrupts thorougly. Then I have to comments all the configuration on the config file. Everything works properly. And the IP remains static booting everytime. I search on internet while I can not find the answer.

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
#auto eth0
#iface eth0 inet static
# address
# netmask
# gateway
# broadcast
# dns-nameservers

#wireless network
# auto wlan0
# iface wlan0 inet static
# netmask
# gateway
# address
# pre-up link set wlan0 up

Looking for an English teacher in Canton city(guangzhou)

I have been back to my home in Canton from for almost two months. Since I am so regret that we could not stay longer in Finland to let my kid to continue to attend the English kindergarten in Finland which my kid likes so much, I would like him to learn Foreign language in canton city. But he dislike the kindergarten here so much because he doesn’t like the education and environment of the school here at all and unwilling to go. Then I would like to set up an English club for him. But the biggest problem now is that I coudl not find the suitable teacher.

Are you a Native English speaker? Would you like to join me to set up this English club for the kids!


The system doesn’t response the link from the validate url, and no user has sign up as validate user. And from the code, I do not know which account name and password can be used as admin (actually not admin). Then I think that I should modify the property in the mongodb to change the property of active from false to true. Then the system will be deceived and consider the login name as a validate account.

Open the shell of mongodb:
sudo mongo

help command to see the executable comand:

show dbs show database names
show collections show collections in current database

use set current database list objects in collection foo

in this project:
use node_club_dev

Then it shows all the records in collection users.

If execute the command:
db.users.findAndModify({query:{“loginname”:”admin”},update:{“receive_at_mail” : true, “receive_reply_mail” : true, “active”:true},upsert: false})

It will produce errors:
Error: findAndModifyFailed failed: {
“errmsg” : “exception: E11000 duplicate key error index: node_club_dev.users.$loginname_1 dup key: { : null }”,
“code” : 11000,
“ok” : 0
at Error ()
at DBCollection.findAndModify (src/mongo/shell/collection.js:636:15)
at (shell):1:10 at src/mongo/shell/collection.js:636

Saying that duplicate key error.
So change to
db.users.findAndModify({query:{“loginname”:”admin”},update:{ “email” : “”,”loginname”:”admin”,”active”:true}})

Adding the loggin name to the modify field, then error disappear, and the property changed.


mail.js in common folder is used to send the validate email. After registering the user account or login in the system, system will send a verify email to validate the email. But the destiny mailbox can not recieve any validate email from the system.

And the console of the server print the below error information:
{ [Error: read ECONNRESET]
errno: ‘ECONNRESET’,
syscall: ‘read’,
stage: ‘data’ }
errors happens!

The messages should come from
console.log(‘errors happens!’);

in function of
transport.sendMail(data, function (err)
in the file of

I solve the problem in the following steps:
1 google the error, seems that is relates to dns problem,
ping and the smtp
it can reach the destination.
Then I change the DNS server from to another applicable DNS server.
But errors still exist.
2 Check the config file:config.js
correct the errors, and try many other smtp server, problem still exists.
3 google it, saying that smtp server has to be connected with special access code. Then I Register it and got the authorized code and password. Then modify the config file.

Then the system can send the validate email properly. But when linking the url to verify the email, server does not response.

Note: Sometimes, the server occasionaly occurs the ping promble, occasionaly, it can get through and and even can not reach the router and the workstation on the same network while it can be visited by ftp and ssh with other work station. So strange!

CNnode club

Cn nodeclub project has started since last year in Finland. At that time, it can run on the ubuntu server and visited by browser with :3000
But it yet was not able to have posts on.
Now go on this project at the stage, before I find a job or maybe after getting a job then as a part time interest.

Notice that following the structions to install node,the packages needed and redis-server and mongodb. Errors still exists and node can not run properly.

The method solving the problems is to reinstall all the rely packages with npm, install a lower version of node, such as v0.10.40 with nvm. Then it works. As I know, at least v0.12.6 deosn’t work properly.

Steps to start the program:
1 start redis-server:
sudo redis-server
2 start mangodb
sudo mangod
3 list the existing node version:
nvm ls
4 use the proper version of node:
nvm use v0.10.40
5 start the program
node app.js

NodeClub listening on port 3000
God bless love….
You can debug your app with

ftp server set up in Ubuntu with upload funtion

I continue to use my Ausus x45v notebook as server and write codes on my IBM notebook. Then problems come out: how can I share the file. Easy, set up the ftp. server to share the file.

vsftpd is a easy tool to set up the ftp server in Ubuntu. It is easy to find the official documents from the help of

To install the ftp server:
sudo apt-get install vsftpd

To set the ftp directory /federer for sharing:
sudo usermod -d /federer ftp

edit and set the configuration file:
sudo nano /etc/vsftpd.conf:

To make the ftp server writable:

Then restart to make the config file effective:
sudo restart vsftpd

Ftp server can be visited, But uploading function is prohibit.

Following the guide below, Adding some security users deosn’t work either.

How to setup FTP server on ubuntu 14.04 ( VSFTPD )

Problem still exists.

At last, I solve the problem by doing this:
sudo chmod a-w /federer

The reason is that, property of folder /federer is read only!
It has to be changed to writable first!

Note, the commands for adding ftp users:
sudo useradd -d /home/ftp -M ftpuser
sudo passwd ftpuser