How to kill an unresponsive ssh session?
Sometime, I have to restart a server I have connenected via ssh. During it restart process, the ssh lost connection for a while. If the ip address of the server is changed after it has started up, the ssh will not response to any command. This problem also occures when I change the server's IP address via ssh. To solve this problem, I usually close the terminal and try connecting it again. Howerver, I found that unresponsive ssh sessions can be terminated using a disconnect key sequence.
[new line]~..
How to reverse a number?
I had found a mathematics question for programmers from a website. The question is how many natural numbers below 1,000,000 that has this property.
2012 <== square / square root ==> 4048144 reverse reverse 2102 <== square / square root ==> 4418404
Let find it out.
JxMega128 and Ubuntu
I have been searched for years trying to fine a way to use my AtMega microcontrollers with Linux. The problem is always at the burning chip process. Sometime, I tried to use PX-400, in system programming device for AVR, but it is a little bit hard for laptops 'cause most of them dose not have a serial port. So I have to fine a USB to RS232 converter such as UCON232S for it, just to find that the burning is still not work.
Then, I found a a technique at somewhere on the Internet. I am sorry that I did not remember where this script comes from, but I would like to share it for developers that have the same problem as I had.
OOo-writer Crashs while Trying to Use Bibliography Database Menu
Recently, I tried to use OpenOffice-writer to write a report. It had so many parts, including reference. So I tried to use bibliography menu to do reference part for me. I found a good tutorial here and tried to follow. Unfortunately, the program crash when I access bibliography menu.
What I have done?
$ history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s\n",a[i],i}}'|sort -rn|head
85 sudo
63 ./printPrime
49 iwconfig
32 vi
31 exit
30 ./divide
28 ls
25 ./factor
24 cd
17 ./multiply
Seem like I spent most of my time on homework.
The Beer-Ware License
While I was searching for some information, I found a funny license on a source code which is shown below.

Maybe I should use it on my own source codes. LOL
Modifying directory indexing of Apache server
Directory indexing make both benefits and drawbacks to web servers. If you think it have more benefits than drawbacks, you may want to change it like me. The one bad default option of it is it does not ignore case of files and folders. If you have folders named 'A', 'a', 'b' and 'Z', and the a file name 'B.txt'. You can see the picture of default directory indexing. For me, it make me confuse.

Enable mod_rewrite in Apache2
Today I installed Drupal on my laptop. I need it to use clean URLs feature. I has done and note it here.
To enable this feature, mod_rewrite must be enable. To do this, I use just 2 commands.
# ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
# /etc/init.d/apache2 restart
The first command is making a link of rewrite.load module to mods-enabled folder. The another command is restarting Apache to enable this feature.
Using macro in VIm
I had just needed to do the same thing again and again in VIm, so I searched how to make it faster and note it here.
To use macro in VIm, I have an example file like this.
Ubuntu updating problem
Days before, update notifier showed on my screen. I clicked it to update the system like what I have done before. However, that day was different. The updating crashed. I was not worry about it and try to upgrade the system again. This time, the upgrade was success and I forgot about it.
The problem started few days later when I restarted my laptop. Grub showed the menu as it used to. But when it entered the default menu, Grub showed error "GRUB: Error 11: Unrecognized device string". Ha ha, I had something to do (while I already had MANY things to do at that time).
