Latest Posts

CentOS7 忘记Root密码解决方法


1- 在启动grub菜单,选择编辑选项启动

 

2 - 按键盘e键,来进入编辑界面

 

3 - 找到Linux 16的那一行,将ro改为rw init=/sysroot/bin/sh

 

4 - 现在按下 Control+x ,使用单用户模式启动

5 - 现在,可以使用下面的命令访问系统 chroot /sysroot

6 - 重置密码 passwd root

7 - 更新系统信息 touch /.autorelabel

8 - 退出chroot exit

9 - 重启你的系统 reboot


Read More

sg_ses中的STR格式 --clear=STR, --get=STR


 

 

STR FORMAT

The STR operands of the --clear=STR--get=STR and --set=STR options all have the same structure. There are two forms:

<acronym>[=<value>]

<start_byte>:<start_bit>[:<num_bits>][=<value>]

The <acronym> is one of a list of common fields (e.g. "ident" and "fault") that the utility converts internally into the second form. The <start_byte> is usually in the range 0 to 3, the <start_bit> must be in the range 0 to 7 and the <num_bits> must be in the range 1 to 64 (default 1). The number of bits are read in the left to right sense of the element tables shown in the various SES draft documents. For example the 8 bits of byte 2 would be represented as 2:7:8 with the most significant bit being 2:7 and the least sugnificant bit being 2:0 .

The <value> is optional but is ignored if provided to --get=STR. For --set=STR the default <value> is 1 while for --clear=STR the default value is 0 .

The supported list of <acronym>s can be viewed by using the --enumerate option twice (or "-ee").

