Thursday, 23 November 2017

Remote Medical Monitor

Designed a solution for remote medical monitor, including an IoT device, AWS IoT broker and server and an iOS mobile App. The solution got best commercial solution award in Renesas GR Peach Design Contest in 2017.

Technical Stack:
  • iOS Objective-C Programming
  • AWS IoT, DynamoDB, Lambda Micro Service
  • Secure Communication
  • SMS and notification

Presentation:
https://drive.google.com/file/d/1hZm-E19pKQWo79rpMJPWkq-B6AZyRC8x/view?usp=sharing


Video Clips:




Tuesday, 26 September 2017

Software TEE - Virtual Car Key

This is an App for our IoT solution to serve our valuable customers (Valeo). You can upload your TA (a file with some configurations) to our backend server, After then they can download the TA and run it.

You can use this app to lock and unlock the car, door with our smart lock, you can even start and stop the car engine, depending on the TA you uploaded to our backend server.

To be able to operate it with our smart lock, you need to “Install TA” first, then you can “Run TA”, if you have our smart lock, you should be enabled to do the operation as you configured in the TA on our server.

Technical Stack:
  • Android Java Programming
  • iOS Objective-C Programming
  • Native C programming
  • WhiteBox Crypto with Key Rotation for every 3 months
  • Secure Channel Protocol
  • App Protection: Anti-tampering, Anti-debug, Anti-hooking, Root/Jailbreak detection, Android App re-signing detection.
Experience:
  • Built CI/CD pipelines with Jenkins, up to 10 customized deliverables for different customers. 
  • Created a Python script to generate certificate public key hash for certificate pinning. 
  • Implemented the mechanism to renew the White-Box keys for every 2-3 months. 
  • Worked with server team to improve the network performance by reducing the commands from the server. 
  • Worked with external labs (UL and APPLUS) and internal lab to do pen-testing for the application. 
  • Fixed memory leakage issues and crash issue caused by CPU cache. 



Reference Link: https://mymotorwheels.wordpress.com/2016/09/21/valeo-partnered-with-gemalto-to-secure-its-virtual-car-key-valeo-inblue/

Wednesday, 11 January 2017

How to solve Tomcat – java.lang.OutOfMemoryError: PermGen in Amazon Linux AMI

Tomcat web server often suffers from java.lang.OutOfMemoryError: PermGen space whenever you deploy and un-deploy your web application couple of time. 
In this article, we will see how to fix java.lang.OutOfMemoryError: PermGen Space in tomcat server.



1. Goto Tomcat startup script file location, for Amazon Linux AMI. It locates at "/etc/rc.d/init.d/"

2. Edit the script file by "sudo nano tomcat7"

3. Add the following JAVA_OPTS at the beginning of the file after "NAME="$(basename $0)""
export JAVA_OPTS="-Xms1024m -Xmx10246m -XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m"

You can change the actual heap size and PermGen Space as per your requirement.

4. Restart Tomcat.

Increasing PermGen space can prevent java.lang.OutOfMemoryError: PermGen in tomcat only for some time and it will eventually occur based on how many times you redeploy your web application, its best to find the offending class which is causing a memory leak in tomcat and fix it.

Sunday, 1 January 2017

Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to

Recently always met this issue while using Android Studio, "Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to ..."

After Android Studio starts to support Instant Run, this issue becomes critical. If you want to use Instant Run, you should keep your gradle and gradle plugin version updated. 

First time I met this issue, I search online, luckily I can easily find the solution. But 2nd time is not so lucky, because the answer online is outdated. So the best solution is to know which version is the latest one, otherwise every time I need to waste a lot of time to find the solution.

So here is the solution.
Here is the link to check the latest version of gradle plugin.
https://jcenter.bintray.com/com/android/tools/build/gradle/

Example to apply to root level build.gradle file (Updated on 26 Jul 2017),
classpath 'com.android.tools.build:gradle:2.4.0-alpha7'


Here is the link to check the latest version of gradle.
Example to apply to gradle-wrapper.properties file (Released on 26 Jul 2017, updated on 26 Jul 2017),
distributionUrl=https\://services.gradle.org/distributions/g‌​radle-4.0.2-all.zip

Friday, 16 December 2016

Mac OSX setup MySQL server and MySQLWorkBench

Environment:
OS X: 10.11.6
MySQL: V5.7.17
MySQLWorkBench: V6.2.3

The installation of MySQL is simple, just follow this guidance,
http://dev.mysql.com/doc/refman/5.7/en/osx-installation-pkg.html

At the end of installation, it will pop up the below window to tell you the temporary password. Take note of this password. It will be used later.

This password can be used only one time. This is the difficulty, we need to take this chance to reset the password.

