8/31/2013

vim 如何使用巨集功能

1. 紀錄

先在最外層 按下 "q" , 再按下你想要的巨集名稱, 例如: a

2. 輸入想要編輯的步驟

此時左下方會顯示 "recording" , 代表已經在紀錄中, 此時你所有
輸入的編輯指令都會被紀錄在巨集 a 當中. 例如: 我 i + teststring + Esc

3. 離開紀錄模式

編輯完後按 Esc 跳到最外層, 再按下 "q", 就會停止紀錄

4. 播放巨集

按下 @a, 播放剛才紀錄的巨集, 這樣就會播放一次

5. 連續播放巨集

按下 10@a, 就會播放剛才紀錄的巨集 10 次


8/26/2013

STP switch port states

STP switch port states:


  • Blocking - A port that would cause a switching loop if it were active. No user data is sent or received over a blocking port, but it may go into forwarding mode if the other links in use fail and the spanning tree algorithm determines the port may transition to the forwarding state. BPDU data is still received in blocking state. Prevents the use of looped paths.
  • Listening - The switch processes BPDUs and awaits possible new information that would cause it to return to the blocking state. It does not populate the MAC address table and it does not forward frames.
  • Learning - While the port does not yet forward frames it does learn source addresses from frames received and adds them to the filtering database (switching database). It populates the MAC Address table, but does not forward frames.
  • Forwarding - A port receiving and sending data, normal operation. STP still monitors incoming BPDUs that would indicate it should return to the blocking state to prevent a loop.
  • Disabled - Not strictly part of STP, a network administrator can manually disable a port
  • Reference: wikipedia

    8/19/2013

    set the IPs and static route on ERX

    show the config on certain interface
    (config)# run show configuration interface gigabitEthernet X/X/X.YYY

    set the ip address subnet on certain interface
    (config)# interface gigabitEthernet X/X/X.YYY
    (config)# ip address 1.1.1.1 255.255.255.0 secondary

    set static route on router
    (config)#ip route 1.1.1.1/24 2.2.2.2
    or
    (config)#ip route 1.1.1.1/24 gigabitEthernet X/X/X.YYY


    setting targets:

    o. let certain subnet can access to internet

    8/02/2013

    python dictionary 入門

    >>> tel = {'jack': 4098, 'sape': 4139}
    >>> tel['guido'] = 4127
    >>> tel
    {'sape': 4139, 'guido': 4127, 'jack': 4098}
    >>> tel['jack']
    4098
    >>> del tel['sape']
    >>> tel['irv'] = 4127
    >>> tel
    {'guido': 4127, 'irv': 4127, 'jack': 4098}
    >>> tel.keys()
    ['guido', 'irv', 'jack']
    >>> 'guido' in tel
    True