May 24, 2011

A simple method to reset your HTC Hero phone

If you want to perform Factory Reset your HTC mobile phone, you could do it like this,

1 Switch off the phone (either removing the battery or shutting down by holding the "end call" button for few seconds

2 While being switched off, hold the "home" (house) and "back" (the arrow in the lower right corner)

3 Hit briefly the "end call" button" while still holding the "home" and "back" buttons.

4 Release the "home" and "back" button, a white screen containing technical information should appear, with a red message asking
for hitting the "menu" button.

5 Hit the "menu button", the Hero will now boot with factory settings.

Somebody says you also have another way which is "HOME > MENU, then tap Settings > Security > Factory data reset" to reset the phone. But I do not find there is an item called "Factory data reset" under "Security" tab. So I think the first method is easier and better.

May 19, 2011

How to record command line output

if we want to record the output in Linux command line, we could use "script" command.

script [-a] [-f] [-q] [-t] + file name


Append the output to file or typescript retaining the prior contents.


Flush output after each write. This is nice for telecooperation: One person does `mkfifo foo; script -f foo' and another can supervise real-time what is being done using `cat foo'.


Be quiet.


Output timing data to standard error. This data contains two fields, separated by a space. The first field indicates how much time elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used to replay typescripts with realistic typing and output delays.

To exit the recording, we need to use "ctrl + d".

For example, we record the command line output to a log file whose name is "MyRecord".

$ script MyRecord.log

Then it will begin to record all the information displayed by command line. Finally, "ctrl + d" will exit and it will show "Script done, file is MyRecord.log"