Tuesday, April 15, 2014

Device name code in AOSP building system

Sometimes it's confusing trying to map the device name code to the corresponding hardware. I put the code and device name map here to make it easier to keep track of the supported hardware by Android.

ModuleCode
Nexus 5"hammerhead"
Nexus 7 [2013] (Wi-Fi)"flo"
Nexus 7 [2013] (Mobile)"deb"
Nexus 10"manta"
Nexus 4"mako"
Nexus 7 (Wi-Fi)"grouper"
Nexus 7 (Mobile)"tilapia"
Galaxy Nexus (GSM/HSPA+)"maguro"
Galaxy Nexus (Verizon)"toro"
Nexus S"crespo"
Nexus S 4G"crespo4g"
Motorola Xoom (US Wi-Fi)"wingray"

Apache2 + Tomcat 8 to host website

Just a memo for the steps I took to host my website on Amazon EC2 using tomcat 8 + apache2.

Install and config tomcat 

Put your website code to TOMCAT/webapps

Domain setup in tomcat

Edit TOMCAT/conf/server.xml, add a new host entry:

    
 
        www.rungist.com

        
        


Config proxy port in server.xml

   

Then restart tomcat

Install and config apache2

Use apt-get install apache2 to install the http server.
Config ProxyPass entry on /etc/apache2/httpd.conf
 
ProxyPass         /  http://rungist.com:8080/
ProxyPassReverse  /  http://rungist.com:8080/

Then restart apache2 service: sudo service apache2 restart

Refer:

https://tomcat.apache.org/tomcat-7.0-doc/proxy-howto.html

Monday, April 14, 2014

Remove ec2-user default privilege


  1. useradd to add a new user account
  2. Create password for the new user, add it to the sudoer list
  3. Enable PasswordAuthentication in /etc/ssh/sshd_conifg
  4. Change root password
  5. Lock ec2-user: passwd -l ec2-user
  6. Delete /etc/sudoers.d/xx
  7. Now the ec2-user has no root permission

Reference:
http://blog.braini.ac/?p=73

Ruby, Rails, RVM and me!

Thanks to Radar's blog about using RVM to install ruby instead of installing ruby as a package.

Following is the debug info for android-marketplace-crawler.
  1. Errors found in the Utils.java file when loading permissions.
     
    java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at com.marketplace.Main.execute(Unknown Source)
        at com.marketplace.Main.resolveArgs(Unknown Source)
        at com.marketplace.Main.main(Unknown Source)
    Caused by: java.lang.ExceptionInInitializerError
        at com.marketplace.io.Sender$AppQuery.toString(Unknown Source)
        at com.marketplace.io.Sender.appExists(Unknown Source)
        at com.marketplace.io.Sender.addAppToCollection(Unknown Source)
        at com.marketplace.service.CategoryThread.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at com.marketplace.Utils$Permission.<init>(Unknown Source)
        at com.marketplace.Utils.<clinit>(Unknown Source)
        ... 10 more
    
    This error is caused by the empty line at the end of the file "permission"
  2. This error came when create items in table
    undefined method 'class_inheritable_accessor'
    
    The error occurs because of the deprecated function in rails. Here is the solution to this problem: https://github.com/wvanbergen/request-log-analyzer/issues/103

My Linux Workstation Software List


Here is the list of OS that I have used and using:

  • Ubuntu 12.04
  • CentOS 5.6
  • Federo 14
This the list of software I use for daily work/study on these Linux system.

  1. Google Docs
  2. GIMP Image Editor
  3. Sublime Text http://www.sublimetext.com/2
  4. Vim Text Editor
Development Tool Kits:
  1. Eclipse Kepler + WTP + ADT
  2. GIT