Thursday, December 31, 2009

iPhone 3.0 Push notification sample code & tutorial

I found the following two links quite helpful for me when developing iPhone Application using push notifications.

http://iphonesdkdev.blogspot.com/2009/04/apns-client-development-certificate.html

and

http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial

I also met with the following ERRORS:

Error in registration. Error: Error Domain=NSCocoaErrorDomain Code=3000 UserInfo=0x2910d0 "未找到应用程序的“aps-environment”的权利字符串"

Interestingly, I solved the problem with this post "I got the solution, when you have configured your AppID for Push notification, then recreate a new provisioning file with this AppID and install it on the Xcode Organiser, this has worked for me ." from the following link:

Sunday, December 27, 2009

Some thoughts for building my dream

I should imagine more than what I can do now. And much more.

The ultimate goal should be big enough that you will try to fulfill it with my whole life

Tuesday, November 24, 2009

Slow DNS lookup for T-Mobile and AT&T

Based on our study, iPhone/AT&T and G2/T-Mobile is really slow for DNS lookup.
But Samsung/Verizon and Palm/Sprint are better.

BbUAYORaXy892uDS11xu

Wednesday, November 11, 2009

Comparison between Admob and Adsense: which is more profitable?

Admob is a very good publisher's tool for iPhone's applications.

Based on my experience, for the same page views, such as 1000 page views,
admob can earn more than adsense.

Why?
I guess this is because the screen size of iPhone/iPod is smaller than an computer.
Also mouse allows users to click more accurately than touchpads.

iPhone APP using three20 library is rejected

I used three20 to develop an iPhone image gallary application
And here comes the nightmare:
"
Please include the line below in follow-up emails for this request.

Follow-up: xxxxx

Dear XXXXXXX,

Thank you for submitting XXXXX to the App Store. Unfortunately it cannot be added to the App Store because it is using a private API. Use of non-public APIs, which as outlined in the iPhone Developer Program License Agreement section 3.3.1 is prohibited:.

"3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs."

The non-public APIs that are included in your application are the following undocumented, private UITouch instance variables:

UITouch._locationInWindow
UITouch._phase
UITouch._previousLocationInWindow
UITouch._tapCount
UITouch._timestamp
UITouch._touchFlags
UITouch._view
UITouch._window

Regards,

iPhone Developer Program
****************************
"

Check the apple store safe three20 here.
Only slight modifications.
But I don't know whether it will be approved by apple or not.
I already resubmitted two days ago.
Let's see

http://github.com/uprise78/three20-P31/commits/master/

Thursday, November 5, 2009

How long does it take Apple App Store to approve an application for iPhone?

Is your application submitted to Apple still "in review" or "waiting for review"?
Personally, I don't know the difference between these two terms, however,
one of my application submitted to Apple App Store for iPhone is "in review", while the other is "waiting for review". Maybe I can assume the one "in review" is being reviewed? Unfortunately, it has been reviewed for at least a week. It really doesn't make any difference to me between "in review" and "waiting for review".

My first application 3GTest took Apple 2 weeks to find a small bug and reject it.
I fixed the bug in five minutes and waited another 1 week before Apple found another bug inside.

Finally, 5 weeks after I submitted the application and fixed two lines of code, I received a call from Apple telling me that the application is approved as if I have won a big prize.

The most recent statistics shows that 75% of submitted applications are approved within 2 weeks.
This percentage is about 82% two weeks ago, and about 95% 1 month ago.

So what the hell is wrong with Apple?
We knew that iPhone / iPod touch is really popular and there are many many applications submitted everyday. But given that these applications also help u earn so many bucks and help u sell so many phones and ipods, why can't u just hire more people to review the applications?

After weeks' waiting, I even can't remember what my application looks like.
But one good thing is that, it's quite possible, one day, walking with the help of a stick, I will receive a call from Apple telling me that "congratulations, sir, your application is approved!". I will suddenly realize that "Holyshit, I have ever created an iPhone application in objective-c, I'm so proud of myself when I was young decades ago"

Saturday, October 10, 2009

US Dollar VS. CHINA Yuan RMB changes over time



Current currency,
Live rates at 2009.10.10 19:29:18 UTC

100.00 USD

=

682.655 CNY

United States Dollars China Yuan Renminbi
1 USD = 6.82655 CNY 1 CNY = 0.146487 USD

Friday, September 25, 2009

Tuesday, September 22, 2009

iPhone 3G Test (3GTest) Free Application Released


Visit the following link in you iPhone or iPod Touch
Install Now

