2019年11月20日 星期三

When execute sh script under linux, /bin/sh^M:bad interpreter:No such file or directory

When execute sh script under linux, /bin/sh^M:bad interpreter:No such file or directory

Root Cause:
The file has been modify under windows.
#vim file name
:set ff
Check if fileformat=dos

Fixed:
:set ff=unix
:wq

Run script again.

2019年11月17日 星期日

Commad line flash BIOS/BMC fw(AMI code base)

Commad line flash BIOS/BMC fw

/Flash
Method
Command line (Local)
 
EFI Shell 
Windows
BIOS

AfuEfix64.efi BIOS.bin /b /p /n /x
afuwinx64.exe  BIOS.bin /b /p /n /x
BMC

socflash -s BMC.bin
yafuflash.exe -cd BMC.ima


FW /Flash
Method
Command line (Local)
Linux
BIOS./afulnx_64 BIOS.bin /b /p /n /x
BMC./yafuflash -cd BMC.ima -vyes
FW /Flash
Method
Command line (Remote)
Windows Client
BIOS
Grantley:
yafuflash.exe -nw -ip [BMC_IP] -u username -p password -bios BIOS.bin
Purley:
yafuflash.exe -d 2-nw -ip [BMC_IP] -u username -p password  BIOS.bin
BMCyafuflash.exe -nw -ip  [BMC_IP] -u username -p password -full BMC.ima

2019年11月13日 星期三

Windows remote shutdown/reboot

Windows remote shutdown/reboot

Reboot:
net use \\Remote IP /user:administrator password
shutdown -m \\\\Remote IP -r -f -t 3

Shutdown
net use \\Remote IP /user:administrator password

shutdown -m \\\\Remote IP -s -f -t 3

2019年11月12日 星期二

How to enable/disable ethernet by command under windows

How to enable/disable ethernet by command under windows


disable
netsh interface set interface "Ehternet" disabled

enable

netsh interface set interface "Ethernet" enabled

2019年11月11日 星期一

Reset BMC username/password by ipmitool locally

Reset BMC username/password by ipmitool locally


ipmitool raw 0x6 0x45 0x02 0x72 0x6F 0x6F 0x74 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
ipmitool raw 0x6 0x47 0x02 0x02 0x70 0x77 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
ipmitool raw 0x6 0x47 0x02 0x01
ipmitool raw 0x6 0x43 0x93 0x02 0x04 0x00
ipmitool raw 0x6 0x40 0x03 0x82 0x84
ipmitool raw 0x6 0x40 0x03 0x42 0x44


User will set to "root"

Password is "pw"

2019年11月6日 星期三

How to write a linux script with loop

How to write a linux script with loop


While true
do

XXXX (Command1)

sleep 2 
XXXX (Command2)


done

------------------------------------------
Add count with color


While true
do

XXXX (Command1)

sleep 2 
XXXX (Command2)

echo -e "\033[40;32m  "This is $count times." \033[0m"
count =$(($count+1))


done

(TOP)Temp for soulin only

123