Linux에서 stringy 검색 활용, 또는 lookahead 사용법

stringy 검색 활용하는 방법 # sed에서 stringy 활용하는 방법 / super sed로 해야 처리가 가능하다. $ cat sample.txt | ssed -n -R 's/(<a.*?>.*?<\/a>)/\1@/gp' – R : 정규표현식을 펄형식으로 사용하기 위해서 정의해주는 것이다. .*? : 최소 매칭으로 되지만, newline은 제외된다. 따라서 a태그 내용이 도중에 줄이 바뀌었을 경우에는 검색되지 않는다. <a>태그의 시작과 끝을 나타내는 </a>의 태그를 <a.*>.*<\/a>라고 […]

iptables 그림보면서 이해하기

리눅스에서의 iptables 내가 처음 iptables을 이해 하려고 했을때가 10년전이였던것 같은데 기초적인 지식이 부족해서 그 당시에는 외계어를 읽는 듯한 기분이였다. 그리고도 계속 어떻게 사용해야 하는지 모르다가 일을 하는 와중에 하나씩 해보면서 깨우쳐 갔다. 그래서 아래의 글은 틀린내용이 다소 있을 수 있으며 그 부분을 지적해 준다면 감사할 따름이다. 이론적인 부분은 배제하고 아래의 그림을 보고 자신의 상황에 따라 […]

아파치에 로그인 인증 설치하기

아파치 자체로 가지고 있는 로그인(인증) 기능을 사용하려면 다음과 같이 설정해 준다. 서버가 실제 접근하려는 디렉토리로 가서 .htaccess 파일을 vim을 이용하여 다음과 같이 파일을 만들어 준다. AuthName LOGIN AuthType Basic AuthUserFile /home/webterror/public_html/.htpasswd AuthGroupFile /dev/null <Limit GET POST> require valid-user </Limit> AuthUserFile 해당 옵션에 있는 파일 위치는 정확하게 써준다. htpasswd 파일을 아래에서 만든다. webterror@webterror ~/public_html $ htpasswd […]

리눅스를 사용하는 노트북에서 Suspend 모드일때 USB 충전하는 방법

Device and Bus Power Management USB selective suspend This is a project in progress for the USB subsystem. USB selective suspend allows you to suspend a USB device on demand. If one device doesn’t support selective suspend, then the entire bus must remain active. This not only consumes USB bus power unnecessarily, but also prevents […]

NTFS 파티션을 마운트 했을때 unicode 문자들이 제대로 안나올때

$ emerge -pv fuse ntfs3g 두개의 패키지가 설치되었는지 확인하고, 중요한것은 ntfs3g가 unicode 문자를 인식시키게 해준다는 것이다. 아래의 내용은 설치하고 나서의 마운트 되는 파일형식의 차이를 보여준다. webterror ~ # mount rootfs on / type rootfs (rw) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755) devpts on […]

vsftp서버에서 anonymous 계정 설정하기

먼저 vsftpd.conf 파일의 주요 설정내용! # Allow anonymous FTP? (Beware – allowed by default if you comment this out). anonymous_enable=YES # # Uncomment this to allow local users to log in. local_enable=YES # # Uncomment this to enable any form of FTP write command. write_enable=YES # # Default umask for local users is 077. You […]