Support website

Install URL



Introduction:
Want to score the 3G network of your iPhone and compare the scores with your friends? 3G Test is definitely your best choice! 3G Test is a professional and useful utility in your 3G networks (but it also works for WiFi and EDGE networks). We support iPhone / iPod (any versions), and other mobile platforms. With 3G Test, you can compare 3G network conditions even with your friends who are not using iPhone, but any other smartphone device! Using this tool, you will have a good knowledge of your smartphone's 3G network properties, such as local / global / gateway IP addresses, upload / download bandwidth (kbps), signal strength, DNS lookup latency (ms), PING latencies (ms), TCP connection establishment latencies (ms), HTTP benchmark downloading latencies (ms), and much more. You can also easily diagnose any network problems. All the results are refreshed each time you run our tool, so we encourage you to run it at different time and different locations, in this way, you can compare the scores of your 3G network at different times of day and at different locations.

------------------------------------

The only information that we use is your device's location information, the unique device ID and area code of your phone number. We will only use these information for aggregate analysis. No personal information will be collected or used. All the other information we collect is obtained from network measurement.

------------------------------------

Who are we? We are a group of computer science researchers from the University of Michigan, Ann Arbor.

Questions? Suggestions? Feedbacks?
E-Mail: 3gtest@umich.edu


Saturday, August 29, 2009

How to upgrade Java from 1.5 to 1.6 on Mac OS X 10.4+

This is really simple.
Run the following command

Step 1: rm /usr/bin/java (if you are concerned, make a copy to backup)

Step 2:
"sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java /usr/bin/java"

Before upgrade:
"java -version"
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)


After upgrade:
"java -version"
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)

Wednesday, July 29, 2009

Helling Apple Application design

Ever met this problem when you tried to run your application on your iPhone or iPod Touch device?

"
Can’t run “3GTest” on the iPod “Someone's iPod Touch”

The iPod “Someone's iPod Touch” doesn’t have the provisioning profile with which the application was signed.

Please add the provisioning profile via the Organizer, or check the “Code Signing Identity” build setting.
"

I added the provisioning profile via the Organizer. However it doesn't work.

FIX:

1. Make a totally new provisioning profile and downloaded into your MAC

2. Double click to install it into your XCode.

3. Install it into your ipod or iphone via Organizer

4. Restart XCode

Everything will just work fine.

Sunday, July 5, 2009

Amazed by twitter

Want to do sth with it's api

Monday, June 15, 2009

突然在想

什么样的生活才是我所真正追求的呢?
是自己眼中的好生活?
抑或是别人眼中的好生活?
抑或是Both?

有时候,会被这种想法很折磨很折磨
于是,迷失了自我

Saturday, May 30, 2009

《鲁宾逊漂流记》摘抄

最近突然想读点书,于是翻出《鲁宾逊漂流记》开始读。初中时,读过这本书,后来就一直没看过了。

 

摘一段鲁宾逊刚上荒岛时内心的独白吧,读完很有感触

 

——————————————————————————————

 

 

我感到自己前景暗淡。因为,我被凶猛的风暴刮到这荒岛上,远离原定的航线,远离人类正常的贸易航线有数百海里之遥。我想,这完全是出于天意,让我孤苦伶仃,在凄凉中了却余生了。想到这些,我眼泪不禁夺眶而出。有时我不禁犯疑,苍天为什么要这样作践自己所创造的生灵,害得他如此不幸,如此孤立无援,又如此沮丧寂寞呢!在这样的环境中,有什么理由要我们认为生活于我们是一种恩赐呢?

 

可是,每当我这样想的时候,立刻又有另一种思想出现在我的脑海里,并责怪我不应有上述这些念头。特别有一天,当我正带枪在海边漫步时,我思考着自己目前的处境。这时,理智从另一方面劝慰我:"的确,你目前形单影只,孑然一身,这是事实。可是,你不想想,你的那些同伴呢?他们到哪儿去了?你们一同上船时,不是有十一个人吗?那么,其他十个人到哪儿去了呢?为什么他们死了,唯独留下你一个人还活着呢?是在这孤岛上强呢,还是到他们那儿去好呢?"说到去他们那儿时,我用手指了指大海--"他们都已葬身大海了!真是,我怎么不想想祸福相倚和祸不单行的道理呢?"这时,我又想到,我目前所拥有的一切,殷实充裕,足以维持温饱。要是那只大船不从触礁的地方浮起来飘近海岸,并让我有时间从船上把一切有用的东西取下来,那我现在的处境又会怎样呢?要知道,像我现在的这种机遇,真是千载难逢的。假如我现在仍像我初上岸时那样一无所有;既没有任何生活必需品,也没有任何可以制造生活必需品的工具,那我现在的情况又会怎么样呢?"尤其是,"我大声对自己说,"如果我没有枪,没有弹药,没有制造东西的工具,没有衣服穿,没有床睡觉,没有帐篷住,甚至没有任何东西可以遮身,我又该怎么办呢?"可是现在,这些东西我都有,而且相当充足,即使以后弹药用尽了,不用枪我也能活下去。我相信,我这一生决不会受冻挨饿,因为我早就考虑到各种意外,考虑到将来的日子;不但考虑到弹药用尽之后的情况,甚至想到我将来体衰力竭之后的日子。

 

 