#sg_ses -ee
--clear, --get, --set acronyms for Enclosure Status/Control ['es' or 'ec'] page:
  ac_fail  [Uninterruptible power supply] [2:4:1]
  ac_hi  [Uninterruptible power supply] [2:6:1]
  ac_lo  [Uninterruptible power supply] [2:7:1]
  ac_qual  [Uninterruptible power supply] [2:5:1]
  active  [Device slot] [2:7:1]
  active  [Array device slot] [2:7:1]
  batt_fail  [Uninterruptible power supply] [3:1:1]
  bpf  [Uninterruptible power supply] [3:0:1]
  bypa  [Device slot] [3:3:1]                 bypass port A
  bypa  [Array device slot] [3:3:1]           bypass port A
  bypb  [Device slot] [3:2:1]                 bypass port B
  bypb  [Array device slot] [3:2:1]           bypass port B
  conscheck  [Array device slot] [1:4:1]      consistency check
  ctr_link  [SAS connector] [2:7:8]           connector physical link
  ctr_type  [SAS connector] [1:6:7]           connector type
  current  [Current sensor] [2:7:16]          current in centiamps
  dc_fail  [Uninterruptible power supply] [2:3:1]
  disable  [*] [0:5:1]
  disable_elm  [SCSI port/transceiver] [3:4:1]  disable port/transceiver
  disable_elm  [Communication port] [3:0:1]   disable communication port
  devoff  [Device slot] [3:4:1]
  devoff  [Array device slot] [3:4:1]
  disp_mode  [Display] [1:1:2]
  disp_char  [Display] [2:7:16]
  dnr  [Array device slot] [2:6:1]            do not remove
  dnr  [Cooling] [1:6:1]                      do not remove
  dnr  [Device slot] [2:6:1]                  do not remove
  dnr  [Enclosure services controller electronics] [1:5:1]  do not remove
  dnr  [Power supply] [1:6:1]                 do not remove
  dnr  [Uninterruptible power supply] [3:3:1]  do not remove
  enable  [SCSI initiator port] [3:0:1]
  enable  [SCSI target port] [3:0:1]
  fail  [Audible alarm] [1:6:1]
  fail  [Communication port] [1:7:1]
  fail  [Cooling] [3:6:1]
  fail  [Current sensor] [3:6:1]
  fail  [Display] [1:6:1]
  fail  [Door] [1:6:1]
  fail  [Enclosure services controller electronics] [1:6:1]
  fail  [Key pad entry] [1:6:1]
  fail  [Nonvolatile cache] [3:6:1]
  fail  [Power supply] [3:6:1]
  fail  [SAS connector] [3:6:1]
  fail  [SAS expander] [1:6:1]
  fail  [SCC controller electronics] [3:6:1]
  fail  [SCSI initiator port] [1:6:1]
  fail  [SCSI port/transceiver] [1:6:1]
  fail  [SCSI target port] [1:6:1]
  fail  [Simple subenclosure] [1:6:1]
  fail  [Temperature sensor] [3:6:1]
  fail  [Uninterruptible power supply] [3:6:1]
  fail  [Voltage sensor] [1:6:1]
  failure_ind  [Enclosure] [2:1:1]
  failure  [Enclosure] [3:1:1]
  fault  [Device slot] [3:5:1]
  fault  [Array device slot] [3:5:1]
  hotspare  [Array device slot] [1:5:1]
  hotswap  [Cooling] [3:7:1]
  hotswap  [Enclosure services controller electronics] [3:7:1]
  hw_reset  [Enclosure services controller electronics] [1:2:1]  hardware reset
  ident  [Device slot] [2:1:1]                flash LED
  ident  [Array device slot] [2:1:1]          flash LED
  ident  [Power supply] [1:7:1]               flash LED
  ident  [Communication port] [1:7:1]         flash LED
  ident  [Cooling] [1:7:1]                    flash LED
  ident  [Current sensor] [1:7:1]             flash LED
  ident  [Display] [1:7:1]                    flash LED
  ident  [Door] [1:7:1]                       flash LED
  ident  [Enclosure services controller electronics] [1:7:1]  flash LED
  ident  [Enclosure] [1:7:1]                  flash LED
  ident  [Key pad entry] [1:7:1]              flash LED
  ident  [Language] [1:7:1]                   flash LED
  ident  [Audible alarm] [1:7:1]
  ident  [Nonvolatile cache] [1:7:1]          flash LED
  ident  [SAS connector] [1:7:1]              flash LED
  ident  [SAS expander] [1:7:1]               flash LED
  ident  [SCC controller electronics] [1:7:1]  flash LED
  ident  [SCSI initiator port] [1:7:1]        flash LED
  ident  [SCSI port/transceiver] [1:7:1]      flash LED
  ident  [SCSI target port] [1:7:1]           flash LED
  ident  [Simple subenclosure] [1:7:1]        flash LED
  ident  [Temperature sensor] [1:7:1]         flash LED
  ident  [Uninterruptible power supply] [3:7:1]  flash LED
  ident  [Voltage sensor] [1:7:1]             flash LED
  incritarray  [Array device slot] [1:3:1]
  infailedarray  [Array device slot] [1:2:1]
  info  [Audible alarm] [3:3:1]               emits warning tone when set
  insert  [Device slot] [2:3:1]
  insert  [Array device slot] [2:3:1]
  intf_fail  [Uninterruptible power supply] [2:0:1]
  language  [Language] [2:7:16]               language code
  locate  [Device slot] [2:1:1]               flash LED
  locate  [Array device slot] [2:1:1]         flash LED
  locate  [Power supply] [1:7:1]              flash LED
  locate  [Communication port] [1:7:1]        flash LED
  locate  [Cooling] [1:7:1]                   flash LED
  locate  [Current sensor] [1:7:1]            flash LED
  locate  [Display] [1:7:1]                   flash LED
  locate  [Door] [1:7:1]                      flash LED
  locate  [Enclosure services controller electronics] [1:7:1]  flash LED
  locate  [Enclosure] [1:7:1]                 flash LED
  locate  [Key pad entry] [1:7:1]             flash LED
  locate  [Language] [1:7:1]                  flash LED
  locate  [Audible alarm] [1:7:1]
  locate  [Nonvolatile cache] [1:7:1]         flash LED
  locate  [SAS connector] [1:7:1]             flash LED
  locate  [SAS expander] [1:7:1]              flash LED
  locate  [SCC controller electronics] [1:7:1]  flash LED
  locate  [SCSI initiator port] [1:7:1]       flash LED
  locate  [SCSI port/transceiver] [1:7:1]     flash LED
  locate  [SCSI target port] [1:7:1]          flash LED
  locate  [Simple subenclosure] [1:7:1]       flash LED
  locate  [Temperature sensor] [1:7:1]        flash LED
  locate  [Uninterruptible power supply] [3:7:1]  flash LED
  locate  [Voltage sensor] [1:7:1]            flash LED
  lol  [SCSI port/transceiver] [3:1:1]        Loss of Link
  mated  [SAS connector] [3:7:1]
  missing  [Device slot] [2:4:1]
  missing  [Array device slot] [2:4:1]
  mute  [Audible alarm] [3:6:1]               control only: mute the alarm
  muted  [Audible alarm] [3:6:1]              status only: alarm is muted
  off  [Power supply] [3:4:1]                 Not providing power
  off  [Cooling] [3:4:1]                      Not providing cooling
  offset_temp  [Temperature sensor] [1:5:6]   Offset for reference temperature
  ok  [Array device slot] [1:7:1]
  on  [Cooling] [3:5:1]
  on  [Power supply] [3:5:1]                  0: turn (remain) off; 1: turn on
  open  [Door] [3:1:1]
  overcurrent  [Current sensor] [1:1:1]       overcurrent
  overcurrent  [Power supply] [2:1:1]         DC overcurrent
  overcurrent  [SAS connector] [3:5:1]
  overcurrent_warn  [Current sensor] [1:3:1]  overcurrent warning
  overtemp_fail  [Temperature sensor] [3:3:1]  Overtemperature failure
  overtemp_warn  [Temperature sensor] [3:2:1]  Overtemperature warning
  overvoltage  [Power supply] [2:3:1]         DC overvoltage
  overvoltage  [Voltage sensor] [1:1:1]       overvoltage
  overvoltage_warn  [Power supply] [1:3:1]    DC overvoltage warning
  pow_cycle  [Enclosure] [2:7:2]              0: no; 1: start in pow_c_delay minutes; 2: cancel
  pow_c_delay  [Enclosure] [2:5:6]            delay in minutes before starting power cycle (max: 60)
  pow_c_duration  [Enclosure] [3:7:6]         0: power off, restore within 1 minute; <=60: restore within that many minutes; 63: power off, wait for manual power on
  pow_c_time  [Enclosure] [2:7:6]             time in minutes remaining until starting power cycle; 0: not scheduled; <=60: scheduled in that many minutes; 63: in zero minutes
  prdfail  [*] [0:6:1]                        predict failure
  rebuildremap  [Array device slot] [1:1:1]
  remove  [Device slot] [2:2:1]
  remove  [Array device slot] [2:2:1]
  remind  [Audible alarm] [3:4:1]
  report  [Enclosure services controller electronics] [2:0:1]
  report  [SCC controller electronics] [2:0:1]
  report  [SCSI initiator port] [2:0:1]
  report  [SCSI target port] [2:0:1]
  rqst_mute  [Audible alarm] [3:7:1]          status only: alarm was manually muted
  rqst_override  [Temperature sensor] [3:7:1]  Request(ed) override
  rrabort  [Array device slot] [1:0:1]        rebuild/remap abort
  rsvddevice  [Array device slot] [1:6:1]     reserved device
  select_element  [Enclosure services controller electronics] [2:0:1]
  short_stat  [Simple subenclosure] [3:7:8]   short enclosure status
  size  [Nonvolatile cache] [2:7:16]
  speed_act  [Cooling] [1:2:11]               actual speed (rpm / 10)
  speed_code  [Cooling] [3:2:3]               0: leave; 1: lowest... 7: highest
  size_mult  [Nonvolatile cache] [1:1:2]
  swap  [*] [0:4:1]
  sw_reset  [Enclosure services controller electronics] [1:3:1]  software reset
  temp  [Temperature sensor] [2:7:8]          (Requested) temperature
  unlock  [Door] [3:0:1]
  undertemp_fail  [Temperature sensor] [3:1:1]  Undertemperature failure
  undertemp_warn  [Temperature sensor] [3:0:1]  Undertemperature warning
  undervoltage  [Power supply] [2:2:1]        DC undervoltage
  undervoltage  [Voltage sensor] [1:0:1]      undervoltage
  undervoltage_warn  [Power supply] [1:2:1]   DC undervoltage warning
  ups_fail  [Uninterruptible power supply] [2:2:1]
  urgency  [Audible alarm] [3:3:4]
  voltage  [Voltage sensor] [2:7:16]          voltage in centivolts
  warning  [Uninterruptible power supply] [2:1:1]
  warning  [Enclosure] [3:0:1]
  warning_ind  [Enclosure] [2:0:1]
  xmit_fail  [SCSI port/transceiver] [3:0:1]  Transmitter failure

