Archive for April 2nd, 2007

Server down past 3 days

Monday, April 2nd, 2007

I was working on something that’s probably not important because I don’t remember what I was working on. But anyway, 3/31/2007 morning, the server is suddenly offline, and it leads to my letter to 1&1:

===========================

Hi,
My customer id is [EDIT] and the question is regarding to the Root Server
with contract ID [EDIT].

My server became unreachable this morning (3/31). Since this happens once in
a while so I just go ahead and restart the server via the 1&1 Admin Panel.
The server did not come back online, so I tried logging in via Serial
Console. Server looks normal, nothing changed. However, it looks like the
DHCP server on your side is down for unknown reason. I've attach some
relevant command output below:

[root@u15185402 ~]# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:129 errors:0 dropped:0 overruns:0 frame:0
          TX packets:129 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:22508 (21.9 KiB)  TX bytes:22508 (21.9 KiB)

[root@u15185402 ~]# dmesg | grep eth0
eth0: VIA Rhine II at 0x1e000, [EDIT], IRQ 15.
eth0: MII PHY found at address 1, status 0x7849 advertising 05e1 Link 0000.
eth0: link down

[root@u15185402 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
169.254.0.0     *               255.255.0.0     U     0      0        0 lo

[root@u15185402 ~]# dhclient eth0
Internet Systems Consortium DHCP Client V3.0.2-RedHat
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

Listening on LPF/eth0/[EDIT]
Sending on   LPF/eth0/[EDIT]
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

[root@u15185402 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr [EDIT]
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:15 Base address:0xe000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:136 errors:0 dropped:0 overruns:0 frame:0
          TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:22909 (22.3 KiB)  TX bytes:22909 (22.3 KiB)

[root@u15185402 ~]# dmesg | grep eth0
eth0: VIA Rhine II at 0x1e000, [EDIT], IRQ 15.
eth0: MII PHY found at address 1, status 0x7849 advertising 05e1 Link 0000.
eth0: link down
eth0: link down

I tried calling the support number 1-877-206-4255 but was disconnected for
unknown reason before I reach a customer representative. Please help.

Thanks,

Peter

After two days no response, I called them again. Being put on hold for about 30 minutes, I was finally able to talk to a customer service. The rep told me my server is sending packets with fake MAC address and therefore my account is suspended. WOW. He was not able to do anything but elevate this case and put a high priority tag so the server department will be able to look into it later. Next morning, I suddenly saw the server back online again. Immediately after that I receive this letter:

===========================

Dear Peter Chang, (Customer ID: [EDIT])

Thank you for contacting us. Your server has been disabled at the switch
because it was generating traffic with false MAC address header
information.  This is most often due to a virtual machine running with
an independent interface. To use virtual machines on your server, you
must use NAT so that the virtual machine uses the host interface. I have
reenable the server back onto the switch and you r server is now
pinging.

If you have any further questions please do not hesitate to contact us.

--
Sincerely,
Chad Hodgdon
Technical Support
1&1 Internet

WOW. Virtual Machines? It can’t even run smoothly as 1 machine. How can my computer generate traffic with false MAC header? I really wonder how this happens. Also I don’t get any letter or any call telling me the account is suspended, is that normal? Anyway, it’s back, and I’m happy for now. Colopronto is looking very attractive though.

Ajax 筆記

Monday, April 2nd, 2007

過去幾天一直在摸 AJAX 的相關東西,而跟以前不同的是,這次有下去實作。實作的內容是寶貝哈泥的作業,我想應該是不會拿去交啦,有點類似國小在教小畫家但是拿 Photoshop 的作品去交件。趁還記得把一些心得記下來:

Prototype.js:

  • $( ) 是超級好朋友,省了好多字
  • $( ) 不能用在 radiobutton 上
  • 超省時 XMLHttpRequest Syntax:
    ob = new Ajax.Request(
        URL,
        {
            method: 'get/post',
            parameters:'a=1&b=2',
            onComplete:funcOb
        });
  • onComplete 或者其他 onXxxxx 的 funcOb 要用 var funcOb = function(param) { … } 下去定義
  • 除了丟 funcOb 以外,也可以直接丟 anonymous function 像是 onComplete: function(param) { … } 這樣
  • $( ).visible() 和 $( ).hide() + $( ).show() 真是省了好多 browser hack 的工作

Scriptaculous.js:

  • Effect.toggle(’ID’) 是美觀大方又實用到爆的開關
  • Effect.Fade(’ID1′, {queue:’end’}) 然後 Effect.Fade(’ID2′, {queue:’end’}) 會先 Fade 完 ID1 後才會 Fade ID2

XML:

  • <?xml version="1.0" encoding="big5" standalone="yes" ?>

    順序很重要,嗯哼,亂掉就不給 parse \囧/

  • IE 真的很討厭,只要 XML 有一咪咪問題 responseXML 就變成空的,所以最好用 Microsoft XML Notepad 2007 之類的先 validate
  • PHP 在丟 XML 時候記得要丟 header,像是
    header('Content-Type:text/xml;charset=Big5')

DOM:

  • Mozilla DOM 是個好地方,多看多嘗試就會了
  • element.value 才是取得 input 物件裡面的值,element.innerHTML 是拿來塞東西到 <div id=”mydiv”></div> 之間的

這些是實作的不同版本:

  • ajaxbmi1: 超級基本的版本,直接用 responseText 來丟進 innerHTML
  • ajaxbmi2: 開始會丟 XML 來生成 responseXML 了
  • ajaxbmi3: 開始使用 prototype/scriptaculous 來簡化許多東西
    這個版本有個用 behavior 生的 syntax highlighter (star-light),而原因是因為林餅幹家的 lighty 沒設好 phps 的輸出所以一時起興掛上去的
All Rights Reserved Copyright © 2008 Design by StyleShout and Clazh