고객사 방문하여 작업 중 접해서 당혹스러운 상황에 다행히도 도움을 받아 해결했지만, 잊지 않도록(?) 기록해두기 ...

1. Check
# vi -b <% file name %>

2. Remove
:%s/^M$//g
Note. '^M' = <Ctrl> + <V> + <M>
         Not! '^'+'M'


Windows/DOS : CRLF(Carriage return) 조합으로 줄바꿈을 정의 (커서의 위치를 앞으로 이동)
Unix/Linux/C : LF(Line Feed) 만으로 줄바꿈을 정의 (현재 위치에서 바로 아래로 이동)

이로 인해(개행 방식 차이), 윈도우에서 작성된 것을 Unix/Linux 계열로 올리면 vi로 편집시 ^M이 붙는 경우가 발생함.

- ftp를 통해 전송하면 방식이 텍스트/2진 중 어떤 것을 이용하는가에 따라 달라질 수 있음
-- 텍스트 방식으로 전송하면 데이터 변환이 생겨 '/r/n' > '/n' 으로 됨. 
-- 2진 모드로 전송하면 변환이 생기지 않아, 윈도우에서 작성된 파일이 컴파일이 안되거나 script작성 된것이 동작 안할 수 있음

vi:
:%s/^M//g

tr(translate):
tr -d ^M <% file %> <% newfile %>

sed(stream editor):
sed 's/^M//g' <% file %> >  <% newfile %>

 

 

참조자료:

server-engineer.tistory.com/482

jink1982.tistory.com/123

misctechmusings.com/remove-ctrl-m-characters-linux

 

 

 

 

반응형
Posted by 스쳐가는인연

댓글을 달아 주세요

tar 분할 압축 해제

 

Syntax: tar cvf(z) - 대상디렉토리or파일 | split -b 용량 - 분할압축파일명

# tar cvf - /tmp | split -b 3000m - ahs_dump.tar

ahs_dump.taraa
ahs_dump.tarab
ahs_dump.tarac
ahs_dump.tarad

 

# cat ahs_dump.tar* | tar zxvf -

출처: https://frody.tistory.com/5

반응형
Posted by 스쳐가는인연

댓글을 달아 주세요

OS Event log - messages

Oct 14 07:09:07 Hostname kernel: ACPI Error: SMBus/IPMI/GenericSerialBus write requires Buffer of length 66, found length 32 (20130517/exfield-389)

Oct 14 07:09:07 Hostname kernel: ACPI Error: Method parse/execution failed [\_SB_.PMI0._PMM] (Node ffff88016d9e8ed8), AE_AML_BUFFER_LIMIT (20130517/psparse-536)

Oct 14 07:09:07 Hostname kernel: ACPI Exception: AE_AML_BUFFER_LIMIT, Evaluating _PMM (20130517/power_meter-339)


or


May 10 10:14:56 Hostname kernel: ACPI Error: SMBus or IPMI write requires Buffer of length 66, found length 32 (20090903/exfield-286)

May 10 10:14:56 Hostname kernel: ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PMI0._GHL] (Node ffff881074e41d08), AE_AML_BUFFER_LIMIT

May 10 10:14:56 Hostname kernel: ACPI Exception: AE_AML_BUFFER_LIMIT, Evaluating _GHL (20090903/power_meter-204)



Why do I see "ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PMI0._GHL] (Node ffff8101023768f0), AE_SUPPORT" when my RHEL 5 system boots?
https://access.redhat.com/site/solutions/35475

Resolution
No action is required.  These messages cannot be removed at the current time.


ACPI Error(ACPI Error: SMBus or IPMI write requires Buffer of length X, found length Y)
https://access.redhat.com/site/solutions/48109

Resolution
This message can be safely ignored.


Advisory: ProLiant G6 and G7 Servers - Advanced Configuration and Power Interface (ACPI) Errors May Be Reported by Red Hat Enterprise Linux 6 and SUSE Linux Enterprise Server 11 SP1 During Startup

https://support.hpe.com/hpesc/public/docDisplay?docId=c02642731&docLocale=en_US

Because the System ROM ACPI interface causing these error messages is not used in the Linux operating system environment, these messages are benign and can be safely ignored.




반응형
Posted by 스쳐가는인연

댓글을 달아 주세요

HPE NIC driver update through source rpm file from Ubuntu OS.

 

Test System
DL380 Gen10+562SFP+(X710 chipset)

 

1. Install SPP2020.03
2. Set WP to Virtualization - Max Performance.
3. Install Ubuntu 18.04.5 LTS

 

Check inbox driver (dmesg | grep i40e)
[ 3.733322] i40e: Intel(R) Ethernet Connection XL710 Network Driver - version 2.1.14-k

 

a. enable root account

# sudo passwd root

 

b. enable root login via ssh

# vim /etc/ssh/sshd_config

PermitRootLogin yes

 

# service ssh restart

 

4.1 Install rpm for use rpm package on Ubuntu

# apt install rpm

# rpm -ivh ./hp-i40e-2.10.19.30-2.all.src.rpm

rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
Updating / installing...
1:hp-i40e-2.10.19.30-2.all ################################# [100%]

 

rpm -ql ./hp-i40e-2.10.19.30-2.all.src.rpm

hp-i40e-2.10.19.30.tar.gz
hp-i40e.files
hp-i40e.spec

 

>> package installed at

/rpmbuild/SOURCE

 

4.2. Install alien for use rpm package on Ubuntu

# apt install alien

# alien hp-i40e-2.10.19.30-2.all.src.rpm

hp-i40e_2.10.19.30-3_amd64.deb generated

 

# dpkg -i hp-i40e_2.10.19.30-3_amd64.deb

 

# dpkg -L hp-i40e

/.
/hp-i40e-2.10.19.30.tar.gz
/hp-i40e.files
/hp-i40e.spec
/usr
/usr/share
/usr/share/doc
/usr/share/doc/hp-i40e
/usr/share/doc/hp-i40e/changelog.Debian.gz
/usr/share/doc/hp-i40e/copyright

 

>> package installed at

/

 

5. Move source package to temporary space

# mkdir /tmp/i40e

# mv hp-i40e* /tmp/i40e

 

6. Install new driver.

# tar zxf hp-i40e-2.10.19.30.tar.gz

# cd /tmp/i40e/hp-i40e-2.10.19.30/src

# make install

 

7. remove old driver and then load new driver

# rmmod i40e; modprobe i40e

 

8. update. seems automatically done during install but. confirm

# update-initramfs -u

 

Reboot and check new driver loaded.

[ 4.028479] i40e: Intel(R) 40-10 Gigabit Ethernet Connection Network Driver - version 2.10.19.30

반응형
Posted by 스쳐가는인연

댓글을 달아 주세요

Directory copy

# cp -r source_directory target_directory

 

Multiple file overwrite without interactive

# \cp -rf source_directory target_directory
# /bin/cp -rf source_directory target_directory

 

출처:

cp 강제로 덮어쓰기
https://zetawiki.com/wiki/CentOS_cp_%EA%B0%95%EC%A0%9C%EB%A1%9C_%EB%8D%AE%EC%96%B4%EC%93%B0%EA%B8%B0

리눅스에서 폴더 통째로 복사하기
https://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4%EC%97%90%EC%84%9C_%ED%8F%B4%EB%8D%94_%ED%86%B5%EC%A7%B8%EB%A1%9C_%EB%B3%B5%EC%82%AC%ED%95%98%EA%B8%B0

반응형
Posted by 스쳐가는인연

댓글을 달아 주세요