————————————————————————————————

 

 

我开始认真地考虑自己所处的境遇和环境,并把每天的经历用笔详细地记录下来。我这样做,并不是为了留给后人看,因为我相信,在我之后,不会有多少人上这荒岛来;我这样做,只是为了抒发胸中的心事,每日可以浏览,聊以自慰。现在,我已开始振作起来,不再灰心丧气,因此,我尽量自勉自慰。我把当前的祸福利害一一加以比较,以使自己知足安命。我按照商业簿记的格式,分"借方""贷方",把我的幸运和不幸,好处和坏处公允地排列出来:祸与害:我流落荒岛,摆脱困境已属无望。

 

唯我独存,孤苦伶仃,困苦万状。

 

我与世隔绝,仿佛是一个隐士,一个流放者。

 

我没有衣服穿。

 

我无法抵御人类或野兽的袭击。

 

我没有人可以交谈,也没有人能解救我。

 

福与利:

 

唯我独生,船上同伴皆葬身海底。

 

在全体船员中,我独免一死;上帝既然以其神力救我一命,也必然会救我脱离目前的困境。

 

小岛虽荒凉,但我尚有粮食,不至饿死。

 

我地处热带,即使有衣服也穿不祝

 

在我所流落的孤岛上,没有我在非洲看到的那些猛兽。假如我在非洲沿岸覆舟,那又会怎样呢?

 

但上帝神奇地把船送到海岸附近,使我可以从船上取下许多有用的东西,让我终身受用不荆总而言之,从上述情况看,我目前的悲惨处境在世界上是绝无仅有的。但是,即使在这样的处境中,也祸福相济,有令人值得庆幸之处。我希望世上的人都能从我不幸的遭遇中取得经验和教训。那就是,在万般不幸之中,可以把祸福利害一一加以比较,找出可以聊以自慰的事情,然后可以归入账目的"贷方金额"这一项。

 

现在,我对自己的处境稍感宽慰,就不再对着海面望眼欲穿,希求有什么船只经过了。我说,我已把这些事丢在一边,开始筹划度日之计,并尽可能地改善自己的生活。

 

——————————————————————————————

 

九月三十日,我没被淹死,逃上岸来,吐掉了灌进胃里的大量海水,略略苏醒了过来。这时,我非但不感谢上帝的救命之恩,反而在岸上胡乱狂奔,又是扭手,又是打自己的头和脸,大叫大嚷自己的不幸,不断地叫嚷着'我完了,我完了!'直至自己精疲力尽,才不得不倒在地上休息,可又不敢入睡,唯恐被野兽吃掉。"几天之后,甚至在我把船上可以搬动的东西都运上岸之后,我还是每天爬到小山顶上,呆呆地望着海面,希望能看到船只经过。妄想过甚,有时仿佛看到极远处有一片帆影,于是欣喜若狂,以为有了希望;这时,我望眼欲穿,帆影却消失得无影无踪,我便一屁股坐在地上,像小孩似地大哭起来。

 

这种愚蠢的行为,反而增加了我的烦恼。

 

这个心烦意乱的阶段多少总算过去了,我把住所和一切家什也都安置妥当。

Wednesday, May 20, 2009

黄石二中校友论坛

http://huangshierzhong.com
黄石二中校友论坛

这个论坛是基于Discuz 7.0.0做的

包括两个部分

一部分是公共论坛

http://huangshierzhong.com/bbs

一部分是个人空间,和校内网一样,也可以装各种好玩的应用,写日志,发照片,留言等等

http://huangshierzhong.com/home


祝愿每一位校友身体健康,万事如意!

让我们共同祝愿我们的母校欣欣向荣,桃李满园!


Sunday, March 29, 2009

