Saturday, July 31, 2010

DLNA firewall setup

notes to self... to setup DLNA...
ipfw add pass all from any to 239.0.0.0/8 in via re0 keep-state
ipfw add pass all from any to 239.0.0.0/8 out via re0 keep-state

route add -net 239.0.0.0 -netmask 255.0.0.0 -iface re0

Sunday, July 11, 2010

MSN "now playing" plugin for foobar2000 (version 0.6)

This is version 0.6 of the plug-in. Fixed the bug that MSN displayed garbage when foorbar was closed during music playing.

This plug-in is for the foobar2000 music player. It sends the song information to MSN Messenger for display.

The component is available here.

Save the file under the components directory of foobar2000 (e.g. C:\Program Files\foobar2000\components) and restart the program. There will be a new item added under the Playback menu. Select the format of info that you want to show on MSN. Also remember to turn on the "Show what I'm listening to" feature on your MSN Messenger.

The C++ source code is also available. You will need to download the foobar2000 SDK in order to build it.




Thursday, June 17, 2010

Android Safe 1.0.2




Android Safe 1.0.2 released today. No new feature or bug fix. This release is mainly for speed improvement.

I picked to implement an encryption program as my first Android application because (besides the fact that I have a real need to replace my Palm application MemoAES) I need to have an excuse to play with native programing on Android! :P I also picked a secure and computationally expensive key generation method: PBKDF2 with 1024 rounds (!) of iteration and a 256-bit key output for AES.

Both Android Safe version 1.0.0 and 1.0.1 used pure Java implementation. The Dalvik VM isn't really that bad. The key generation process took around 3 seconds. But since each of the notes in Android Safe is encrypted with different salt, that essentially translate to the fact that they are using different keys. So each open, save, and import (with different password) action requires at least one call to the PBKDF2 algorithm. The user experience is acceptable, but not that good.

Using Android NDK, the PBKDF2 part is rewritten with JNI (in C) for version 1.0.2. The speed improvement is over five-folds. Below is some test data I collected when testing the algorithm with test vectors found in RFC3962. Each test executed three times with the average taken as the result.




PBKDF2 Speed Tests using test vectors from RFC3962.
(Pass phrase = "password". Salt="ATHENA.MIT.EDUraeburn")
1200 iterations 2 iterations
128-bit JNI
330ms
3ms
128-bit Java
1864ms
9ms
256-bit JNI
632ms
11ms
256-bit Java
3495ms
97ms


Sunday, June 13, 2010

Android Safe



Encrypt notes with 256-bit AES. Keys are based on PBKDF2 with 1024 iterations and 256-bit salt. Export/Import encrypted notes to external storage. Share the encrypted messages via emails. Online tool available to decrypt the message without using Android.





Saturday, October 3, 2009

中秋羊

買件無骨羊肩, 醃左佢





再加薯角... 咁又一餐!


同場加演, 肥死你牛油磨菇...


... 唔少得啤酒!


肥。到。冇。朋。友!!!

Sunday, September 13, 2009

Saturday, September 5, 2009

Star PSS-300

So I have caught the bug. Searched for replicas of air pistol used in competitions. The KSC GP100 is just too expensive for me. The solution? Go for the replica of replica! Here is the Star PSS-300 that I got.




















The grip, front and rear sights, trigger etc are all adjustable. For around HKD1000, just can't beat the price.

BTW, the Maruzen APS-3 is very nice too. But again, the price is just out of reach for me... orz

Saturday, July 25, 2009

Olympus PEN E-P1

會唔會有港版呢?



Sunday, June 21, 2009

Android bug #01

Calendar events entered via the phone won't show up on Google calendar.


Advice from Google doesn't help.

Update: Found the cause. By default, events created on phone are default to a local calendar "My Calendar" that can't be sync with any calendar in Google Calendar. And you can't change the calendar once the event is saved. A "workaround" is to select the Google Calendar for all events created on phone.

Wednesday, June 10, 2009

Signing symbian S60 applications

Note: This is NOT the official way to sign an application. This is just a quick hack to help my friend getting an application running on his phone. Go to Symbian Signed for more details on signing an application properly.


  1. First, go to OPDA.net here to get your certificate and key. If you are not a registered member, you will be forwarded to a registration page. Just create a dummy account. (Yes, the site is in simplified Chinese!)
  2. Once you are at the page for requesting the certificate, enter the data correctly. The "串号" is your IMEI number of your phone. If you don't know what it is, enter *#06# on your phone. The "手机号码" is your phone number. Just enter anything that starts with 13, 15, or 18. The length of the phone number MUST BE 11 digits long. e.g. 15000000000
  3. Once you submitted your request, go to "我的证书" and wait for your certificate and key files. It could take several hours or even a day for the files to be ready. Once it said "已完成", click on "普通下载" to download both the .cer and .key files. Keep them in a safe place. You will need them to sign your applications.
  4. Next, get hold of a Windows application called EasySignPlus. Please don't ask me where to get it. You can easily search for it on the Internet.
  5. In EasySignPlus, select the certificate and key file you got from opda.net. The password for the key file is four zeros (i.e. 0000). Then drag your unsigned .sis file to the program window. By default, it will sign the application and generate the .sisx file under the same folder as your .sis file
  6. Install the .sisx file in your phone as usual and have fun~!