#keywords 문제해결 #title 문제해결 [wiki:Home 대문] / [wiki:TroubleShooting 문제해결] ---- == [wiki:TroubleShooting 문제해결] == [[TableOfContents]] === 리눅스 === * '''[wiki:LinuxMulticastIGMPVersionSet Linux에서 Multicast통신의 IGMP version을 강제로 선택]''' * '''[wiki:jffs2_cleanmarker_message JFFS2 파일시스템의 CLEANMARKER 메세지에 대하여]''' * '''[wiki:FstabMountSharedFolderWithSpaces 공백이 있는 삼바(Samba/CIFS) 공유폴더를 마운트하기 위한 fstab설정]''' === 자동차 === * '''[wiki:TuscaniBCM 현대 투스카니 BCM(Body Control Module) 수리기 (깜박이 릴레이)]''' === 기타 === * '''[wiki:BypassFirewallByPuTTY PuTTY를 이용한 Firewall 우회방법]''' * [wiki:RemoconWithDigitalCamera 리모콘과 디지털 카메라 (리모콘이 동작되는지 확인하는 방법)] === 간단한 메모 (팁) === {{{#!plain 간단하게 설명할 수 없으면 제대로 이해하지 못하는 것이다. – 알버트 아인슈타인 }}} * docker 에서 volume으로 mapping 할 directory 가 docker 실행전에 mount 되도록 하려면 systemd 기준 "/etc/fstab" 에 mount option으로 'x-systemd.required-by=docker.service,x-systemd.before=docker.service' 을 추가하면 docker 가 실행되기 전에 해당 옵션이 부여된 mount entry 가 mount 되는 것을 보장할 수 있습니다. {{{#!folding {{{#!plain ... /dev/disk/by-uuid/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /mnt/my-volume-entry ext4 noatime,nofail,x-systemd.device-timeout=300,x-systemd.required-by=docker.service,x-systemd.before=docker.service,errors=remount-ro 0 2 ... }}} }}} * git 으로 clone 시 주소가 https 이고 해당 서버의 인증서가 사설 인증서인 경우 clone 하는 방법 {{{#!folding * 그냥 clone 하는 경우 다음과 같은 오류메세지와 함께 clone 실패 {{{#!plain # git clone https:/// ... fatal: unable to access 'https:///': server certificate verification failed. CAfile: none CRLfile: none ... }}} * 다음과 같이 clone 명령에서 config 옵션으로 SSL verify를 비활성화하면 정상적으로 clone 가능. (발생하는 이유는 인증서를 Verify할 수 없는 경우이기 때문이므로) {{{#!plain # git clone -c http.sslVerify=off https:/// 또는 매번 옵션 주는 것이 불편하면 다음과 같이 global config 로 한번 설정해두면 다음부터는 clone가능 # git config --global http.sslVerify false }}} }}} * sshfs 으로 원격지 폴더를 마운트 하는 방법 {{{#!folding * sshfs 명령어 설치 * Ubuntu의 경우 : "sudo apt install sshfs" * sshfs 명령어로 원격지 폴더를 마운트 (자신의 구성에 따라서 옵션들은 적절히 생략 또는 수정) {{{#!plain sudo sshfs \ @: \ -o port=,reconnect,delay_connect,kernel_cache,Ciphers=aes128-gcm@openssh.com,compression=no,allow_other,default_permissions,uid=,gid=,identityfile= }}} * 부팅시 자동으로 마운트하기 위해서 "/etc/fstab" 에 넣으려는 경우 {{{#!plain @: fuse.sshfs defaults,noatime,_netdev,port=,reconnect,delay_connect,kernel_cache,Ciphers=aes128-gcm@openssh.com,compression=no,allow_other,default_permissions,uid=,gid=,identityfile= 0 0 }}} }}} * Routing 사전 검사 {{{#!folding * 일반 Static routing 검사 {{{#!plain # ip r get <목적지 주소> }}} * Policy routing 검사 {{{#!plain # ip r get <목적지 주소> from <출발지 주소> iif <수신 인터페이스명> }}} }}} * OpenSSL {{{#!folding * 간단히 쉘에서 TLS 연결 테스트 하려면 {{{#!plain # openssl s_client -no_ssl2 -no_ssl3 -connect 192.168.0.100:443 -state -status # openssl s_client -debug -tlsextdebug -no_ssl2 -no_ssl3 -connect 192.168.0.100:443 -state -status -msg # openssl s_client -debug -tlsextdebug -no_ssl2 -no_ssl3 -connect 192.168.0.100:443 -state -status -msg -cipher '' }}} * 현재 설치된 OpenSSL 에서 지원 가능한 Cipher suite 목록 확인 방법 {{{#!plain # openssl ciphers -v 또는 TLS v1.2 에서 지원되는 목록만 선별하여 출력하려면 # echo "cipher-suite(\"$(openssl ciphers -v | grep TLSv1.2 | awk '{print $1}' | xargs echo -n | sed 's/ /:/g' | sed -e 's/:$//')\")" }}} }}} * Subversion log 내용을 잘못 수정하여 Commit 한 경우 Log 수정 하는 방법 {{{#!folding {{{#!plain # svn propedit -r --revprop svn:log }}} }}} * Ubuntu에서 콘솔 화면 해상도 변경 {{{#!folding 1. "/etc/default/grub" 파일에서 하기와 같이 항목을 수정합니다. {{{#!plain ... GRUB_CMDLINE_LINUX_DEFAULT="video=0x0305" ... GRUB_GFXMODE=1024x768 GRUB_GFXPAYLOAD_LINUX=1024x768 }}} 1. 다음과 같이 "update-grub"명령을 실행하여 적용합니다. {{{#!plain # sudo update-grub }}} 1. 이제 재부팅하면 해상도가 적용된 터미널을 볼 수 있습니다. {{{#!plain # sudo shutdown -r now }}} }}} * 장비에 '''ldd 명령어가 없는 경우''' (LD_TRACE_LOADED_OBJECTS=1 환경변수 지정과 함께 실행명령을 실행하면 ldd 명령과 동일한 출력결과를 얻을 수 있습니다.) {{{#!folding {{{#!plain # LD_TRACE_LOADED_OBJECTS=1 <실행명령> }}} {{{#!plain # LD_TRACE_LOADED_OBJECTS=1 /usr/sbin/flook libdl.so.2 => /lib/libdl.so.2 (0x2abc3000) libc.so.6 => /lib/libc.so.6 (0x2acc6000) /lib32/ld.so.1 (0x2aaa8000) # _ }}} }}} * PHP에서 HTTP header 중 "'''Last-Modified'''"을 응답하려면 (Cache되지 않는 페이지를 유지하려면) {{{#!folding {{{#!enscript php $last_modified = gmdate('D, d M Y H:i:s T'); header("Last-Modified: $last_modified GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 header("Vary: *"); }}} }}} * '''PuTTY 설정 백업 및 복원 방법''' {{{#!folding regedit 를 실행하여 "컴퓨터\HKEY_CURRENT_USER\Softeare\Simon Tatham\PuTTY\Session"을 내보내기로 저장하면 해당 저장한 .reg 파일이 백업설정파일이 됩니다. 복원은 가져오기하면 되겠죠. }}} * 오래된 Ubuntu 버젼(예: Ubuntu 12.04) 에서 "sudo apt-get update" 실행시 일부 동기오류나는 경우 ("/var/lib/apt/lists/" 디렉토리 하위의 파일들을 지우고 다시 하면 해결됨) {{{#!folding {{{#!plain # sudo apt-get autoclean -y # sudo apt-get clean # sudo rm -rf /var/lib/apt/lists/* # sudo apt-get update }}} }}} * Ubuntu 에서 Network Interface가 2개 이상이고 둘다 DHCP를 할당하는 경우 Default Gateway를 특정 Interface 로 설정하는 방법 ("/etc/network/interfaces") {{{#!folding {{{#!plain auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet dhcp post-up route add default via 192.168.0.1 dev eth0 # The sencondary network interface allow-hotplug eth1 iface eth1 inet dhcp post-up route del default dev eth1 }}} }}} * '''SSH daemon이 Client 의 연결을 검사하여 실제 연결한 동안 끊어지지 않도록 설정'''하는 예 ("/etc/ssh/sshd_config" 의 뒤에 다음항목을 추가 후 sshd 재시작) {{{#!folding {{{#!plain ClientAliveInterval 60 ClientAliveCountMax 3 }}} }}} * Linux의 Swap 을 최대한 안하도록 설정 ("/etc/sysctl.conf" 뒤에 다음 항목을 추가후 "sudo sysctl -p" 명령으로 적용, 낮은 숫자일수록 swap 이 적게 되지만 50이하는 비추천) {{{#!folding {{{#!plain vm.swappiness = 50 }}} }}} * Subversion 접속 방법 중에서 svn+ssh 의 경우 port번호는 기본값이 22이지만 이를 다른 포트로 우회 해야 하는 경우 URL에서 port 지정이 되지 않는데 이 경우 --config-option 을 통하여 변경할 수 있음. (마찬가지로 svnsync 등에서도 이 옵션을 사용할 수 있음.) {{{#!folding {{{#!plain svn+ssh://[@]
/ --config-option="config:tunnels:ssh=ssh -p " }}} }}} * Ubuntu 64-bit 에서 32-bit 프로그램을 실행하고자 할때 ia32-libs package를 설치하면 됨. {{{#!folding {{{#!plain sudo apr-get install ia32-libs }}} }}} * '''원격지의 특정 압축파일을 내 LinuxPC에서 바로 풀고싶을때''' {{{#!folding {{{#!plain ssh "cat archive.tar.gz" | tar -xvz }}} }}} * '''sftp 를 통한 원격 파일시스템 mount''' {{{#!folding * fuse의 sshfs이 필요 * fstab에 다음과 같이 작성 {{{#!plain sshfs#@[:] fuse 0 0 }}} }}} * Ubuntu에서 gcc는 어떻게 설치해야 하는지? {{{#!folding {{{#!plain # 기본적인 컴파일 환경 설치 sudo apt-get install build-essential # 커널 개발을 위한 추가 환경 설치 sudo apt-get install kernel-package }}} }}} * cURL library를 이용하여 https 접속을 처리할 때 다음과 같이 SSL CA를 요구하는데 부합하지 못할 경우 {{{#!folding * 다음과 같이 코드에 옵션을 추가하여 원인을 찾아본다. {{{#!enscript c s_curl_code = curl_easy_setopt(s_curl, CURLOPT_VERBOSE, 1); }}} * 다음과 같은 메세지와 흡사하다면 {{{#!plain * error setting certificate verify locations: CAfile: /usr/share/curl/curl-ca-bundle.crt CApath: none * Closing connection #0 * Problem with the SSL CA cert (path? access rights?) }}} }}} * 해당 필요한 파일을 넣어주던가 다음과 같은 옵션을 코드에 추가하여 무시할 수 있다. {{{#!folding {{{#!enscript c s_curl_code = curl_easy_setopt(s_curl, CURLOPT_SSL_VERIFYHOST, 0); s_curl_code = curl_easy_setopt(s_curl, CURLOPT_SSL_VERIFYPEER, 0); }}} }}} * Eclipse에서 Subversion을 설치하려면? {{{#!folding * [^http://subclipse.tigris.org/]에서 찾아봅니다. }}} * CMake를 이용한 Project들의 Source 를 Cross compile하기 (인자들은 적절히 수정필요) {{{#!folding {{{#!plain tar -xvzf source.tar.gz cd source cmake \ -DCMAKE_INSTALL_PREFIX:PATH="/usr" \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_VERSION=1 \ -DCMAKE_C_COMPILER="$(CC)" \ -DCMAKE_CXX_COMPILER="$(CXX)" \ -DCMAKE_LINKER="$(LD)" \ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_INCLUDE_PATH="/usr/include" \ -DCMAKE_LIBRARY_PATH="/usr/lib" \ . make && make install }}} }}} * 간단한 Linux Kernel module 개발을 위한 Makefile template {{{#!folding {{{#!enscript makefile ### ### Copyright (C) MINZKN.COM ### All rights reserved. ### Author: JAEHYUK CHO ### ifneq ($(KERNELRELEASE),) obj-m += template.o else KERNELDIR="/lib/modules/$(shell uname -r)/build" #KERNELDIR="/usr/src/linux" .PHONY: all modules % all: modules modules %:; @$(MAKE) --no-print-directory -C $(KERNELDIR) M="$(abspath .)" $(@) endif # End of makefile }}} }}} * 파일의 내용중 특정 패턴치환 {{{#!folding {{{#!plain #find . -type f -exec sed -i -e "s/\(.*\)A\(.*\)/B/" {} \; find . -type f -exec sed -i -e "s/A/B/g" {} \; }}} }}} * 삼바(Sambe) 캐쉬(Cache) 삭제 방법 (출처: [^http://serverfault.com/questions/476086/samba-winbind-user-resolution]) {{{#!folding {{{#!plain Stop the Winbind and Samba services: service winbind stop service smb stop Clear the Samba Net cache: net cache flush Delete the Winbind caches: rm –f /var/lib/samba/*.tdb rm –f /var/lib/samba/group_mapping.ldb Start the Samba and then Winbind services - Note: The order is important service smb start service winbind start }}} }}} * svnsync 대상 주소 변경하는 방법 {{{#!folding {{{#!plain # svn propset svn:sync-from-url --revprop -r 0 "<변경할 원본 소스주소 (propval)>" "<동기화 대상 접속주소>" }}} }}} * 빌드된 OpenSSL 이 AES-NI 를 지원하는지 확인하는 방법 {{{#!folding {{{#!plain => OpenSSL 에서 AES-NI 를 강제로 비활성화해서 테스트 # OPENSSL_ia32cap="~0x200000200000000" openssl speed -elapsed -evp aes-256-cbc You have chosen to measure elapsed time instead of user CPU time. Doing aes-256-cbc for 3s on 16 size blocks: 4152308 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 64 size blocks: 1121052 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 256 size blocks: 273135 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 1024 size blocks: 73585 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 8192 size blocks: 9127 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 16384 size blocks: 4233 aes-256-cbc's in 3.00s OpenSSL 1.1.1k 25 Mar 2021 built on: Sun Aug 29 15:41:16 2021 UTC options:bn(64,64) rc4(16x,int) des(int) aes(partial) blowfish(ptr) compiler: x86_64-openwrt-linux-gnu-gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -Os -pipe -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -fpic -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DZLIB -DZLIB_SHARED -DNDEBUG -DOPENSSL_SMALL_FOOTPRINT -I/home/build_user/release_image/build_master/staging_dir/target-x86_64_glibc-2.23/usr/include -I/home/build_user/release_image/build_master/staging_dir/target-x86_64_glibc-2.23/include -I/home/build_user/release_image/build_master/staging_dir/toolchain-x86_64_gcc-8.4.0_glibc-2.23/usr/include -I/home/build_user/release_image/build_master/staging_dir/toolchain-x86_64_gcc-8.4.0_glibc-2.23/include The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes aes-256-cbc 22145.64k 23915.78k 23307.52k 25117.01k 24922.79k 23117.82k => AES-NI 를 지원하는 경우 위 실행보다 높은 수치 (대략 4배 가량) 를 확인가능 # openssl speed -elapsed -evp aes-256-cbc You have chosen to measure elapsed time instead of user CPU time. Doing aes-256-cbc for 3s on 16 size blocks: 18694195 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 64 size blocks: 7098843 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 256 size blocks: 2346189 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 1024 size blocks: 616448 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 8192 size blocks: 75575 aes-256-cbc's in 3.00s Doing aes-256-cbc for 3s on 16384 size blocks: 39627 aes-256-cbc's in 3.00s OpenSSL 1.1.1k 25 Mar 2021 built on: Sun Aug 29 15:41:16 2021 UTC options:bn(64,64) rc4(16x,int) des(int) aes(partial) blowfish(ptr) compiler: x86_64-openwrt-linux-gnu-gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -Os -pipe -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -fpic -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DZLIB -DZLIB_SHARED -DNDEBUG -DOPENSSL_SMALL_FOOTPRINT -I/home/build_user/release_image/build_master/staging_dir/target-x86_64_glibc-2.23/usr/include -I/home/build_user/release_image/build_master/staging_dir/target-x86_64_glibc-2.23/include -I/home/build_user/release_image/build_master/staging_dir/toolchain-x86_64_gcc-8.4.0_glibc-2.23/usr/include -I/home/build_user/release_image/build_master/staging_dir/toolchain-x86_64_gcc-8.4.0_glibc-2.23/include The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes aes-256-cbc 99702.37k 151441.98k 200208.13k 210414.25k 206370.13k 216416.26k }}} }}} * 삼바(Sambe) 심볼릭 링크(Symbolic link) 접근 허용 방법 {{{#!folding {{{#!plain => 하기와 같이 "/etc/samba/smb.conf" 설정파일을 편집하여 global 및 share section에 다음과 같은 설정을 추가합니다. [global] ... allow insecure wide links = Yes <= 심볼릭 링크에 대한 제어를 위해서 global section에 다음과 같은 설정을 추가합니다. ... [homes] comment = My home browseable =yes writable = yes valid users = %S create mask = 0644 directory mask = 0755 follow symlinks = yes <= 공유폴더 section에 하기와 같은 설정을 추가하여 해당 공유폴더에서 symbolic link 를 허용합니다. wide links = yes <= 공유폴더 section에 하기와 같은 설정을 추가하여 해당 공유폴더에서 그 범위를 벗어나는 symbolic link 를 허용합니다. (선택사항) ... }}} }}}