Why google don't index my forum powered by phpbb 3.0.4 www.dotaart.com

Tried really hard to solve the dynamic link problem.
Finally resolved it with the help of Advanced phpBB3 SEO mod Rewrite

Don't forget to change you "AllowOverride none" to "AllowOverride ALL" to enable mod_rewrite for your websites. I am stunk at this point for quite a long time ...
For me this is modified at
"/etc/apache2/sites-enabled/000-default" where I configured my virtual hosts.

Now the forum looks better.
Originally, the URL look like this,
"
www.dotaart.com/viewforum.php?f=2
"
Now the url looks static like this
"
"
This is more search engine robot friendly.
Which is considered as part of SEO (Search engine optimization)


However, I still don't manage to get google crawl my page.
In the web master portal, I can see that google didn't index a single page of my site.
I'm sure this is a problem of duplicate contents, however, really difficult to fix

But now, www.dotaart.com, a forum to share dota video, images, and musics has more than 2000 clicks from 40 countries in just 2 days. I think it will grow more and more popular in the near future.

Wednesday, March 25, 2009

Finally tcpdump on GPhone G1 Android

Timur helped me a lot with this.

Step 1.
You need to get the tcpdump binary from here or here.
If you want to know where this binary is from, refer to Timur's post about cross-compilation.
If you don't want to bother, just download the tcpdump binary.

Step 2.
Install Android SDK in your machine.
See here for details.
They have good support for Windows, Linux and Mac.

Step 3.
Go to android-sdk-linux_x86-1.1_r1/tools
or xxx/tools depending on which build version of android you are using.
run
"sudo ./adb push ./tcpdump-arm /data/local"
You can push the tcpdump binary from your computer to the phone's directory "/data/local".
According to Timur, we can remount the gphone and make other directory writable to user "shell", however, by default, I only found "/data/local" is writable to user "shell" (maybe wrong, but at least it works)

Step.
run "sudo ./adb kill-server"
run "sudo ./adb shell"
Now you have logined into Gphone's shell command

You can see this
"
* daemon not running. starting it now *
* daemon started successfully *
$
"

Run "su"
You will see
"#" and now you are in root mode.
(Our Gphone is a holiday version which is not for sale.
For normal GPhone, I guessed, you can not enter root mode, hence not be able to run "tcpdump". For GPhone Dev version, you can definitely enter root mode)

Run
"cd /data/local"

Run
"chmod 777 tcpdump-arm"
To change the binary executable

then
run
"./tcpdump-arm"

If you see
"tcpdump: no suitable device found"
Then it means that you need to be root to run tcpdump.

Have fun dumping traffic on your GPhone Adroid

Android SDK adb shell error: device not found

Thanks Timur for pointing this link to me.
Really helpful.

I followed all the steps to install Android SDK on a Ubuntu Linux machine.
I went to the "/android-sdk-linux_x86-1.1_r1/tools" directory and run "adb shell"
it replies,
"
* daemon not running. starting it now *
* daemon started successfully *
error: device not found
"

The problem is that we need to run everything with root.
So by any chance, if you met the same problem with me, run

"

sudo ./adb kill-server
sudo ./adb shell

"

Then you can use "sudo ./adb push" or "sudo ./adb pull" to copy file between a Android Gphone and a computer

Thursday, March 12, 2009

GNUPlot: How to remove the blank margin space on the left

When you plot a figure using gnuplot, sometimes, there will be an extra blank margin on the left. To make the figure more condense, you can use a bash script to remove the extra blank margin. The basic idea is to adjust the Bounding Box for eps more intelligently.

Usage:
bash fixbb *.eps

The original image may look like this

The original eps file will be replaced with the adjusted eps file

The new eps file may look like this.




You can download this script from here.
Or, copy the following lines into a file named "fixbb" or something else whatever you like.

You can also copy this file (Assume you are using Linux)
to /usr/local/bin
and run "sudo chmod +x /usr/local/bin/fixbb"
Then in your terminal, you can directly run
"fixbb *.eps"

This script helps us a lot for our paper.

#!/bin/bash

# This is fixbb version 0.31. Copyright 2000 by Jeff Spirko.
# Redistributable under the GNU General Public License.
# See http://topquark.dhs.org/~spirko/fixbb/

