Linux 47

두대의 리눅스에서 tcp패킷을 그대로 다른 컴퓨터에 다른 포트로 전달해주는 기능 구현방법

#iptables 설치: sudo apt-get install iptables # 현재 iptables 룰을 백업: sudo iptables-save > /etc/iptables.rules #iptables 룰을 초기화: sudo iptables -F sudo iptables -X sudo iptables -t nat -F sudo iptables -t nat -X sudo iptables -t mangle -F sudo iptables -t mangle -X #리다이렉트 규칙 추가: sudo iptables -t nat -A PREROUTING -p tcp --dport 3307 -j DNAT --to 10.11.227.4:3306 #리다이렉트 규칙 저장: sudo iptables-save > /etc..

Authentication required 우분투 잠김 화면 해결 법

Authentication required an application wants access to the keyring "Default kyring", but it is locked 화면이 자꾸 뜬다. 없애보도록하자. color.pkla 를 만들어준다. vi /etc/polkit-1/localauthority/50-local.d/color.pkla 내용은 [Allow colord for all users] Identity=unix-user:* Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.free..

CentOS 7에서 rc.local실행이 안될때

황당하게 /etc/rc.d/rc.local 에 명령을 시스템 시작시 자동 실행되는데 . CentOS 7에서는 기본값이 자동 시작이 안된다.. 엑티브가 아님으로 나온다. inactive (dead) 1)파일 실행권한 준다. chmod +x /etc/rc.d/rc.local 2) rc-local서비스 를 실행한다. systemctl start rc-local.service 3) vi /usr/lib/systemd/system/rc-local.service 수정 한다. 맨아래 추가 [Install] WantedBy=multi-user.target 끝났다. 상태 다시 확인해본다. 위에 처음것과 상태가 다르게 나온다. 실행된것을 확인할수있다. 그리고 이미 실행중인것이라 오류가 나왔다~ rc.local 에서 실행하..

Linux 2022.08.08

utf8을utf8mb4로변환 업그레이드 php프로그램

euckr 에서 utf8넘어온후에 DB문자셋 변경할일 없을줄알았는데.. 아래 그림은 이모지의 코드번호 캡춰화면이다 . 이모티콘 그림을 문자로 만들어 놓은것으로 생각된다. 그것도 모르고 여적 문자가 아닌 그림인 줄알았다. ^^ -_-; 한글URL주소 처럼 이모티콘URL주소도 가능하고 , text 이모티콘 검색어로도 가능하다. 카톡에 이모티콘(이모지) 문자포함된글을 게시판에 붙어넣었더니글이 짤리는 버그가 발견되었다. 왜그런가 한참을 원인 분석하다가 결국 이모티콘 특수문자에서 잘린것을 알았다. 그리고 어떤떄엔 이모지, 이모티콘이 모두 물음표(????) 로만 나왔다. 이젠 그누보드도 게시판 글쓰기 오류를 패치해야할 때가 온것같다.~ -------------이모지(이모티콘) utf8mb4코드 ( 4바이트)=== ..

Linux 2022.05.11

Linux에서 windows파일 shell명령MySQL dump오류 해결 방법

Unix (Linux)의 텍스트 New Line 의 문자가 PC와 Unix계열이 다른 관계로 Shell 스크립트 가 windows에서 업로드 한것이 오류가 날때가 있다. 문론 FTP업로드 시에 자동으로 파일 타입을 바꿔주기도 하지만 sftp로 업로드경우에는 바꾸지 못할때가 있다. 이번에는 Editplus에 PC, Unix 변경 방법이 있어 해결을 하였다. 과거 PC 1997년도에 대학시절에 실험실에서 이와같은 원인으로 컴파일이 안되어 일일이 ^M 엔터를 모두 vi편집기로 :%s/^M//g 명령어로 하여 지워서 해결한적도 있었다.. 아래는 소스코드 zmsoft_passpt.sh 파일 echo 'hello' BACKUP_DIR=/mnt/sdb2/MyDmp2023_03 TODAY=`date +%Y-%m-%d`..

Linux 2022.03.18

http 2.4에서 Forbidden You don't have permission to access 해결방법

1) cat /etc/sysconfig/selinux 파일 수정 (enforcing => disabled 로) # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. #SELINUX=enforcing SELINUX=disabled # SELINUXTYPE= can take one of three value..

Linux 2022.03.17