Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Oct 202011
 

Enable debug log for Nginx

Answer:

Sometimes, you need to enable the debug log feature on Nginx for troubleshooting some nasty issues.

Firstly, you need to make sure you have configured nginx to build with the debugging feature enabled

# ./configure --with-debug ...

If you are using the installing using apt-get on Ubuntu, you are ready to go by setting the following in the Nginx config:

...
error_log  /path/to/log  debug;
...

Don't forget to restart the Nginx to take effect.

Oct 072011
 

How to merge a branch back into trunk using SVN

Answer:

To merge a branch back into the trunk using SVN: (Assume your local corresponding folders are branch and trunk)

1. Get the revision number at which the branch was created

# cd branch
# svn log --stop-on-copy

2. Get the head revision number of your trunk

# cd trunk
# svn update

3. Merge in action

# cd trunk
# svn merge -r <BRANCH_CREATION_REVISION_NUMBER>:<HEAD_REVISION_NUMBER>
               http://example.com/svn/repos/demo/branches/<MY_BRANCH> .
Oct 052011
 

Exclude files when using the du to estimate disk usage

Answer:

It is easy to use du command to estimate disk usage, however, sometimes you want to ignore some files during the calculation.

To do so, try

# du -h --exclude='*.bak'

The above command will exclude all the file end with the extension .bak during the disk space calculation.

Oct 032011
 

Revert all local changes in SVN

Answer:

Too revert all local changes in your current SVN repository, you can run the following command

# svn st -q | awk '{print $2;}' | xargs svn revert

That is it.

Sep 302011
 

List all active guest domains in Xen

Answer:

To list all active guest domains in Xen, you can use the xm list command.

# xm list

Name                                ID  Mem(MiB)   VCPUs      State      Time(s)
Domain-0                            0     768       2         r-----     1029.3
Web-server                         12     256       1         -b----       13.7