# Changes by Petr Mikulik:
# - 8. 9. 2000: working file in the $TMP directory; remove backup file
# - 18. 10. 2000: AWKPARSEBB to support multiple-page (non-EPS) documents
# - 26. 10. 2000: error if bounding box not determined (GS < gsopts="-dQUIET -dBATCH -dNOPAUSE -sDEVICE=bbox" awkprog="'{" 1 ="=" awkprog="'" 1 ="=" found="1;" awkparsebb="'" x1="99999;" y1="99999;" x2="0;" y2="0;" page="0">$2 { x1=$2 }
y1>$3 { y1=$3 }
x2<$4 { x2=$4 } y2<$5 { y2=$5 } { page++; printf "Page " page ": " $0 " max = " x1 " " y1 " " x2 " " y2 " \t\r" >"/dev/stderr" }
END { printf "\t\t\t\t\t\t\t\r" >"/dev/stderr"
print x1 " " y1 " " x2 " " y2 }
'

export bbox

# Each command-line argument is assumed to be a file to process
for FILE in $* ; do

# BAK=${FILE}~
# if [ "$TMP" = "" ]; then TMP="."; fi; BAK=$TMP\fixbb__.ps
BAK='fixbb$$.ps'

# Get the correct BoundingBox from ghostscript.
# Old: bbox=`gs ${GSOPTS} ${FILE} 2>&1 | gsort | head -1 | cut -d\ -f 2-`
bbox=`/usr/bin/gs ${GSOPTS} ${FILE} 2>&1 | awk "$AWKPARSEBB"`

case $bbox in
"99999 99999 0 0")
echo "Bounding box was NOT determined (empty pages or Ghostscript >= 5.50 required)"
exit ;;
esac

echo "Bounding box for \""$FILE"\" is: "$bbox

# Save the old version of the file
mv $FILE $BAK

# Create the new version, replacing the old BoundingBox
awk "$AWKPROG" $BAK > $FILE

case `uname` in
"OS/2") dos2unix $FILE ;;
esac

# delete the backup file
rm -f $BAK

done

Saturday, March 7, 2009

VIM is such an amazing tool!!!

Will post something in the future for VIM.
I really love it like crazy.
100 times better than gedit emacs notepad and notepad++ (lol)!!!

How to remove Kubuntu and Xubuntu from Ubuntu

Remove Kubuntu:

sudo apt-get remove adept akregator amarok amarok-common amarok-engine-xine apport-qt ark dolphin dragonplayer exiv2 foomatic-db-gutenprint gdebi-kde gnupg-agent gtk-qt-engine guidance-power-manager gwenview hpijs-ppds hplip-gui ijsgutenprint imagemagick install-package jockey-kde k3b k3b-data kaddressbook kamera kate kde-icons-oxygen kde-printer-applet kde-window-manager kde-zeroconf kdebase-bin kdebase-data kdebase-plasma kdebase-runtime kdebase-runtime-bin-kde4 kdebase-runtime-data kdebase-runtime-data-common kdebase-workspace-bin kdebase-workspace-data kdebase-workspace-libs4+5 kdebluetooth kdegraphics-strigi-plugins kdelibs-bin kdelibs-data kdelibs4c2a kdelibs5 kdelibs5-data kdemultimedia-kio-plugins kdepasswd kdepim-kresources kdepim-strigi-plugins kdepim-wizards kdepimlibs-data kdepimlibs5 kdeplasma-addons kdeplasma-addons-data kdeplasma-addons-libs4 kdesudo kdm kfind kgrubeditor khelpcenter4 klipper kmag kmail kmix kmousetool knotes konqueror konqueror-nsplugins konqueror-plugin-searchbar konsole kontact konversation kopete korganizer krdc krfb ksnapshot ksysguard ksysguardd ksystemlog ktimetracker ktorrent kubuntu-artwork-usplash kubuntu-default-settings kubuntu-desktop kubuntu-docs kubuntu-konqueror-shortcuts kuser kvkbd kwalletmanager language-selector-qt libakonadiprivate1 libarts1c2a libartsc0 libaudio2 libavahi-qt3-1 libcapseo0 libcaptury0 libclucene0ldbl libdbus-1-qt3 libdbus-qt-1-1c2 libexiv2-4 libfftw3-3 libflac++6 libgeoip1 libifp4 libk3b3 libkcddb4 libkdecorations4 libkdepim4 libkholidays4 libkipi-common libkipi5 libkleo4 libkonq5 libkonq5-templates libkpgp4 libksieve4 libkwineffects1 liblua50 liblualib50 libmimelib4 libmodplug0c2 libmpcdec3 libmysqlclient15off libnjb5 libofa0 libokularcore1 libphonon4 libplasma2 libpoppler-qt4-3 libpq5 libqca2 libqca2-plugin-ossl libqimageblitz4 libqt3-mt libqt4-assistant libqt4-core libqt4-dbus libqt4-designer libqt4-help libqt4-network libqt4-opengl libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-mysql libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libraptor1 librasqal0 librdf0 libruby1.8 libsearchclient0 libsoprano4 libstreamanalyzer0 libstreams0 libstrigihtmlgui0 libstrigiqtdbusclient0 libtunepimp5 libvncserver0 libxcb-shape0 libxcb-shm0 libxcb-xv0 libxine1 libxine1-bin libxine1-console libxine1-misc-plugins libxine1-x libxvmc1 libzip1 mediamanager mysql-common network-manager-kde okular okular-extra-backends openoffice.org-kde openoffice.org-style-crystal oxygen-cursor-theme phonon phonon-backend-gstreamer phonon-backend-xine pinentry-gtk2 pinentry-qt4 plasmoid-quickaccess python-kde4 python-qt3 python-qt4 python-qt4-common python-qt4-dbus python-reportlab python-sip4 qt4-qtconfig raptor-utils redland-utils ruby ruby1.8 software-properties-kde soprano-daemon speedcrunch strigi-client strigi-daemon system-config-printer-kde systemsettings ttf-dustin update-manager-kde update-notifier-kde && sudo apt-get install ubuntu-desktop

