查看网线是否接上及mii-tool使用(转)
==================================Debian=======================================
1、发行版本
cat /etc/debian_version
5.0.2
2、内核
uname -r
2.6.18-6-amd64
3、机型
dmidecode -s system-product-name
PowerEdge R710
4、安装软件包
apt-get -y install net-tools
5、使用ip命令查看网络接口状态
1)ip a
1: lo:
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0:
link/ether 84:2b:2b:48:ab:12 brd ff:ff:ff:ff:ff:ff
3: eth1:
link/ether 84:2b:2b:48:ab:14 brd ff:ff:ff:ff:ff:ff
inet 192.168.35.133/24 brd 192.168.35.255 scope global eth1
4: eth2:
link/ether 84:2b:2b:48:ab:16 brd ff:ff:ff:ff:ff:ff
5: eth3:
link/ether 84:2b:2b:48:ab:18 brd ff:ff:ff:ff:ff:ff
查看结果是eth1已经有ip 但eth0还没有ip及网络接口也没有打开
2)参数说明
qdisc pfifo_fast #Priority queueing
qlen #默认接口传输队列的默认长度
mtu #最大传输单元
qdisc noop #表示网络接口还没有up状态
up #设备处于运行状态,能接收和发送数据包
down #设备处于关闭状态,不能接收和发送数据包
qdisc mq #Multiqueue
6、如果没打开eth0网络接口的话使用mii-tool命令后结果是这样的
mii-tool
SIOCGMIIPHY on ‘eth0′ failed: Resource temporarily unavailable
eth1: negotiated 1000baseT-FD flow-control, link ok
SIOCGMIIPHY on ‘eth2′ failed: Resource temporarily unavailable
SIOCGMIIPHY on ‘eth3′ failed: Resource temporarily unavailable
7、使用ifconfig命令打开eth0网络接口
ifconfig eth0 up
8、再次使用mii-tool命令查看网线是否连接,这次看到显示eth0是no link状态 判定网线没接上
eth0: no link
eth1: negotiated 1000baseT-FD flow-control, link ok
eth2: no link
eth3: no link
9、找idc工程师让他们接上网线
==================================Centos=======================================
1、发行版本
cat /etc/redhat-release
CentOS release 6.5 (Final)
2、内核
uname -r
2.6.32-431.el6.x86_64
3、机型
dmidecode -s system-product-name
PowerEdge R610
4、安装软件包
yum -y install net-tools
5、使用ip命令查看网络接口状态
ip a
1: lo:
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0:
link/ether 00:22:19:63:97:5e brd ff:ff:ff:ff:ff:ff
inet 111.222.333.444/24 brd 111.222.333.444 scope global eth0
inet6 fe80::222:19ff:fe63:975e/64 scope link
valid_lft forever preferred_lft forever
3: eth1:
link/ether 00:22:19:63:97:60 brd ff:ff:ff:ff:ff:ff
inet 10.18.22.190/24 brd 10.18.22.255 scope global eth1
inet6 fe80::222:19ff:fe63:9760/64 scope link
valid_lft forever preferred_lft forever
4: eth2:
link/ether 00:22:19:63:97:62 brd ff:ff:ff:ff:ff:ff
inet 111.222.333.444/25 brd 111.222.333.444 scope global eth2
inet6 fe80::222:19ff:fe63:9762/64 scope link
valid_lft forever preferred_lft forever
5: em4:
link/ether 00:22:19:63:97:64 brd ff:ff:ff:ff:ff:ff
6、如果没打开em4网络接口的话使用mii-tool命令后结果是这样的
mii-tool em4
SIOCGMIIPHY on ‘em4′ failed: Resource temporarily unavailable
7、使用ifconfig命令打开eth0网络接口
ifconfig em4 up
8、找idc工程师让他们接上网线后查看
mii-tool em4
em4: negotiated 100baseTx-FD flow-control, link ok
参考文章
http://events.linuxfoundation.org/sites/events/files/slides/Linux_traffic_control.pdf
“流量监管”和”流量整形”的区别
“流量监管” (Traffic Policing) 就是对流量进行控制,通过监督进入交换机端口的流量速率,对超出部分的流量进行”惩罚” (采用监管方式时是直接丢弃),使进入端口的流量被限制在一个合理的范围之内。例如可以限制HTTP报文不能占用超过50%的网络带宽,否则QoS流量监管功能可以选择丢弃报文,或重新配置报文的优先级。
“流量整形”为控制最大输出通信速率提供可能,以确保通信符合配置的最大传输速率规定。符合某种配置的通信可能被整形,以使它符合下游设备的通信速率需求,处理任何失配的数据传输速率。流量整形通常使用缓冲区和令牌桶来完成,当报文的发送速率过快时,首先在缓冲区进行缓存,在令牌桶的控制下再均匀地发送这些被缓冲的报文。当下游设备的接口速率小于上游设备的端口速率或发生突发流量时,在下游设备入端口处可能出现流量拥塞的情况。此时用户可以通过在下游设备的出端口配置流量整形将上游不规整的流量进行削峰填谷,输出一条比较平整的流量,从而解决下游设备的拥塞问题。流量整形是一种可应用于接口、子接口或队列的流量控制技术,可以对从接口上经过的所有报文或某类报文进行速率限制
流量整形和流量监管都是作用于网络边缘,对进入设备端口的流量进行的一种处理方式。它们的主要区别在于:流量监管直接丢弃不符合速率要求的报文,丢弃的报文比较多,可能引发重传;而流量整形是将不符合速率要求的报文先行缓存,当令牌桶有足够的令牌时再均匀地向外发送这些被缓存的报文,较少丢弃报文,但引入时延和抖动,需要较多的缓冲资源缓存报文 。所以这两种功能的应用领域也不尽相同,流量监管适用于对丢弃率不敏感,而对时延和抖动比较敏感的网络应用,如一些普通的话音和视频通信;流量整形适用于对时延和抖动不敏感的网络应用,如数据传输、 www 访问等 。
CentOS7使用firewalld打开关闭防火墙与端口
1、firewalld的基本使用
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl –failed
3.配置firewalld-cmd
查看版本: firewall-cmd –version
查看帮助: firewall-cmd –help
显示状态: firewall-cmd –state
查看所有打开的端口: firewall-cmd –zone=public –list-ports
更新防火墙规则: firewall-cmd –reload
查看区域信息: firewall-cmd –get-active-zones
查看指定接口所属区域: firewall-cmd –get-zone-of-interface=eth0
拒绝所有包:firewall-cmd –panic-on
取消拒绝状态: firewall-cmd –panic-off
查看是否拒绝: firewall-cmd –query-panic
那怎么开启一个端口呢
添加
firewall-cmd –zone=public –add-port=80/tcp –permanent (–permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd –reload
查看
firewall-cmd –zone= public –query-port=80/tcp
删除
firewall-cmd –zone= public –remove-port=80/tcp –permanent
如何破解EXCEL工作表保护密码忘记密码怎么办(转)
1.新建一个EXCEL工作表,而后点击另存为,讲表格保存为启用宏的工作表.
2.一次点击开发工具—录制新宏,在弹出的对话框内修改宏名称而后确定.
3.依次点击开发工具—-停止录制宏,宏录制完成.
4.依次点击开发工具,—宏—-在弹出的对话框找到我们刚才录制的宏名称而后进入VBA界面.
5.在VBA界面,全选里面的代码,而后删除,讲里面的代码全部删除完.
代码复制到VBA编辑窗口内
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | Public Sub AllInternalPasswords() ' Breaks worksheet and workbook structure passwords. Bob McCormick ' probably originator of base code algorithm modified for coverage ' of workbook structure / windows passwords and for multiple passwords ' ' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1) ' Modified 2003-Apr-04 by JEM: All msgs to constants, and ' eliminate one Exit Sub (Version 1.1.1) ' Reveals hashed passwords NOT original passwords Const DBLSPACE As String = vbNewLine & vbNewLine Const AUTHORS As String = DBLSPACE & vbNewLine & _ "Adapted from Bob McCormick base code by" & _ "Norman Harker and JE McGimpsey" Const HEADER As String = "AllInternalPasswords User Message" Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04" Const REPBACK As String = DBLSPACE & "Please report failure " & _ "to the microsoft.public.excel.programming newsgroup." Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _ "now be free of all password protection, so make sure you:" & _ DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _ DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _ DBLSPACE & "Also, remember that the password was " & _ "put there for a reason. Don't stuff up crucial formulas " & _ "or data." & DBLSPACE & "Access and use of some data " & _ "may be an offense. If in doubt, don't." Const MSGNOPWORDS1 As String = "There were no passwords on " & _ "sheets, or workbook structure or windows." & AUTHORS & VERSION Const MSGNOPWORDS2 As String = "There was no protection to " & _ "workbook structure or windows." & DBLSPACE & _ "Proceeding to unprotect sheets." & AUTHORS & VERSION Const MSGTAKETIME As String = "After pressing OK button this " & _ "will take some time." & DBLSPACE & "Amount of time " & _ "depends on how many different passwords, the " & _ "passwords, and your computer's specification." & DBLSPACE & _ "Just be patient! Make me a coffee!" & AUTHORS & VERSION Const MSGPWORDFOUND1 As String = "You had a Worksheet " & _ "Structure or Windows Password set." & DBLSPACE & _ "The password found was: " & DBLSPACE & "$$" & DBLSPACE & _ "Note it down for potential future use in other workbooks by " & _ "the same person who set this password." & DBLSPACE & _ "Now to check and clear other passwords." & AUTHORS & VERSION Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _ "password set." & DBLSPACE & "The password found was: " & _ DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _ "future use in other workbooks by same person who " & _ "set this password." & DBLSPACE & "Now to check and clear " & _ "other passwords." & AUTHORS & VERSION Const MSGONLYONE As String = "Only structure / windows " & _ "protected with the password that was just found." & _ ALLCLEAR & AUTHORS & VERSION & REPBACK Dim w1 As Worksheet, w2 As Worksheet Dim i As Integer, j As Integer, k As Integer, l As Integer Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer Dim PWord1 As String Dim ShTag As Boolean, WinTag As Boolean Application.ScreenUpdating = False With ActiveWorkbook WinTag = .ProtectStructure Or .ProtectWindows End With ShTag = False For Each w1 In Worksheets ShTag = ShTag Or w1.ProtectContents Next w1 If Not ShTag And Not WinTag Then MsgBox MSGNOPWORDS1, vbInformation, HEADER Exit Sub End If MsgBox MSGTAKETIME, vbInformation, HEADER If Not WinTag Then MsgBox MSGNOPWORDS2, vbInformation, HEADER Else On Error Resume Next Do 'dummy do loop For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 With ActiveWorkbook .Unprotect Chr(i) & Chr(j) & Chr(k) & _ Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _ Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) If .ProtectStructure = False And _ .ProtectWindows = False Then PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) MsgBox Application.Substitute(MSGPWORDFOUND1, _ "$$", PWord1), vbInformation, HEADER Exit Do 'Bypass all for...nexts End If End With Next: Next: Next: Next: Next: Next Next: Next: Next: Next: Next: Next Loop Until True On Error GoTo 0 End If If WinTag And Not ShTag Then MsgBox MSGONLYONE, vbInformation, HEADER Exit Sub End If On Error Resume Next For Each w1 In Worksheets 'Attempt clearance with PWord1 w1.Unprotect PWord1 Next w1 On Error GoTo 0 ShTag = False For Each w1 In Worksheets 'Checks for all clear ShTag triggered to 1 if not. ShTag = ShTag Or w1.ProtectContents Next w1 If ShTag Then For Each w1 In Worksheets With w1 If .ProtectContents Then On Error Resume Next Do 'Dummy do loop For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 .Unprotect Chr(i) & Chr(j) & Chr(k) & _ Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) If Not .ProtectContents Then PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) MsgBox Application.Substitute(MSGPWORDFOUND2, _ "$$", PWord1), vbInformation, HEADER 'leverage finding Pword by trying on other sheets For Each w2 In Worksheets w2.Unprotect PWord1 Next w2 Exit Do 'Bypass all for...nexts End If Next: Next: Next: Next: Next: Next Next: Next: Next: Next: Next: Next Loop Until True On Error GoTo 0 End If End With Next w1 End If MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER End Sub |
点击保存
点击开发工具,宏,找到我们刚才录制的宏,点击执行宏
而后,在弹出的所有对话框上,都点击确定,都确定,1分钟后,就可以编辑了
本方法仅适用于2007-2016,2003版本没有开发工具
修复win10 F8无法进入安全模式的方法
windwos的操作系统中一个模式叫做安全模式,很多无法在开机时修复的故障或是设置都可以进入到安全模式中处理。小编最近在使用win10系统的时候经常会遇到这样的情况,关机重启之后按下F8按钮电脑不会有任何的反应,依旧是正常的开机,无法打开系统中的安全模式,这是什么回事呢?大家在遇到这样的故障是不用太过担心,我们使用一个命令语句就可以解决这个问题。
随后将下面的代码复制粘贴进去,然后按下回车键进行执行!
bcdedit set {default} bootmenupolicy legac
等待系统自动执行完毕之后大家可以重新关闭电脑,此时再次使用F8按键就可以进入到安全模式中去了!PS:有的用户担心错过按下F8的机会,可以一直连续点击,这样就可以进入到提示界面了!
宝塔面板安装好后,默认ip访问的那个html页面在哪个文件夹?
宝塔面板很好用。大家都知道不过有些默认的选择项目也给大家说一下。
宝塔面板ip地址默认访问页在此目录下(默认安装的是NMP环境就在如下路径中)
/www/server/nginx/html/
删除掉index.html或是改名不就可以不用出现访问ip地址时的尴尬了。因为别人一看就知道你是哪个面板了。
windows server 2016 标准版 升级到 数据中心版
windows server 2016 标准版 升级到 数据中心版
dism /online /set-edition:ServerDatacenter /productkey:CB7KF-BWN84-R7R2Y-793K2-8XDDG /AcceptEula
cmd复制下那个命令直接运行,等跑完百分比就ok了。
centos7重新调整分区大小
cenos 7 最小化安装完成后,分区是自动的。默认都会很多分到home目录,这很不合理。建议一般大家都分给/目录,也就是根目录。这样比较方便。
查看磁盘的空间大小: df -h
备份/home : cp -r /home/ homebak/
卸载 /home : umount /home
如果出现 home 存在进程,使用 fuser -m -v -i -k /home 终止 home 下的进程,最后使用 umount /home 卸载 /home
删除/home所在的lv : lvremove /dev/mapper/centos-home
扩展/root所在的lv,增加4430G : lvextend -L +4430G /dev/mapper/centos-root
扩展/root文件系统 : xfs_growfs /dev/mapper/centos-root
重新创建home lv : lvcreate -L 167G -n home centos
重新创建home lv 分区的大小,根据 vgdisplay 中的free PE 的大小确定
创建文件系统: mkfs.xfs /dev/centos/home
挂载 home: mount /dev/centos/home /home
重新调整大小后,/home 下的东西将丢失,注意做好备份。。。
ssh 连接缓慢解决方法
瞬间登陆。。。
vi /etc/ssh/sshd_config
关闭 SSH 的 DNS 反解析,添加下面一行:
UseDNS no
虽然配置文件中[UseDNS yes]被注释
但默认开关就是yes。。。SSH服务默认启用了DNS反向解析的功能
CentOS7 linux系统中修改swap虚拟内存大小
linux中安装oracle的时候要求swap是ram的1.5倍。自己部署的虚拟机linux系统,通过free命令查看,该要求不达标,需要手动调整swap
用命令cd /usr,先进入usr路径中
在usr路径中,新建一个文件夹swap
命令为:mkdir swap,创建后用ls命令可以看到新创建的swap文件夹
创建后进行进入到该swap文件夹路径,命令为:cd /swap,用命令ll查看使用量为0
这里我们创建swap文件,命令为:dd if=/dev/zero of=swapfile bs=1G count=3
这条命令从硬盘里分出一个1×3G 大小的空间,挂在swapfile上。
常见swapfile文件完成后,用命令ll查看用量为3G
也可以用命令:du -sh /usr/swap/swapfile命令查看文件大小
swapfile文件创建后,需要构建swap格式于/usr/swap/swapfile 上
命令为:mkswap /usr/swap/swapfile
用命令激活swap,立即启用交换分区文件
命令为:swapon /usr/swap/swapfile
但是这样的设置重启后就失效了,为了保证每次启动都能启用该交换空间,需要手动编辑文件/etc/fstab中的swap行
命令为:vi /etc/fstab
将原来的一行注释掉,添加命令行:
/usr/swap/swapfile swap swap defaults 0 0
重启centos后,用free查看,swap就是设置后的3G了