Updating a local branch from the remote server
Answer:
Assume your local branch is cloned from a remote repository such as github, you might want to apply their updates to your branch from time to time.
To do so, try
# git pull
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Updating a local branch from the remote server
Answer:
Assume your local branch is cloned from a remote repository such as github, you might want to apply their updates to your branch from time to time.
To do so, try
# git pull
Calculating the max client in Nginx
Answer:
If you use Nginx as a web server, the max. number of client can be served at the same time by Nginx should be calculated by the following formula:
max_clients = worker_processes * worker_connections
But this does not equal to the number of users can be served at the same time by Nginx, since a lot of browsers open 2 connections to the web server at the same time.
List all git config options
Answer:
To show the current git global options, you can use the command "git config --list"
# git config --list
user.name=John Doe
[email protected]
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=auto
color.ui=true
color.pager=true
..
Check the amount of memory used by PHP
Answer:
To check the amount of memory used by PHP process, use the function - memory_get_usage
E.g.
// Returns the amount of memory, in bytes, that's currently being allocated to your PHP script.
echo memory_get_usage();
Update an existing document in MongoDB
Answer:
In an given collection, if you want to perform update on an existing document, the easiest way is to use the following commands.
employee = db.employees.findOne( { name : "Peter" } );
employee.position = "Project Manager";
db.employees.save( employee );
Done.