Remove Kubuntu KDE 4

sudo apt-get remove adept akregator amarok amarok-common amarok-engine-xine apport-qt ark dolphin dragonplayer exiv2 foomatic-db-gutenprint gdebi-kde gnupg-agent gtk-qt-engine guidance-power-manager gwenview hpijs-ppds hplip-gui ijsgutenprint imagemagick install-package jockey-kde k3b k3b-data kaddressbook kamera kate kde-icons-oxygen kde-printer-applet kde-window-manager kde-zeroconf kdebase-bin kdebase-data kdebase-plasma kdebase-runtime kdebase-runtime-bin-kde4 kdebase-runtime-data kdebase-runtime-data-common kdebase-workspace-bin kdebase-workspace-data kdebase-workspace-libs4+5 kdebluetooth kdegraphics-strigi-plugins kdelibs-bin kdelibs-data kdelibs4c2a kdelibs5 kdelibs5-data kdemultimedia-kio-plugins kdepasswd kdepim-kresources kdepim-strigi-plugins kdepim-wizards kdepimlibs-data kdepimlibs5 kdeplasma-addons kdeplasma-addons-data kdeplasma-addons-libs4 kdesudo kdm kfind kgrubeditor khelpcenter4 klipper kmag kmail kmix kmousetool knotes konqueror konqueror-nsplugins konqueror-plugin-searchbar konsole kontact konversation kopete korganizer krdc krfb ksnapshot ksysguard ksysguardd ksystemlog ktimetracker ktorrent kubuntu-artwork-usplash kubuntu-default-settings kubuntu-desktop kubuntu-docs kubuntu-konqueror-shortcuts kuser kvkbd kwalletmanager language-selector-qt libakonadiprivate1 libarts1c2a libartsc0 libaudio2 libavahi-qt3-1 libcapseo0 libcaptury0 libclucene0ldbl libdbus-1-qt3 libdbus-qt-1-1c2 libexiv2-4 libfftw3-3 libflac++6 libgeoip1 libifp4 libk3b3 libkcddb4 libkdecorations4 libkdepim4 libkholidays4 libkipi-common libkipi5 libkleo4 libkonq5 libkonq5-templates libkpgp4 libksieve4 libkwineffects1 liblua50 liblualib50 libmimelib4 libmodplug0c2 libmpcdec3 libmysqlclient15off libnjb5 libofa0 libokularcore1 libphonon4 libplasma2 libpoppler-qt4-3 libpq5 libqca2 libqca2-plugin-ossl libqimageblitz4 libqt3-mt libqt4-assistant libqt4-core libqt4-dbus libqt4-designer libqt4-help libqt4-network libqt4-opengl libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-mysql libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libraptor1 librasqal0 librdf0 libruby1.8 libsearchclient0 libsoprano4 libstreamanalyzer0 libstreams0 libstrigihtmlgui0 libstrigiqtdbusclient0 libtunepimp5 libvncserver0 libxcb-shape0 libxcb-shm0 libxcb-xv0 libxine1 libxine1-bin libxine1-console libxine1-misc-plugins libxine1-x libxvmc1 libzip1 mediamanager mysql-common network-manager-kde okular okular-extra-backends openoffice.org-kde openoffice.org-style-crystal oxygen-cursor-theme phonon phonon-backend-gstreamer phonon-backend-xine pinentry-gtk2 pinentry-qt4 plasmoid-quickaccess python-kde4 python-qt3 python-qt4 python-qt4-common python-qt4-dbus python-reportlab python-sip4 qt4-qtconfig raptor-utils redland-utils ruby ruby1.8 software-properties-kde soprano-daemon speedcrunch strigi-client strigi-daemon system-config-printer-kde systemsettings ttf-dustin update-manager-kde update-notifier-kde