--clear, --get, --set acronyms for Threshold In/Out ['th'] page:
  high_crit  [*] [0:7:8]
  high_warn  [*] [1:7:8]
  low_crit  [*] [2:7:8]
  low_warn  [*] [3:7:8]

--get acronyms for Additional Element Status ['aes'] page (SAS EIP=1):
  at_sas_addr  [*] [12:7:64]
  dev_type  [*] [8:6:3]             1: SAS/SATA dev, 2: expander
  dsn  [*] [7:7:8]                  device slot number (255: none)
  num_phys  [*] [4:7:8]             number of phys
  phy_id  [*] [28:7:8]
  sas_addr  [*] [20:7:64]
  sata_dev  [*] [11:0:1]
  sata_port_sel  [*] [11:7:1]
  smp_init  [*] [10:1:1]
  smp_targ  [*] [11:1:1]
  ssp_init  [*] [10:3:1]
  ssp_targ  [*] [11:3:1]
  stp_init  [*] [10:2:1]
  stp_targ  [*] [11:2:1]

 


Read More

linux下的ls*命令


linux下有各种ls命令,都是list出某些内容。

ls  
lsmod  
lsblk  
lscpu  
lsof  
lspci  
lsusb  
lsscsi  

 


Read More

AMI BMC 串口下通过查看文件确定FW版本和产品型号的方法


