The Last Post

This post is the last one on this blog. Yes, it’s the end for this blog. However, this blog still remains in cyber world, it will be transfered to after May, 2008. Others will be kept before June, 2008. After that, all will be removed with this domain name. (I am contacting billing dept. of bluehost, they should be able to follow my request)

I am not sure how worse would this blog be after transferring. Just hope that won’t be too bad.

I am no longer using WordPress. It’s been doing so well, but it’s time to make some changes. As you are reading this post, I already have another space online, which is run by me. Yeah… from now on, I have to suffer noise. boy! summer is coming… But I will not make any direct connections between this and the new space.

An end is not the end.

To be continued at somewhere else…

Yu-Jie Lin (livibetter)


Google Tech Talks: No Time to Think

I highly recommend this video. This video has been available for about two days, but it only has less than 100 views while I am writing this posting.

I probably didn’t really “think” for last three years; No! maybe in my whole life. I always have an idea, then change my mind quickly. I always prepare and study for (all) exams within few days and get outstanding results from others’ eyes. I never take things serious. I often regret afterwards.

I usually google “for loop” in JavaScript or in PHP, instead of standing up and getting a printed specification which is just two steps from me. I could have some time for thinking after 2 * 2 steps, looking up and reading paragraphs. I could be more creative.

Time to Think and to (re)Learn Thinking.

Generating and verifying checksum

What is checksum

checksum is a technique, which can ensure (in some degree) integrity of transfered files. It helps detect errors occurred in transmission. It is an Error Detection, not an Error Correction, therefore once found errors, you can’t not use checksum to correct corrupt data.

Generating checksum

On Linux, you should already have programs that you need to generate checksum.

for files


It’s a simple CRC-32 checksum generator. You can just run:

cksum *

It generates two numbers: CRC-32 and filesize. It doesn’t provide verifying functionality, you have to check numbers by yourself.

md5sum and sha*sum

md5sum * > MD5SUM
sha512sum * > SHA512SUM

There also are sha1sum, sha224sum, sha256sum, sha384sum.

for standard input

You can get a checksum of a typing message, just don’t give any parameters

my message<Ctrl+D><Ctrl+D>

You will get

8ba6c19dc1def5702ff5acbf2aeea5aa  -

Verifying checksum

Verifying is simple, just use parameter -c and the checksum file like

md5sum -c MD5SUM
sha512sum -c SHA512SUM

Do not use AOL Search

I saw this referrer in access log (obscured):


Why did this get my attention? Because there is a key pair called encquery, it could mean encrypted query or just encoded query. I believe the answer is later. When I visited that link, I can see the original search keyword which is “grants for 501c(3).” I would like to say no matter it is encrypted or encoded, that doesn’t matter. This kind of processing benefits nothing: a) it’s not a encryption, even it is. It’s easy to decrypt, b) it wastes bandwidth and processing power, since it increases the length of query string and it needs to decode before querying. They do decode it, try to remove few content from encquery.

I also noticed one thing which is the reason I would like you not to use AOL Search (I wonder if there already is someone using it.). Check out the close screen shot below:

The last five results (ads) are sponsored links, will you be fooled? I believe some people will, even there are barely noticeable background highlighting and hardly seen text “Sponsored Link” on top-right corner while you are reading the title of the website and about to click on that fake result (ads), or already clicked.

These advertisements seem to have something about Google, here is the link of first sponsored link (obscured):


Obviously, Google enhances AOL Search, why not use this word power? Anyway, there is a poll for you:


That company is really dirty.

Read: After Hijacking Site, Scammers Move to Seize Shareaza Trademark and Urgent: Opposing the Shareaza Trademark.

PS. This is not about P2P, but the stealing of identity of a software.

Generating random binary content file

The following command will generate an 1MB file:

head -c 1m /dev/urandom > test.bin

It uses head command to retrieve random data from kernel random number source /dev/urandom, -c 1m specifies the amount is 1 * 1024 * 1024 bytes, then redirect to the file test.bin.

-c recognizes three multiplier suffixes: b is for 512, k is for 1024 and m is for 1024 * 1024.

If you require higher quality randomness, then you can use /dev/random, but you have to use your computer for long enough time to generate random data.

Super cow

Those cows are not bodybuilders, it’s all about genetic.

It’s kind of sick… I think I will have a while no eating any steak.

Latest Java Beta Test

Not the Sun Java you thought, but Joffrey’s Java Beta Test. Go to sign up, then you have the chance to be chosen as a tester. You have to be a blogger.

And I have been accepted as a BETA tester! Even I am not in US.

The testing subject is Jamaican Me Crazy: Caramel, vanilla and coffee liqueur flavoring. Caramel exactly is what I love to taste.

Bash: for loop

I am trying to find out which way to loop in Bash is efficient. The general code is:


t1 () {
    tt1=$(date +%s.%N)
t2 () {
    tt2=$(date +%s.%N)
    echo $(echo $tt2 - $tt1 | bc) seconds;

## brace expansion
for i in {1..100000}
do dummy=1 ; done
## C style
for ((i=1;i<=$TIMES;i++))
do dummy=1 ; done
## seq command
for i in $(seq 1 $TIMES)
do dummy=1 ; done

Surprisingly, C style is neither the fastest one nor the most efficient one in memory usage. Yea, C style doesn’t mean it has the performance as if C code has. Using Brace expansion is the best solution in my test.

However, there is a con in Brace expansion, you can’t program like for i in {1..$TIMES}. In the manual of Bash: Bash does not apply any syntactic interpretation to the context of the expansion or the text between the braces.

Note: I use Valgrind to get memory usage information with three Bash scripts (extracted from the script above).

References: Brace Expansion, Looping Constructs and Valgrind program.

Finally, Google Webmaster Tools Gadgets

I have been waiting such features for long long time. Now we can have EIGHT iGoogle Gadgets at once, it will also add these gadgets into a new tab of your iGoogle.

Simply go to Tools section, then Gadgets.

The problem is EIGHT gadgets are too many, why they didn’t use Tabs UI of iGoogle Gadget?

Link: iGoogle Gadgets for Webmaster Tools