Remove Xubuntu

sudo apt-get remove a2ps abiword abiword-common abiword-help abiword-plugin-grammar abiword-plugin-mathview abiword-plugins aumix catfish cupsys-driver-gutenprint exo-utils gnumeric gnumeric-common gnumeric-gtk gpicview gtk2-engines-xfce imagemagick latex-xft-fonts libaiksaurus-1.2-0c2a libaiksaurus-1.2-data libaiksaurusgtk-1.2-0c2a libdiscid0 libexo-0.3-0 libfftw3-3 libgda3-3 libgda3-bin libgda3-common libgdl-1-0 libgdl-1-common libgdome2-0 libgdome2-cpp-smart0c2a libgoffice-0-6 libgoffice-0-6-common libgoffice-gtk-0-6 libgsf-gnome-1-114 libgtkmathview0c2a liblink-grammar4 libloudmouth1-0 libmad0 libmpcdec3 libnotify-bin libofa0 libots0 libt1-5 libtagc0 libthunar-vfs-1-2 libtunepimp5 libxfce4mcs-client3 libxfce4mcs-manager3 libxfce4util4 libxfcegui4-4 link-grammar-dictionaries-en listen mousepad mozilla-thunderbird orage psutils python-ctypes python-gnome2-extras python-musicbrainz2 python-mutagen python-ogg python-pymad python-pyogg python-pysqlite2 python-pyvorbis python-tunepimp scim-modules-table scim-tables-additional slocate tango-icon-theme tango-icon-theme-common tcl8.4 thunar thunar-archive-plugin thunar-data thunar-media-tags-plugin thunar-thumbnailers thunar-volman thunderbird vim-runtime wdiff xchat xchat-common xfce4-appfinder xfce4-battery-plugin xfce4-clipman-plugin xfce4-cpugraph-plugin xfce4-dict xfce4-fsguard-plugin xfce4-governor-plugin xfce4-icon-theme xfce4-mailwatch-plugin xfce4-mcs-manager xfce4-mcs-plugins xfce4-mcs-plugins-extra xfce4-mixer xfce4-mixer-alsa xfce4-mount-plugin xfce4-netload-plugin xfce4-notes-plugin xfce4-panel xfce4-places-plugin xfce4-quicklauncher-plugin xfce4-screenshooter-plugin xfce4-session xfce4-smartbookmark-plugin xfce4-systemload-plugin xfce4-terminal xfce4-utils xfce4-verve-plugin xfce4-weather-plugin xfce4-xkb-plugin xfdesktop4 xfdesktop4-data xfprint4 xfwm4 xfwm4-themes xubuntu-artwork-usplash xubuntu-default-settings xubuntu-desktop xubuntu-docs && sudo apt-get install ubuntu-desktop


When you are asked whether to stop KDM, choose NO. Otherwise, you will jump into terminal enviroment.

Wednesday, March 4, 2009

Remote desktop from Mac OS X 10.5 laptop to Ubuntu linux 8.10 desktop server via VNC

I have a Macbook and want to connect to my ubuntu desktop machine via remote desktop. It seems really trivial to do this.

Step 1. Open remote desktop preferences in your desktop linux machine
System->Preferences->Remote Desktop
Step 2. Enable sharing, better check all
Step 3. Enable Security, the password is limited to be 8 characters at most ...
Step 4. In you mac, download and install VNC client for it. JollyFastVNC is a good choice.
Step 5. Using your VNC to connect to your remote Linux machine.

I suggest not use encryption in your desktop's remote desktop setting.

Have fun!

Tuesday, February 24, 2009

Escape sequence for HOME and END in Mac OS X 10.5 Terminal APP

I'm using Macbook Pro with Mac OS X 10.5.6
But there is no HOME or END key in the keyboard.
When you use terminal, it is very inconvenient not to have those keys.

You can go to Terminal->Preferences->Settings->Keyboard (tab)
Add two keys:

For example, I specify:
The escape sequence \033 is equal to "control + esc"
option + cursor right (end, go to the end of a line): \033[F
option + cursor left (home, go to the start of a line): \033[H

Then it works fine in my terminal.
But I don't know how to specify "command + cursor"

Friday, February 20, 2009

Break CAPTCHA of AOL Mail and ebay . Crack success rate 10 ~ 15 %

I implemented a java program that can recognize AOL Mail's CAPTCHA with success rate of 1 ~ 2 %. Though not high, but still high enough to threaten their system.
I also implemented a java program that can recognize ebay.com CAPTCHA with success rate of 10 ~ 15%. This success rate is high enough to claim that their CAPTCHA is unsecure. 
Given that I implemented these attacks only for the purpose of our security course study, I will neither publicize my source codes nor do something harmful to their websites, cauze I'm a student not a spammer. But I just want to warn those two companies that their CAPTCHA systems are not strong enough. We can claim that CAPTCHA for AOL mail is broken, and CAPTCHA for ebay is also broken.

Based on my study, I found that GMail's CAPTCHA, reCAPTCHA, Hotmail's CAPTCHA are relatively more secure. GMail's CAPTCHA seems strongest. reCAPTCHA and Hotmail's CAPTCHA are somewhat secure. But I will try to see how difficult it is to break them.

Don't expect to get any of my idea or implementation from me. As a student to research computer science, we should be responsible. 

I really hope someone from AOL Mail or ebay can by any chance see this post and change their CAPTCHA system.

Break, Crack

Thursday, February 5, 2009

How to SSH to iPhone

Well. 
Step 1. Jail break your iphone. See here for more.

Step 2. Install OpenSSH from Cydia. My OpenSSH version is (5.1p1-6 or 4.7p1-5, I don't know which is the right version -_-)

Step 3. Connect your iphone to a WiFi (This requires you have internet access through this WiFi though). Then goto Settings->WiFi->Click the arrow of the corresponding wifi, a new page will show up->DHCP->IP Address, record this IP address on paper.

Step 4. Get a SSH client. On PCs, you can use WinSCP. On linux, you can simply type "ssh root@iphone's ip". On Mac, you can use Cyberduck, or in terminal, use the same command as linux. (Remember iphone's password is? If you forgot, see here)

Step 5. Here we are.

But BE CAREFUL.
Remember you are now logining in as root. You can download anything you want, you can create anything, you can delete anything, and you can kill any process (not critical system processes of course) potentially.

If you have a jailbroken iPhone and installed OpenSSH, when you connect to WiFi.
You also need to care for the attackers.
Image how horrible it is if someone can SSH to your iphone as root!

Friday, January 30, 2009

Java tip: how to split a string with "." (a dot)

String a = "a.jpg";
String str = a.split(".")[0];
This will throw ArrayOutOfBoundException
Why is this?
This is because "." is a reserved character in regular expression, representing any character.
Instead, we should use the following statement:
String str = a.split("\\.")[0];
When the code is compiled, the regular expression is known as "\.", which is what we want it to be

Click here for something funny

HERE

Thursday, January 29, 2009

Java: How to read pixel RGB values from images

BufferedImage img = null;

int w, h;

int pixels[];

try {

img = ImageIO.read(new File("images/secret.jpg"));

w = img.getWidth();

h = img.getHeight();

pixels = new int[w * h];

img.getRGB(0, 0, w, h, pixels, 0, w);

System.out.println(img.getWidth() + " X " + img.getHeight());

System.out.println("R:" + ((pixels[0] >> 16) & 0xff) + " G:" + ((pixels[0] >> 8) & 0xff) + " B:" + (pixels[0] & 0xff));

} catch (IOException e) {

e.printStackTrace();

}


//Based on the sample code, it is really easy to see how to read RGB values from any image files.

Wednesday, January 21, 2009

Damn it: How on earth can I get tcpdump running on gphone adroid g1 ???

//Anyone have any idea???

//I tried to search online and found my own blog -_-!!!

Finally, with the help of Timur, I can now run tcpdump on a holiday version of GPhone, it also works for Developer version GPhone, but not the normal version, because tcpdump requires root mode.

See my other post :

Finally tcpdump on GPhone G1 Android

See this link for help.

Monday, January 19, 2009

What is iPhone root access password?

"alpine"

In iPhone, you can't use this password to use "sudo", but you can still gain root access
In terminal, type "su" and enter pwd "alpine", then you enter root mode.
Really funny that sudo's password is not su's