« Archives in September, 2008

What happens when you do "rm -rf /*"

Just for the fun of it. Here is what happens:

[root@s10 ~]# cd /
[root@s10 /]# dir
bin   dev  initrd  lost+found  misc  opt   sbin     srv  tmp  var
boot  etc  lib     media       mnt   proc  selinux  sys  usr
[root@s10 /]# rm -rf *
rm: cannot remove directory `boot': Device or resource busy
rm: cannot remove directory `dev/shm': Device or resource busy
rm: cannot remove `dev/pts/1': Operation not permitted
rm: `proc/asound/ICH' changed dev/ino: Operation not permitted
[root@s10 /]#
[root@s10 /]# dir
-bash: /usr/bin/dir: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
[root@s10 /]# ll
-bash: ls: command not found
[root@s10 /]# reboot
-bash: /sbin/reboot: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Since the processes are still running, SSH still accept connections, but cannot sign in, can’t run anything either. Was it fun?!

Firefox Performance Tips

Check memory cache usage

about:cache?device=memory Reference

Disable disk cache

config:about => browser.cache.memory and browser.cache.disk

SHOW COLUMNS FROM MyDatabase.MyTable

That operation will always require a disk read, which is rather expensive, especially for larger tables. For example, for a 500MB table in my test, it takes 0.23 seconds just for this query. I thought the table schema should not depend on its size. Guess there is something more technical than my basic understanding.

Related keywords & spelling suggestion API

Google Toolbar Auto Complete

Replace your own “q=keywords”:
http://google.com/complete/search?output=toolbar&q=Ad+Server

Google SOAP Search API

http://scholar.google.com/apis/reference.html#1_3

Yahoo Related Keywords API

http://developer.yahoo.com/search/web/V1/relatedSuggestion.html

Yahoo Spelling Suggestion API

http://developer.yahoo.com/search/web/V1/spellingSuggestion.html