[LINUX] 파일 인코딩 확인, 변환 _ file / iconv file -i 파일명 명령어로 파일의 인코딩을 확인 가능하다. file -i * once: inode/directory; charset=binary test.php: text/html; charset=utf-8 library.py: text/plain; charset=us-ascii db.py: text/x-python; charset=us-ascii 그리고 iconv -c -f 현재인코딩 -t 변환할인코딩 파일명 명령어로 파일의 인코딩을 변경할 수 있다. file -i test.txt test.txt: text/plain; charset=utf-8 iconv -c -f utf-8 -t euc-kr test.txt > test2.txt file -i test2.txt test2.txt: text/plai.. 서버&시스템/Linux 2년 전
Laravel - 리눅스 Ubuntu 라라벨 설치 먼저 Composer 가 없다면 설치한다. $ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer Composer 를 사용해서 laravel 을 설치할 것인데, 설치 전 아래 경로를 한번 보자. $ ll /root/.config/composer/ total 16 drwxr-xr-x 2 root root 4096 Jul 11 13:44 ./ drwxr-xr-x 3 root root 4096 Jul 11 13:44 ../ -rw-r--r-- 1 root root 799 Jul 11 13:44 keys.dev.pub -rw-r--r-- 1 root root 799 Jul 11 13:44 keys.t.. 코딩/Laravel 3년 전
리눅스 문자열 찾기/바꾸기 모든 파일에서 특정 문자열 찾는 법과 찾아서 일괄 변경하는 방법. 1. 문자열 찾기 $ grep -r "192.168.1.100" /usr/local/apache2 경로/파일명:내용 192.168.1.100 문자열이 포함된 파일을 다음 경로에서 찾아 파일명과 해당 line을 출력함. 2. 문자열 변경 $ find 경로 -type f -name '*' -exec perl -pi -e 's|aaa|bbb|g' {} \; 지정한 경로 하위의 모든 파일 내용 중 aaa를 bbb로 변경 서버&시스템/Linux 12년 전
[Apache/openssl] 사설 인증서 설정 공인 인증서를 구매하여 운영 중이던 서버 설정(Apache conf)을 그대로 가져와 구축 후, 사설 인증서를 생성하여 세팅하였다. 1. key 파일을 생성한다. $ openssl genrsa –des3 –out ssl.key 2048 … Enter pass phrase for ssl.key: 암호 입력 Verifying – Enter pass phrase for ssl.key: 암호 입력 2. 생성한 key 파일로 csr 파일을 생성한다. $ openssl req –new –key ssl.key –out ssl.csr … Country Name (2 letter code) [XX]: KR Localify Name (eq, city) [Default City]: Yongsan Organization Na.. 서버&시스템/Linux 12년 전