리눅스는 이전에 명령들을 기억합니다.
shell > history
를 치면 이전에 입력했던 명령어들이 나타납니다.
실행했던 명령어 리스트중 어떤 명령어를 실행시키고 싶으면 다음과 같이 합니다.
shell > !번호
를 입력하면 그 번호의 명령어를 실행합니다.
서버 등 운영체제(OS)
- history 명령 재 실행 2016.09.06
- SSL 웹서버 시작시 암호 입력 안하기 2016.08.01
- [Ubuntu] W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: 2016.07.11
- -bash: ./test.sh: /bin/bash^M: bad interpreter: 그런 파일이나 디렉토리가 없음 2016.07.05
- CentOS 7 로케일 변경 2016.06.28
- CentOS7 MRTG Install 2016.06.27
- Short Tip: Get UUID of Hard Disks [Update] 2016.06.24
- yum update or yum install fails with package conflict between 64 bit and 32 bit package architectures ? 2016.06.17
history 명령 재 실행
SSL 웹서버 시작시 암호 입력 안하기
SSL인증서를 적용한 이후 웹서버 시작시에 암호를 묻는 경우가 있다.
아래처럼 진행해서 nokey 처리를 하면 된다.
# openssl rsa -in 기존KEY -out 생성KEY
물론 기존 key 파일은 백업을 먼저 해두자.
'서버 등 운영체제(OS) > Linux' 카테고리의 다른 글
[Ubuntu] socat 을 사용한 포트 포워딩 Port forwarding (0) | 2017.11.27 |
---|---|
history 명령 재 실행 (0) | 2016.09.06 |
SSL 웹서버 시작시 암호 입력 안하기 (0) | 2016.08.01 |
[Ubuntu] W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: (0) | 2016.07.11 |
-bash: ./test.sh: /bin/bash^M: bad interpreter: 그런 파일이나 디렉토리가 없음 (0) | 2016.07.05 |
CentOS 7 로케일 변경 (0) | 2016.06.28 |
[Ubuntu] W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available:
The link above provides detailed explanation with screenshots. It also has some other simple methods that could be tried before doing this manually. Since it is not accessible from some regions let me describe the method that worked for me.
- Go to the OpenPGP Public Key Server. There you can enter your key into the
Search String
field, leaving everything else as is, then click "Search!".
When searching for a key, always prepend0x
to it! This means that, for example, you have to search for0x6AF0E1940624A220
instead of6AF0E1940624A220
. - Click on the link provided in the
pub
section. This should take you to page containing the key. The page's heading should be similar toPublic Key Server -- Get "0x6AF0E1940624A220"
- Copy everything from underneath the title (starting from
-----BEGIN PGP PUBLIC KEY BLOCK-----
) and save it in a file (e.g.key1
). -
Once you have the file, run the following command
sudo apt-key add key1
You will get an "OK" response.
And you are done. Repeat the procedure of other keys that might be missing.
에러메시지에 보면 마지막 PUBLIC KEY 하고 뒤에 키값이 나온다....
OpenPGP Public Key Server 링크 클릭 후 그 키 값 앞에 0x 를 붙여서 검색..
그리고 나온 링크를 클릭하면 key 값이 나오는데 그걸 복사해서 저장한다.
그리고 sudo apt-key add 키파일명 을 해주고 apt-get update 를 다시 실행.
'서버 등 운영체제(OS) > Linux' 카테고리의 다른 글
history 명령 재 실행 (0) | 2016.09.06 |
---|---|
SSL 웹서버 시작시 암호 입력 안하기 (0) | 2016.08.01 |
[Ubuntu] W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: (0) | 2016.07.11 |
-bash: ./test.sh: /bin/bash^M: bad interpreter: 그런 파일이나 디렉토리가 없음 (0) | 2016.07.05 |
CentOS 7 로케일 변경 (0) | 2016.06.28 |
CentOS7 MRTG Install (0) | 2016.06.27 |
-bash: ./test.sh: /bin/bash^M: bad interpreter: 그런 파일이나 디렉토리가 없음
vim 에서
vim에서는 dos mode의 화일을 읽어도 화면에 ^M을 표시하지 않습니다.
대신 밑에 [dos] 라고 나타납니다.
다음과 같이 해서 unix mode로.. 즉 ^M을 빼는것입니다.
:set fileformat=unix
반대로 unix mode에서 dos mode로 바꾸고 싶다면
:set fileformat=dos
'서버 등 운영체제(OS) > Linux' 카테고리의 다른 글
SSL 웹서버 시작시 암호 입력 안하기 (0) | 2016.08.01 |
---|---|
[Ubuntu] W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: (0) | 2016.07.11 |
-bash: ./test.sh: /bin/bash^M: bad interpreter: 그런 파일이나 디렉토리가 없음 (0) | 2016.07.05 |
CentOS 7 로케일 변경 (0) | 2016.06.28 |
CentOS7 MRTG Install (0) | 2016.06.27 |
Short Tip: Get UUID of Hard Disks [Update] (0) | 2016.06.24 |
CentOS 7 로케일 변경
CentOS 7 에서 로케일 변경하는 방법입니다.
현재 사용가능한 한글관련 로케일
# localectl list-locales | grep -i ko
ko_KR
ko_KR.euckr
ko_KR.utf8
kok_IN
kok_IN.utf8
korean
korean.euc
ru_RU.koi8r
ru_UA.koi8u
tg_TJ.koi8t
uk_UA.koi8u
utf8 로 변경
# localectl set-locale LANG=ko_KR.utf8
수동으로 변경시는 /etc/locale.conf 파일을 만들어 아래 내용 추가
LANG=ko_KR.utf8
서버 부팅 후 로케일 설정 확인
# locale
LANG=ko_KR.utf8
LC_CTYPE="ko_KR.utf8"
LC_NUMERIC="ko_KR.utf8"
LC_TIME="ko_KR.utf8"
LC_COLLATE="ko_KR.utf8"
LC_MONETARY="ko_KR.utf8"
LC_MESSAGES="ko_KR.utf8"
LC_PAPER="ko_KR.utf8"
LC_NAME="ko_KR.utf8"
LC_ADDRESS="ko_KR.utf8"
LC_TELEPHONE="ko_KR.utf8"
LC_MEASUREMENT="ko_KR.utf8"
LC_IDENTIFICATION="ko_KR.utf8"
LC_ALL=
# cat /etc/locale.conf
LANG=ko_KR.utf8
'서버 등 운영체제(OS) > Linux' 카테고리의 다른 글
CentOS7 MRTG Install
[1] | |
[2] | Install MRTG, SNMP. |
[root@dlp ~]#
yum -y install net-snmp net-snmp-utils mrtg |
[3] | Configure SNMP (Simple Network Management Protocol). |
[root@dlp ~]#
vi /etc/snmp/snmpd.conf # line 41: comment out # com2sec notConfigUser default public # line 74,75: uncomment and change # change to your local network for "mynetwork" section # change comunity name except public or private com2sec local localhost
Serverworld com2sec mynetwork 10.0.0.0/24
Serverworld # line 78,79: uncomment and change group MyRWGroup v2c localgroup MyROGroup v2c mynetwork# line 85: uncomment view all included .1 80 # line 93,94: uncomment and change access MyROGroup "" v2c noauth
exact all none noneaccess MyRWGroup "" v2c noauth
exact all all all# show status (replace the "Serverworld" to your comunity name) [root@dlp ~]# snmpwalk -v2c -c Serverworld localhost system SNMPv2-MIB::sysDescr.0 = STRING: Linux dlp.srv.world 3.10.0-229.4.2.el7.x86_64 #1 SMP Wed May..... SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (91954) 0:15:19.54 SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp ..... ..... SNMPv2-MIB::sysORUpTime.9 = Timeticks: (4) 0:00:00.04 SNMPv2-MIB::sysORUpTime.10 = Timeticks: (4) 0:00:00.04 |
[4] | Configure MRTG. |
[root@dlp ~]#
cfgmaker --snmp-options=:::::2 --ifref=descr --ifdesc=descr Serverworld@10.0.0.30 > /etc/mrtg/mrtg.cfg [root@dlp ~]#
vi /etc/mrtg/mrtg.cfg # line 8: add WorkDir: /var/www/mrtg # line 16: uncomment Options[_]: growright, bits # near line 75: uncomment all from the line & change MaxBytes value Target[10.0.0.30_eth0]: \eth0:Serverworld@10.0.0.30:::::2 noHC[10.0.0.30_eth0]: yes SetEnv[10.0.0.30_eth0]: MRTG_INT_IP="10.0.0.30" MRTG_INT_DESCR="eth0" MaxBytes[10.0.0.30_eth0]: 125000000 Title[10.0.0.30_eth0]: eth0 -- dlp.srv.world PageTop[10.0.0.30_eth0]: <h1>eth0 -- dlp.srv.world</h1> ..... ..... # execute mrtg 3 times (display warnings until 3 times) [root@dlp ~]# for (( i=1 ; i <= 3 ; i++ )); do env LANG=C mrtg /etc/mrtg/mrtg.cfg; done 2015-06-16 19:54:12, Rateup WARNING: /usr/bin/rateup could not read the primary log file for 10.0.0.30_eth0 2015-06-16 19:54:12, Rateup WARNING: /usr/bin/rateup The backup log file for 10.0.0.30_eth0 was invalid as well 2015-06-16 19:54:12, Rateup WARNING: /usr/bin/rateup Can't rename 10.0.0.30_eth0.log to 10.0.0.30_eth0.old updating log file # generate index file [root@dlp ~]# indexmaker --columns=1 /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html # add in Cron [root@dlp ~]#
vi /etc/cron.d/mrtg */5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok |
[5] | Configure httpd to access MRTG site from other hosts. |
[root@dlp ~]#
vi /etc/httpd/conf.d/mrtg.conf # line 10: uncomment and add access permission, line 11: add DirectoryIndex Require ip 10.0.0.0/24 DirectoryIndex index.html systemctl start httpd |
[6] | Access to the "http://(MRTG hostname or IP address)/mrtg/" from a client with HTTP, then it's possible to see MRTG site. |
![]() |
![]() |
출처 : http://www.server-world.info/en/note?os=CentOS_7&p=mrtg
'서버 등 운영체제(OS) > Linux' 카테고리의 다른 글
-bash: ./test.sh: /bin/bash^M: bad interpreter: 그런 파일이나 디렉토리가 없음 (0) | 2016.07.05 |
---|---|
CentOS 7 로케일 변경 (0) | 2016.06.28 |
CentOS7 MRTG Install (0) | 2016.06.27 |
Short Tip: Get UUID of Hard Disks [Update] (0) | 2016.06.24 |
yum update or yum install fails with package conflict between 64 bit and 32 bit package architectures ? (0) | 2016.06.17 |
CentOS 저장장치(HDD) 추가 하기 (0) | 2016.06.17 |
Short Tip: Get UUID of Hard Disks [Update]
There is an update to this post available: UUIDs and Linux: Everything you ever need to know.
The Universally Unique Identifier can be used to identify a device independent form its mount point or device name. This is more and more important as many devices today support hot-plugging or are external anyway. Therefore it makes sometimes sense to access a device (for example in fstab
) not by device name but by the UUID.
There are several ways to get the UUID. The first one uses the /dev/
directory. While you are on is you might want to check other by-*
directories, I never knew of them.
1
2 |
$ ls -l /dev/disk/by-uuid lrwxrwxrwx 1 root root 10 11. Okt 18:02 53cdad3b-4b01-4a6c-a099-be1cdf1acf6d -> ../../sda2 |
Another way to get the uuid by usage of the tool blkid
:
1
2 |
$ blkid /dev/sda1 /dev/sda1: LABEL= "/" UUID= "ee7cf0a0-1922-401b-a1ae-6ec9261484c0" SEC_TYPE= "ext2" TYPE= "ext3" |
There you also get the label and other information. Quite usefule.
Btw., if you wonder how “unique” this unique is, here a quote from Wikipedia:
1 trillion UUIDs would have to be created every nanosecond for 10 billion years to exhaust the number of UUIDs.
Pretty unique.
Thanks to Linux By Examples for the initial howto.
'서버 등 운영체제(OS) > Linux' 카테고리의 다른 글
CentOS 7 로케일 변경 (0) | 2016.06.28 |
---|---|
CentOS7 MRTG Install (0) | 2016.06.27 |
Short Tip: Get UUID of Hard Disks [Update] (0) | 2016.06.24 |
yum update or yum install fails with package conflict between 64 bit and 32 bit package architectures ? (0) | 2016.06.17 |
CentOS 저장장치(HDD) 추가 하기 (0) | 2016.06.17 |
Unfinished transactions remaining - yum-complete-transaction (0) | 2016.06.17 |
yum update or yum install fails with package conflict between 64 bit and 32 bit package architectures ?
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- 64 bit architecture
- 32 bit packages installed sharing some files with the 64 bit ones
Issue
- Files are conflicting between 64 and 32 bit packages, how to fix it ?
yum update
oryum install
fails with package conflict between 64 bit and 32 bit package architectures.- 32 bit package showing conflict problem with 64 bit package.
Transaction Check Error:
file /usr/share/man/man1/ca.1ssl.gz from install of openssl-0.9.8e-27.el5_10.3.x86_64 conflicts with file from package openssl-0.9.8e-27.el5_10.1.i686
file /usr/share/man/man1/req.1ssl.gz from install of openssl-0.9.8e-27.el5_10.3.x86_64 conflicts with file from package openssl-0.9.8e-27.el5_10.1.i686
file /usr/share/man/man1/x509.1ssl.gz from install of openssl-0.9.8e-27.el5_10.3.x86_64 conflicts with file from package openssl-0.9.8e-27.el5_10.1.i686
Resolution
You can configure the yum client to update only a package of the exact architecture installed on the system.
Perform the following steps to remove duplicate packages(i.e. 32-bit and 64-bit packages installed on server which is causing the dependency issues).
-
Install the
yum-utils
package:# yum install yum-utils
-
The
package-cleanup --dupes
lists all duplicate packages:# package-cleanup --dupes
-
The
package-cleanup --cleandupes
removes the duplicates (it asks for a confirmation to remove all duplicates unless the -y switch is given):# package-cleanup --cleandupes
-
Edit
/etc/yum.conf
, set the following line:exactarch=1
-
Run
yum
command:# yum clean all # yum update
'서버 등 운영체제(OS) > Linux' 카테고리의 다른 글
CentOS7 MRTG Install (0) | 2016.06.27 |
---|---|
Short Tip: Get UUID of Hard Disks [Update] (0) | 2016.06.24 |
yum update or yum install fails with package conflict between 64 bit and 32 bit package architectures ? (0) | 2016.06.17 |
CentOS 저장장치(HDD) 추가 하기 (0) | 2016.06.17 |
Unfinished transactions remaining - yum-complete-transaction (0) | 2016.06.17 |
[리눅스] 리눅스 tar, gz 압축 및 해제 (0) | 2016.04.20 |