Linux에서 lsof 사용법

################################################################################ lsof 사용법 ################################################################################ ——————————————————————————– FD – stands for File descriptor and may seen some of the values as: ——————————————————————————– cwd current working directory rtd root directory txt program text (code and data) mem memory-mapped file r for read access. w for write access. u for read and write access. ——————————————————————————– TYPE – of files […]

www.xxxx.com 도메인 xxxx.com 으로 리다이렉트 시키기

만일 www.xxxx.com 도메인을 xxxx.com 도메인과 함께 같은 웹페이지를 사용하려고 한다면 VirtualHost를 두가지 노드를 생성해야 하거나 해야 한다. 이러한 불편함을 없애려면, .htaccess를 이용하여 리다이렉트 시키면 되겠다. ** 우분투 기준입니다. root@webterror:/var/www# vi /etc/apache2/sites-enabled/000-default # VirtualHost 설정 파일을 아래와 같이 편집해야 하는데, 중요한건 AllowOverride가 되어야 한다는 것이다. # /var/www 디렉토리가 .htaccess 파일을 사용할수 있도록 override를 시켜준다. <VirtualHost *:80> […]

html2pdf 우분투에서 PDF 생성 하는 프로그램 활용 방법

wkhtmltopdf 설치 sudo apt-get install wkhtmltopdf @@ 커맨드 모음 wkhtmltopdf –user-style-sheet ~/apps/wkhtmltopdf/font.css -s A4 –header-right "[webpage]" http://www.qtcentre.org/archive/index.php/t-51448.html ~/Documents/temp.pdf wkhtmltopdf –user-style-sheet ~/apps/wkhtmltopdf/font.css -s A4 –footer-left "[webpage]" http://askubuntu.com/questions/104695/how-do-i-change-mirrors-in-ubuntu-server-from-regional-to-main ~/Desktop/workspace/Prints/temp/temp.pdf wkhtmltopdf –no-outline -B 6mm -L 4mm -R 4mm -T 4mm –user-style-sheet font.css -s A4 –footer-font-size 8 –footer-line –footer-left "[webpage]" \ http://daum.net \ ~/Documents/temp.pdf wkhtmltopdf –user-style-sheet ~/apps/wkhtmltopdf/font.css -s A4 […]

Ubuntu Install History 관련 히스토리 정리

Ubuntu Install History @@ INSTALL PACKAGE sudo apt-get install libxss1 filezilla tomboy sshpass gimp ibus \ ibus-hangul openjdk-7-jdk vim-gnome nautilus-open-terminal atop htop \ lsb-core mysql-client mysql-server apache2 php5 libapache2-mod-php5 \ ssh sshfs curl sshpass php5-mysql php5-mcrypt ant git geoip-bin \ nmap tcpflow build-essential libnl-3-dev openssl ettercap-text-only \ hydra dsniff sslstrip libssl-dev rapidsvn gnome-session-fallback whois \ […]

PART1: 우분투 관련 메모들

우분투 전역변수 설정 vi /etc/environment   노틸러스에 이미지 리사이징 하는 메뉴 붙이기 sudo apt-get install nautilus-image-converter imagemagick   Ubuntu Custom Login Profile sudo cp /usr/share/xsessions/gnome-fallback.desktop /usr/share/xsessions/custom.desktop sudo vi /usr/share/xsessions/custom.desktop [Desktop Entry] Name=Webterror Session Comment=Custom ~/.xsession script Exec=/home/webterror/.xsession X-Ubuntu-Gettext-Domain=gdm   외부 FTP 마운트 시키기 webterror@webterror:~$ cat /etc/fuse.conf # Set the maximum number of FUSE mounts allowed […]

16.04 우분투 설치 히스토리

우분투 16.04 설치 순서, – webterror가 반드시 진행하는 것들을 순서대로 적어놓았다. 1. settings – 언어추가하기 2.  크롬설치 3. tomboy 설치 $ sudo apt-get install tomboy sshfs   4. ssh 동기화 시킬것 $ ssh-keygen $ ssh-copy-id -i ~/.ssh/tomboy.pub webterror@domain.net   5. ibus 한글, 일본어, 중국어 추가하기 $ sudo apt-get install ibus-hangul ibus-anthy ibus-pinyin $ ibus-daemon -rdx […]

리눅스에서 ip 확인후 메일로 보내주기

자신의 아이피 확인 curl http://www.ipip.kr 2>/dev/null | grep "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" curl http://www.ipip.kr 2>/dev/null | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" %% -o 옵션은 grep 으로 match 된것만 출력하라는 의미 현재 ipip.kr은 존재하지 않는다. 따라서 저 위의 스크립트는 다른 사이트로활용해야 하겠다. ip 정규표현식을 이용한 grep : grep “[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+”   IPADDR=$(curl http://www.ipip.kr 2>/dev/null | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" | head -n 1); […]

리눅스에서의 printf의 활용

URL : https://linuxconfig.org/bash-printf-syntax-basics-with-examples $ printf "%s\n" "1" "2" "\n3" 1 2 \n3 %b를 사용하면 \n 개행문자를 인식해서 출력한다. $ printf "%b\n" "1" "2" "\n3" 1 2 3 $   %f는 기본적으로 6자리 소수점을 나타낸다. $ printf "%f\n" 255 0xff 0377 3.5 255.000000 255.000000 377.000000 3.500000   .1로 표현하면 소수점 이하 표시구간을 정할수 있다. $ printf […]