Supposing when you install MySQL server, you also installed the Preference Pane and Launched Support. After you installation, MySQL server should start automatically. Use OSX "Activity Monitor" to check if there is a process "mysqld". If it's runing, means the server is started. Otherwise, start the MySQL server manually.

After the server is running, we can connect to MySQL server now. Go to the installation path of MySQL, default location is at "/usr/local/mysql/bin". Use the following command to connect the server:
mysql -u root -p
After press return button, it will ask the password, key in the password at the end of installation.
Don't try any command like "sudo mysqld_safe --skip-grant-tables" that suggested online, it will start another MySQL server. You will lose connection of current one.

If the connection is succeeded, you should see the welcome message.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 224
Server version: 5.5.13 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql>

Now you can reset the password by this command.

SET PASSWORD = PASSWORD('your_new_password');

If it works, you will see.

Query OK, 0 rows affected, 1 warning (0.00 sec)

Otherwise, you will see.

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Don't close the current Terminal window, otherwise you will lose connect with current server, and you will lose the only one chance to reset the password.

If you cannot make it, you may need to uninstall the MySQL server by following commands and install again.
  • sudo rm /usr/local/mysql
  • sudo rm -rf /usr/local/mysql*
  • sudo rm -rf /Library/StartupItems/MySQLCOM
  • sudo rm -rf /Library/PreferencePanes/My*
  • edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
  • rm -rf ~/Library/PreferencePanes/My*
  • sudo rm -rf /Library/Receipts/mysql*
  • sudo rm -rf /Library/Receipts/MySQL*
  • sudo rm -rf /private/var/db/receipts/*mysql*
After resetting the password, you can start to install MySQLWorkBench, and connect the MySQL server.



Monday, 28 November 2016

香港新聞

該新聞客戶端通過優化界面設計,具有方便用戶使用,快速加載和省電等優點。

該客戶端不是簡單的加載新聞網頁而已,它會解析和顯示新聞內容,並且存到服務器。這樣您既可以看到前幾天的新聞,也可以加快新聞加載的速度。

該客戶端目前包括了香港主要的新聞報紙:
    - 蘋果日報
    - 東方日報
    - South China Morning Post (南華早報)
    - 頭條日報
    - 太陽報
    - 明報
    - 大榴蓮網
    - BBC
    - CNN
    - CNET
    - Engadget 中文版
    - 大公報
    - Yahoo香港新聞
    - 香港電台網站
    - am730
    - Google新聞
    - 東網
將有更多的新聞報刊陸續推出,敬請期待!

優點:
* 多元:包括最新的香港,亞洲,世界,政治,生活,體驗,商業,娛樂,科技,財經等新聞。用戶通過滑動界面就可以切換分類。

* 字體:可切換字體大小。

* 收藏:沒有網絡的時候,可以收藏當前新聞,供下次閱讀。

* 分享:分享新聞,分享PSI抓屏。

* 夜晚模式:可以切換白天模式和夜晚模式。

* 離線下載:可緩存讀過的新聞,離線也可以閱讀。


歡迎反饋問題到topnewssg@gmail.com。

iOS:    https://itunes.apple.com/sg/app/hk-top-news/id1180403718?mt=8

Android: https://play.google.com/store/apps/details?id=com.topnewshk

Sunday, 27 November 2016

台灣新聞

該新聞客戶端通過優化界面設計,具有方便用戶使用,快速加載和省電等優點。

該客戶端不是簡單的加載新聞網頁而已,它會解析和顯示新聞內容,並且存到服務器。這樣您既可以看到前幾天的新聞,也可以加快新聞加載的速度。

該客戶端目前包括了香港主要的新聞報紙:
     中央通訊社
     東森新聞雲
     NOWnews 今日新聞
     鉅亨網
     Engadget 中文版
     蘋果日報
     中國時報
     中國時報 (即時新聞)
     自由時報
     聯合報
     大榴蓮網
     BBC
     CNN
     CNET
     Yahoo台灣新聞
     台視新聞
     華視新聞
     三立新聞網
     民視新聞網
     番薯藤新聞
     旺報
     經濟日報
將有更多的新聞報刊陸續推出,敬請期待!

優點:
* 多元:包括最新的台灣,亞洲,世界,政治,生活,體驗,商業,娛樂,科技,財經等新聞。用戶通過滑動界面就可以切換分類。

* 字體:可切換字體大小。

* 收藏:沒有網絡的時候,可以收藏當前新聞,供下次閱讀。

* 分享:分享新聞,分享PSI抓屏。

* 夜晚模式:可以切換白天模式和夜晚模式。

* 離線下載:可緩存讀過的新聞,離線也可以閱讀。


歡迎反饋問題到topnewssg@gmail.com。

iOS:    https://itunes.apple.com/sg/app/taiwan-top-news/id1180403714?mt=8
Android: https://play.google.com/store/apps/details?id=com.topnews.twnews