Monthly Archives: February 2012

Python mysql fetch_row 手记

在python的mysql中, fetch_row 默认是不传递参数的, 只返回一条且没有column的数据tuple.

但是在仔细看了API文档之后, 发现有两个参数: num_results和display_column

num_result: 默认只显示一条, 当传入0时, 将显示全部数据. 否则根据你的数字显示数据条数
display_column: 默认不显示
1. 只显示column名
2. 显示格式为 table.column

Cisco catalyst configuring VLANs

一. 设置当前交换机为server模式
switch>enable
switch# configure t
switch(config)>vtp mode server
switch(config)>exit

二. 删除原先的vlan
switch>enable
switch# configure t
switch(config)>no vlan VLAN-ID
switch(config)>exit

三. 增加一个新的vlan
switch>enable
switch# configure t
switch(config)>vlan VLAN-ID
switch(config)>name VLAN-NAME
switch(config)>exit

比如

Switch# configure terminal
Switch(config)# vlan 20
Switch(config-vlan)# name test20
Switch(config-vlan)# end

四. 分配一个到指定的vlan

Switch# configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface gigabitethernet0/1 
Switch(config-if)# switchport mode access 
Switch(config-if)# switchport access vlan 2
Switch(config-if)# end 

五. 重载配置

copy running-config startup-config

六. 备忘录
vlan的id 比如10 20 30,这些你在网关上要对应,我这是使用的routeros。这样才能起到一个局域网内有不同的网段以及网段之间的阻隔。