AMI BMC 串口下通过查看文件确定FW版本和产品型号的方法。

在BMC下,登录串口,然后查找两个文件,一个是FwInfo文件,另外一个是FRU.bin文件。

文件名称比较容易记住,但路径比较难记。可以进行查找,然后进行cat查看文件。

 

#cd /
#find | grep -i FwInfo
./proc/ractrends/Helper/FwInfo2
./proc/ractrends/Helper/FwInfo1
./proc/ractrends/Helper/FwInfo
#cat ./proc/ractrends/Helper/FwInfo
FW_VERSION=*.*.*
FW_DATE=*** ** ****
FW_BUILDTIME=16:47:49 CST
FW_DESC=RR11-5 AST2500 EMMC KERN3 UPDATE BUILD 1
FW_PRODUCTID=1
FW_RELEASEID=RR9
FW_CODEBASEVERSION=X.X

#find | grep -i FRU

./etc/defconfig/BMC1/ast2500evb_ami/BMC1/ast2500evb_ami/FRU.bin
./etc/defconfig/BMC1/ast2500evb_ami/BMC1/ast2500evb_ami/FRU_BAK.bin

# cat FRU.bin 
COMPANY PRODUCT defconfig/BMC1/ast2500evb_ami

 


Read More

string termination error 解决方案之strlen函数


1:strlen函数是不安全的。

2:strnlen不是strlen的安全函数,

3:可以使用以下的函数作为strlen的安全函数

 

size_t safe_strlen(const char *str, size_t max_len)
{
    const char * end = (const char *)memchr(str, '\0', max_len);
    if (end == NULL)
        return max_len;
    else
        return end - str;
}

 


Read More

Edge浏览器自动给数字、IP地址加下划线


Edge浏览器自动给数字、IP地址加下划线。

尤其是IP地址,不仔细看的话,以为是加了一个链接,实际不是,点击这个链接,会弹出一个对话框,让你选中打开方式。

这种情况下,一般是Edge认为是识别到了一个电话号码。

telephone

解决方法是在HTML文件中增加下面一行:

 
 
<meta name="format-detection" content="telephone=no">

类似的选项共有3个。

- meta name=”format-detection” content=”telephone=no”
- meta name=”format-detection” content=”email=no”
- meta name=”format-detection” content=”adress=no”

telephone
主要作用是是否设置自动将你的数字转化为拨号连接
telephone=no 禁止把数字转化为拨号链接
telephone=yes 开启把数字转化为拨号链接,默认开启

email
告诉设备不识别邮箱,点击之后不自动发送
email=no 禁止作为邮箱地址
email=yes 开启把文字默认为邮箱地址,默认情况开启

adress
adress=no 禁止跳转至地图
adress=yes 开启点击地址直接跳转至地图的功能, 默认开启
 

 


Read More

在java7中使能TLS1.2


TSL1.2在Java8中默认是选中的,在Java7中默认是不选中。

不选中的情况下,某些软件无法使用,比如BMC的Java KVM功能。

修改方法是:

1:从菜单找到java control,或者找到java目录,执行jcontrol

2:在advanced标签下,选中enable tls1.1,以及enable tls1.2

 

jcontrol tls1.2


Read More

Git Your branch is ahead of 'origin/master' by X commits费事不费心解决方法


现象描述:有时候混合使用git gerrit,代码已经push,但还提示ahead,再次提示又担心出现问题。

#git pull

Already up-to-date

#git status ./

On branch master

Your branch is ahead of 'origin/master' by X commits

 

解决方法:

1:将代码复制到另外一个地方进行备份。

2:进行代码回退,修改会丢失,git reset --hard HEAD~x

3:然后再次查看git status,如果Your branch is behind of 'origin/master' by X commits,使用git pull再次更新

3:用备份代码与当前代码比较,重新commit,重新push。

 

注:x换成具体的数值。


Read More


© 2008-2022 CunYouLu存有录博客 村友录 存游录 鲁ICP备08005943号