公司要上IDS,所以要在交换机上将24端口做一个镜像,映射到23口上,并将IDS接到23口。
monitor session 1 source interface Gi1/0/24
monitor session 1 destination interface Gi1/0/23
公司要上IDS,所以要在交换机上将24端口做一个镜像,映射到23口上,并将IDS接到23口。
monitor session 1 source interface Gi1/0/24
monitor session 1 destination interface Gi1/0/23
两种权限模式
user-view和system-view,退出system-view输入quit或ctrl+z
user-view可以进行的操作很小,可用的命令有:
debugging Enable system debugging functions display Display current system information ping Ping function quit Exit from current command view reboot Reset switch reset Reset operation save Save current configuration #保存当前配置到EEPROM system-view Enter the system view undo Cancel current setting
进行配置基本上都在system-view下进行,可用的命令有:
display Display current system information interface Specify the interface configuration view link-aggregation Ports aggregation mode mac-address Configure MAC address mirroring-port Specify mirroring port monitor-port Specify monitor port ping Ping function qos QOS configuration information queue-scheduler Specify queue scheduling mode and parameters quit Exit from current command view restore Restore configuration return Exit to user view super Modify super password parameters sysname Specify the host name storm-control Limit the rate of the specified packets of the switch snmp-agent Specify SNMP(Simple Network Management Protocol) configuration information undo Cancel current setting user-interface Enter user interface view vlan Configure VLAN
system-view下修改密码
super password bigadmin 这个是进入system-view及网页管理界面的密码
set authentication password admin 这个是telnet的密码
设置主机名
sysname hostnameofswitch
查看交换机运行信息
[SW4_R2_R2]display version H3C S5024P Product Version S5024P-R0109 Copyright (c) 2004-2009 Hangzhou H3C Technologies Co., Ltd. All rights Reserved. H3C S5024P uptime is 8 week(s),2 day(s),15 hour(s),17 minute(s) H3C S5024P with 17M 8051 Processor 128K bytes SDRAM 2048K bytes Flash Memory Config Register points to EEPROM Hardware Version is Ver.1.0 Bootrom Version is 100 [Subslot 0] 24 GE(4 COMBO) Hardware Version is Ver.1.0
查看聚合信息
display link-aggregation GigabitEthernet 0/21
查看学习到的mac地址
display mac-address
设置snmp-agent信息
snmp-agent community read abcdefg
h3c s5024p重置交换机
system-view下
[H3C]restore default This will restore the default configuration in the EEPROM memory Are you sure?[Y/N]y *** Restoring to default configuration... *** Restore default configuration successfully! Reboot the switch to activate the default configuration!
其他h3c交换机重置
reset saved-configuration reboot
enable -a显示当前用户可用的命令
less -N abc.txt 显示行号
ls 1>/dev/null 2>/dev/null 把标准输出和标准错误都定向到/dev/null
if [ `id -u` -ne "0" ]; then echo "ERROR: This script must be run as root." 1>&2 exit 1 fi
检查硬盘通电时间
安装 smartmontools ,包含有smartctl命令,
smartctl -A -v 9,msec24hour32 /dev/sda
-v 9,msec24hour32表示将第9行显示的标准从毫秒转为小时
结果是
9 Power_On_Hours 0x0032 100 100 000 Old_age Always – 41h+37m+34.450s
sftp使用不同于默认端口连接服务器
sftp -oPort=222 [email protected]
以下脚本是读取以空格分开的字段(weight.txt)变成以逗号分隔(weight.csv)
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# author jpuyy.com
import csv
reader = csv.reader(open('weight.txt', 'rb'), delimiter=' ', quoting=csv.QUOTE_NONE)
writer = csv.writer(open('weight.csv', 'wb'))
for row in reader:
writer.writerow(row)
解决 csv 用 excel 打开乱码问题
import codecs file_obj = open(csv_name, "wb+") file_obj.write(codecs.BOM_UTF8) f = csv.writer(file_obj)
04年家里有了电脑,05年上网,到今年有8个年头了。
早在07年就使用淘宝购物,使用支付宝
08年就接触php,discuz
毕业一年多了,从事IT,感觉快要成为一个废柴,一只脚已经站在废柴堆里了。
IT这行,面太大了,现在搞linux,网络,每一个细小的方向都需要一大堆知识。如果转编程,又有更多的方向和路线。很早之前就听人说要精一门需要一万个小时,到现在视力下降,目标却还是在飘移。看看自己的博客,这么多分类目录,没有一个关注点。
问题是:只允许一种选择的方向。
已经深深的感受到:干IT如果不会编程,那永远是个二流货色。(这句话只适用于我自己)
一方面需要尽快定位好如何去提升技术,提高自己被替代的技术壁垒,因为总有比你更年轻,更有时间精力,更能接受低价格的人去取代你;另一方面,想办法将技术转化为金钱,有金钱不光可以使生活过的好一些,还意味着可以尝试更大的梦想。
毕业一年多以来,了解同学的情况,自然而然要进行比较。小结一下:
各行各业都不好干,但是有兴趣确实能让人在这行走的更远
既然没有稳定的不愁吃住的工作,那就需要有强大的应变不稳定的能力,而这些不稳定确实有压力,冒险,刺激,需要玩的起,而且离钱很近。
最有风险的职业,也是离钱最近的,比如抢银行很有风险,但搞成了直接拿到的是现金。销售等职位,离钱最近。
IT的技术职位离钱很远,做不到精通,还不如转行,生活不可能不需要钱。既然是青春饭,就要在青春时把青春饭吃好。
dhcp的全称是Dynamic Host Configuration Protocol
dhclient则是Dynamic Host Configuration Protocol client
使用dhclient重新在dhcp服务器攻取ip地址
dhclient -r eth0 ifconfig eth0 down ifconfig eth0 up dhclient eth0
经过上面操作,就会获取到新的ip地址。
centos6的dhclient的信息缓存在/var/lib/dhclient/dhclient-*.leases