Wednesday, April 8, 2015

400 Bad Request when commit to SVN

Dear all,

Sometime you see me, I am "400 Bad Request" when you commit code to your svn host.

This error have 2 problems:
1. Maybe your svn version (version of application) is old. You need update and compare version your application and version of svn in your server.
2. Your administrator svn hosting was configured is wrong.

Please ref to this blog code in file "/etc/apache2/mods-enable/dav_svn.conf"

<Location /svn>
     DAV svn
     SVNParentPath /home/svn
     SVNListParentPath On
    # SVNPath /home/svn
     SVNAdvertiseV2Protocol off
     AuthType Basic
     AuthName "subversion repository"
     AuthUserFile /etc/subversion/passwd
     Require valid-user
        <LimitExcept GET PROPFIND OPTIONS REPORT>
       Require valid-user
     </LimitExcept>

  </Location>

You need add more red line "SVNAdvertiseV2Protocal off" if you see it is not exist.
Then you restart apache "sudo service apache2 restart"

-- Thank you for viewing this post --

Thursday, July 10, 2014

Error "No bean named 'cacheManager' is defined" in spring

Fix this bug please go to WEB-INF/spring/root-context.xml

Please check
xmlns:cache="http://www.springframework.org/schema/cache"
You must have above line.

And next
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd"

You must change
http://www.springframework.org/schema/cache/spring-cache.xsd
to
http://www.springframework.org/schema/cache/spring-cache-3.1.xsd

Now let run

Friday, June 20, 2014

Error mongo db lock, (fix error mongo db turn off when turn off terminal)

Step 1: Remove lock file.
sudo rm /var/lib/mongodb/mongod.lock 

Step 2: Repair mongodb.
mongod --repair 

Step 3: start mongodb.
sudo start mongodb 
 or
sudo service mongodb start 

Step 4: Check status of mongodb.
sudo status mongodb 
 or
sudo service mongodb status 

Step 5: Start mongo console.
mongo

Thursday, June 12, 2014

Install php_mongo In Ubuntu

This is some command line to install mongo db in Ubuntu

Install pear and php5-dev
sudo apt-get install php-pear php5-dev

Install mongo db
sudo pecl install mongo

Go to /etc/php5/mods-available
Create file mongo.ini
vi /etc/php5/mods-available/mongo.ini
Add this line
extension=mongo.so
(You can check *.so in folder /usr/lib/php ...

Go to /etc/php5/conf.d
ln -s ../../mods-available/mongo.ini

Restart web server apache2
Go luck to you


Tuesday, May 27, 2014

Upgrade new version of Phalcon

Install pcre if you do not have.
apt-get install libpcre3-dev

Download new version of phalcon
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install

Check phalcon version
phalcon -version

Sunday, April 27, 2014

Some common command line in Ubuntu

INSTALL SVN 1.7
Update svn 1.7 for Ubuntue
sudo add-apt-repository 'deb http://opensource.wandisco.com/ubuntu lucid svn17'
sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -    
sudo apt-get update    
sudo apt-get install subversion

MAP DIR IN UBUNTU
sshfs#$USER@far:/projects /home/$USER/far_projects fuse defaults,idmap=user 0 0
$ sshfs  matt@my.randombox.com:  randombox_home
sshfs tien.nguyen@server: /server

CHANGE LOCAL WHEN USE SFTP
lcd /home/tien.nguyen/software

Add user for ssh (add user name for this file).
vi /etc/ssh/sshd_config

Restart SSH for enable new user
/etc/init.d/ssh restart

Add user to group admin
-- usermod -g admin tien.nguyen
usermod -a -g admin tien.nguyen

Add User in ubuntu
useradd -d /home/kevin -s /bin/bash -m kevin

Tuesday, April 15, 2014

Format code in blogspot

1. First, take backup of your blogger template
2. After that open your blogger template (In Edit HTML mode) & copy the all css given in this link before </b:skin> tag
3. Paste the followig code before </head> tag

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'></script>
4. Paste the following code before </body> tag.
<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>
5. Save Blogger Template. 6. Now syntax highlighting is ready to use you can use it with <pre></pre> tag.
<pre name="code">
...Your html-escaped code goes here...
</pre>

<pre name="code" class="php">
    echo "I like PHP";
</pre>
7. You can Escape your code here. 8. Here is list of supported language for <class> attribute.