2015年8月26日 星期三

NDK build specific module

/PATH/TO/ndk-build APP_MODULES='name'

2015年8月5日 星期三

git & gerrit setup in Ubuntu

For gerrit install,
1. Download gerrit from http://gerrit-releases.storage.googleapis.com/index.html
    I choose gerrit-2.11.2.war
2. Create mySQL for gerrit
    a. mysql -u root -p PASSWD
    b.Create a Gerrit specific user within the database and assign it a password,  create a database, and give the user full rights:
"CREATE USER 'gerrit2'@'localhost' IDENTIFIED BY 'secret';"
"CREATE DATABASE reviewdb;"
"ALTER DATABASE reviewdb charset=latin1;"
"GRANT ALL ON reviewdb.* TO 'gerrit2'@'localhost';"
"FLUSH PRIVILEGES;"
3. Install gerrit
 java -jar gerrit-2.11.2.war init -d /GERRIT/INSTALL/PATH

4. Choose HTTP as authentication method and set rest as default
5. Install apache2
6. Create a virtual host with the following httpd.conf under  /etc/apache2/sites-available and create a symlink to /etc/apache2/sites-enabled
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

<VirtualHost *:8082>
  ServerName localhost
  ProxyRequests Off
  ProxyVia Off
  ProxyPreserveHost On
  DocumentRoot /var/www/html

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  <Location /login/>
    AuthType Basic
    AuthName "Gerrit Code Review"
    AuthBasicProvider file
    AuthUserFile /home/gerrit2/review_gerrit/etc/gerrit.htpasswd
    Require valid-user
    Order Deny,Allow
    Allow from all
  </Location>

  AllowEncodedSlashes On
  ProxyPass / http://SITESURL:6267/ nocanon
</VirtualHost>
 7. Create HTTP basic auth user/passwd file, later you won't need -c flag.(-c: create)
sudo htpasswd -c /home/gerrit2/review_gerrit/etc/gerrit.htpasswd UserName
8. My final gerrit.config is as following
[gerrit]
    basePath = git
    canonicalWebUrl = http://SITESURL:6267
[database]
    type = mysql
    hostname = localhost
    database = reviewdb
    username = gerrit2
[index]
    type = LUCENE
[auth]
    type = HTTP
    loginUrl = http://SITESURL:8082/login/
[sendemail]
    smtpServer = localhost
[container]
    user = gerrit2
    javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
[sshd]
    listenAddress = *:29418
[httpd]
    listenUrl = http://SITESURL:6267/
[cache]
    directory = cache
[plugins]
    allowRemoteAdmin = true
9. Link to http://SITESURL:6267 and it will pop up a dialogue, fill in the username and passwd just create with htpasswd and change the settings in gerrit webUI. For example, paste your ssh public key and change your full name