In my previous project, I used PhantomJS/CasperJS for automation test. It is really amazing for all front-end guys who need write unit test for verify user experiences (e.g: submit form, change link …). The below is steps to install PhantomJS and CasperJS in Ubuntu 14.04.


Install NodeJS, PhantomJS, CasperJS in Ubuntu 14.04

Install NodeJS, PhantomJS, CasperJS in Ubuntu 14.04


Get nodeJS from personal Repository to get the latest version.



sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get update

sudo apt-get install npm nodejs



Install NodeJS:

sudo apt-get install nodejs


Now, check with command:

npm -v

node -v



You can install CasperJS via NPM command:


sudo npm install -g casperjs


Install PhantomJS  (Download source, extract files, create soft-link to executable directory):

cd /usr/local/share

sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2

sudo tar xjf phantomjs-1.9.7-linux-x86_64.tar.bz2

sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs

sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs

sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/phantomjs



Check your installation with command:

phantomjs -v

'ubuntu' 카테고리의 다른 글

DigitalOcean 디지털 오션 초기셋팅  (0) 2015.09.04
리눅스에 윈도우 글꼴 설치  (0) 2015.01.29
우분투 ssh 설치 및 포트변경  (0) 2015.01.28
handlay 핸드레이 gcc 및 gdb  (0) 2014.07.03
우분투 설치 주소  (0) 2014.07.03
Posted by wakira
,

1. 설치

$ sudo apt-get install openssh-server

* 안되면 $ sudo apt-get update



2. 포트변경

$ sudo vi /etc/ssh/sshd_config

* # port 22 -> # 지우고 원하는 포트로 변경



3. 포트변경됬는지 확인

cat /etc/ssh/sshd_config | egrep ^\#?Port



4. ssh재시작

service sshd restart



5. 방화벽추가

sudo ufw allow 18181


6. 방화벽삭제

sudo ufw delete allow 18181


7. 서버 작동 확인

$ sudo netstat -ntlp | grep ssh

########################### 결과 ##################################

$ sudo netstat -ntlp | grep ssh

tcp          0        0 0.0.0.0:22                 0.0.0.0:*                    LISTEN       10062/sshd

tcp6         0        0 :::22                         :::*                           LISTEN       10062/sshd

#################################################################



8. 프로세스 목록 확인

$ ps ax | grep ssh

######################### 결과 ####################################

$ ps ax | grep ssh

9925 ?          Ss      0:00 sshd: jiny [priv]

9941 ?          S        0:00 sshd: jiny@notty

10062 ?         Ss      0:00 /usr/sbin/sshd -D

10074 ?         Ss      0:00 sshd: jiny [priv]

10091 ?         S        0:00 sshd: jiny@pts/0

10192 pts/0    S+      0:00 grep --color=auto ssh

#################################################################



'ubuntu' 카테고리의 다른 글

리눅스에 윈도우 글꼴 설치  (0) 2015.01.29
INSTALL NODEJS, PHANTOMJS, CASPERJS IN UBUNTU 14.04  (0) 2015.01.28
handlay 핸드레이 gcc 및 gdb  (0) 2014.07.03
우분투 설치 주소  (0) 2014.07.03
소마인 설정법  (0) 2014.06.29
Posted by wakira
,
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo apt-get update
sudo apt-get install g++-4.8 -y
sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y

 

 

sudo apt-get install gdb

 

 

 

 

 

 

gcc a.c -o a -mpreferred-stack-boundary=2 -fno-stack-protector

 

set disassembly-flavor intel

'ubuntu' 카테고리의 다른 글

INSTALL NODEJS, PHANTOMJS, CASPERJS IN UBUNTU 14.04  (0) 2015.01.28
우분투 ssh 설치 및 포트변경  (0) 2015.01.28
우분투 설치 주소  (0) 2014.07.03
소마인 설정법  (0) 2014.06.29
[Tip] You have new mail in /var/spool/mail/root  (0) 2014.05.22
Posted by wakira
,

우분투 설치 주소

ubuntu 2014. 7. 3. 17:45

http://ftp.daum.net/ubuntu-releases/

 

http://mirror.premi.st/ubuntu-releases/

Posted by wakira
,

소마인 설정법

ubuntu 2014. 6. 29. 02:11

한국어설정하고 인스톨 우분투
apt-get install open-vm-tools

    1  sudo apt-get install git-core
    2  sudo apt-get install python
    3  easy_install
    4  sudo apt-get install python-setuptools
    5  pip
    6  sudo apt-get install python-pip
    7  pip
    8  l
    9  cd cubi
   10  l
   11  git clone git@github.com:ssut/Cubi.git
   12  ssh-keygen
   13  cat ~/.ssh/id_rsa/pub
   14  cat ~/.ssh/id_rsa.pub
   15  l
   16  git clone git@github.com:ssut/Cubi.git
   17  l
   18  python
   19  history
   20  pip install django
   21  history | grep python
   22  cd ..
   23  ll
   24  tar zxvf somain.tar.gz
   25  mv somain-somain-8438b10a696f/ somain/
   26  k
   27  l
   28  somain/
   29  cd somain
   30  l
   31  cd webroot
   32  l
   33  pip install -r requirements.txt
   34  clear
   35  sudo apt-get install libmagick-dev
   36  pip install -r requirements.txt
   37  sudo pip install -r requirements.txt
   38  l
   39  ./manage.py
   40  ./manage.py syncdb
   41  ./manage.py migrate
   42  ./manage.py runserver
   43  history


    1  ls
    2  cd 바탕화면/
    3  ls
    4  cd vmware-tools-distrib/
    5  ls
    6  ./vmware-install.pl
    7  sudo ./vmware-install.pl
    8  ls
    9  reboot
   10  sudo reboot
   11  sudo apt-get install git-core
   12  sudo apt-get install python
   13  sudo apt-get install python-setuptools
   14  sudo apt-get install python-pip
   15  ls
   16  git
   17  git clone git@github.com:ssut/Cubi.git
   18  ssh-keygen
   19  cat ~/.ssh/id_rsa.pub
   20  git clone git@github.com:ssut/Cubi.git
   21  ls
   22  cd Cubi/
   23  ls
   24  cd webroot/
   25  ls
   26  pip install django
   27  ls
   28  pwd
   29  sudo apt-get install libmagick-dev
   30  ls
   31  ./manage.py
   32  ./manage.py syncdb
   33  ./manage.py migrate
   34  ./manage.py runserver
   35  ls
   36  git clone git@bitbucket.org:somain/somain.git
   37  ls
   38  cd..
   39  cd ..
   40  ls
   41  cd ..
   42  ls
   43  cd C
   44  cd Cubi/
   45  ls
   46  cd webroot/
   47  ls
   48  mv somain /
   49  sudo mv somain /somain
   50  ls
   51  cd /
   52  ls
   53  cd somain/
   54  ls
   55  cd webroot/
   56  ls
   57  pip install -r requirements.txt
   58  ./manage.py
   59  ./manage.py syncbd
   60  ./manage.py syncdb
   61  ./manage.py migrate
   62  ./manage.py
   63  ls
   64  sudo ./manage.py
   65  sudo ./manage.py runserver
   66  sudo apt-get install libmagick-dev
   67  ls
   68  ./manage.py
   69  pip install django
   70  sudo pip install django
   71  ./manage.py
   72  ./manage.py syncdb
   73  ./manage.py migrate
   74  ./manage.py runserver
   75  pip install celery
   76  sudo pip install -r requirements.txt
   77  ./manage.py runserver
   78  pip install django-celery
   79  sudo pip install django-celery
   80  ./manage.py runserver
   81  ls
   82  sudo pip install -r requirements.txt
   83  ls
   84  ./manage.py runserver
   85  sudo pip install django_extensions
   86  ./manage.py runserver
   87  sudo pip install south
   88  ./manage.py runserver
   89  ./manage.py syncdb
   90  ./manage.py migrate
   91  ./manage.py runserver
   92  sudo pip install nptime
   93  ./manage.py runserver
   94  ls
   95  cd ~
   96  ls
   97  cd Cubi/
   98  ls
   99  cd webroot/
  100  ls
  101  ./manage.py runserver
  102  sudo apt-get install ssh
  103  ifconfig eth0
  104  ls
  105  ./manage.py runserver 0:8000
  106  ls
  107  history
  108  ls
  109  cd ..
  110  ls
  111  cd ..
  112  ls
  113  move /somain ./
  114  sudo move /somain ./
  115  ls
  116  sudo mv /somain ./
  117  ls
  118  hitory
  119  history
  120  ls
  121  git@github.com:jujinesy/django-tutorial.git
  122  history
  123  git clone git@github.com:jujinesy/django-tutorial.git
  124  ls
  125  cd django-tutorial/
  126  ls
  127  vi README.md
  128  ls
  129  git pull git@github.com:jujinesy/django-tutorial.git
  130  ls
  131  cd ..
  132  ls
  133  cd django-tutorial/
  134  ls
  135  vi README.md
  136  git checkout .
  137  ls
  138  vi README.md
  139  ls
  140  vi test.a
  141  ls
  142  git add -A
  143  git commit -am "test message"
  144  git push
  145  ls
  146  rm test.a
  147  ls
  148  git commit -am "delete"
  149  git push
  150  history

 


sublime package control
 sublimecodeintel
 SFTP

ubuntu - ssh


{
    // The tab key will cycle through the settings when first created
    // Visit http://wbond.net/sublime_packages/sftp/settings for help
   
    // sftp, ftp or ftps
    "type": "sftp",

    "save_before_upload": true,
    "upload_on_save": false,
    "sync_down_on_open": false,
    "sync_skip_deletes": false,
    "sync_same_age": true,
    "confirm_downloads": false,
    "confirm_sync": true,
    "confirm_overwrite_newer": false,
   
    "host": "192.168.11.132",
    "user": "a",
    "password": "aaaaaa",
    //"port": "22",
   
    "remote_path": "/home/a/Cubi/webroot",
    "ignore_regexes": [
        "\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
        "sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
        "\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
    ],
    //"file_permissions": "664",
    //"dir_permissions": "775",
   
    //"extra_list_connections": 0,

    "connect_timeout": 30,
    "keepalive": 120,
    //"ftp_passive_mode": true,
    //"ftp_obey_passive_host": false,
    //"ssh_key_file": "~/.ssh/id_rsa",
    //"sftp_flags": ["-F", "/path/to/ssh_config"],
   
    //"preserve_modification_times": false,
    //"remote_time_offset_in_hours": 0,
    //"remote_encoding": "utf-8",
    //"remote_locale": "C",
    //"allow_config_upload": false,
}

 

Posted by wakira
,

시스템이 root에게 메일을 보내는것이다.


나의 경우 크론이 일했다고 일보고를 하더라.


확인은 mail


지우는것은 cat /dev/null > /var/spool/mail/root


크론에서 꺼버리는건

vi /etc/crontab


SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=""

HOME=/



처럼 해주면 되겠다

'ubuntu' 카테고리의 다른 글

우분투 설치 주소  (0) 2014.07.03
소마인 설정법  (0) 2014.06.29
sublime text 2, FTP 연동하기....(SFTP 설정) 서브라임  (0) 2014.05.19
버전 확인 기본 명령어  (0) 2014.05.01
ns3 설치  (0) 2014.04.13
Posted by wakira
,

http://www.sublimetext.com/

 

메뉴 View > Show Console 을 선택해서 Console 창을 열고 아래의 명령어를 입력하고 Enter를 친다. 그리고 에디터를 재시작한다.

Sublime Text 2
https://packagecontrol.io/installation#st2

import urllib2,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
 

아래 서브라임 포터블 원본.

Sublime Text 2.0.2 x64.zip
다운로드

 

아래 두개는 서브라임 포터블 sftp적용된거

Sublime Text 2.0.2 x64sftp.vol1.egg
다운로드
Sublime Text 2.0.2 x64sftp.vol2.egg
다운로드

 

 

 

Sublime Text 3
https://packagecontrol.io/installation#st3

import urllib2,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')

 

 

에디터에서 Ctrl+Shift+P 를 누른 후, Install Package 를 선택한다.

SFTP 를 검색하고 설치를 진행한다. 아래는 에디터의 하단 상태바에서 설치 진행 중인 상태를 나타낸다.

사용방법은, 연동할 폴더에서 마우스 우클릭으로 팝업 메뉴를 띄운 후 "Map to Remote..." 를 실행한다.

 

1. Ctrl+Shift+P 를 누른 후, Install Package 설치

2. Ctrl+Shift+P 를 누른 후, Install Package 한번더 설치후 바로 sftp 입력설치

 

'ubuntu' 카테고리의 다른 글

소마인 설정법  (0) 2014.06.29
[Tip] You have new mail in /var/spool/mail/root  (0) 2014.05.22
버전 확인 기본 명령어  (0) 2014.05.01
ns3 설치  (0) 2014.04.13
vm웨어 툴 설치  (0) 2014.04.13
Posted by wakira
,

1.OS 버전 확인

명령어 : cat /etc/redhat-release or cat /etc/issue 

 

$ cat /etc/redhat-release

CentOS release 6.3 (Final)

 

 

2. 리눅스 커널 버전 확인

명령어 : cat /proc/version

 

$ cat /proc/version

Linux version 2.6.32-279.11.1.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Tue Oct 16 15:57:10 UTC 2012

 

 

3. OS 커널 비트수 확인 

명령어:

Solaris : isainfo -kv

HP-UX : getconf KERNEL_BITS

AIX : bootinfo -k

Linux : getconf WORD_BIT  

Linux (64bit 확인) : getconf LONG_BIT

 

$ getconf WORD_BIT

32

$ getconf LONG_BIT

64

 

 

4. OS Kernel Architecture 확인

명령어 : uname -m

# uname (옵션)

-a : All 모든 정보

-i : Platform 정보

-m : System Kernel Architecture 정보

-n : Nodename(Host name) 정보

-p : Processor(Processor type) 정보

-r : System OS Release 정보

-s : System OS 정보

-v : Kernel ID 정보

-X : 조금더 디테일 한 정보

-S : 호스트 이름 변경

 

$ uname -m

x86_64

 

 

5. CPU 정보 확인

명령어 : cat /proc/cpuinfo

 

$ cat /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 6

model           : 44

model name      : Intel(R) Xeon(R) CPU           L5640  @ 2.27GHz

stepping        : 2

cpu MHz         : 2261.064

cache size      : 12288 KB

fpu             : yes

fpu_exception   : yes

cpuid level     : 11

wp              : yes

flags           : fpu de tsc msr pae cx8 cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm rep_good aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat dts

bogomips        : 4522.12

clflush size    : 64

cache_alignment : 64

address sizes   : 40 bits physical, 48 bits virtual

power management:

 

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 6

model           : 44

model name      : Intel(R) Xeon(R) CPU           L5640  @ 2.27GHz

stepping        : 2

cpu MHz         : 2261.064

cache size      : 12288 KB

fpu             : yes

fpu_exception   : yes

cpuid level     : 11

wp              : yes

flags           : fpu de tsc msr pae cx8 cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm rep_good aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat dts

bogomips        : 4522.12

clflush size    : 64

cache_alignment : 64

address sizes   : 40 bits physical, 48 bits virtual

power management:

 

 

6. 메모리 정보 확인

명령어 : cat /proc/meminfo

 

$ cat /proc/meminfo

MemTotal:        3974716 kB

MemFree:         1313904 kB

Buffers:          305336 kB

Cached:           841180 kB

SwapCached:            0 kB

Active:          2047664 kB

Inactive:         385044 kB

Active(anon):    1286288 kB

Inactive(anon):      368 kB

Active(file):     761376 kB

Inactive(file):   384676 kB

Unevictable:           0 kB

Mlocked:               0 kB

SwapTotal:             0 kB

SwapFree:              0 kB

Dirty:                88 kB

Writeback:             0 kB

AnonPages:       1286180 kB

Mapped:            28540 kB

Shmem:               476 kB

Slab:             152640 kB

SReclaimable:      92192 kB

SUnreclaim:        60448 kB

KernelStack:        2920 kB

PageTables:        16720 kB

NFS_Unstable:          0 kB

Bounce:                0 kB

WritebackTmp:          0 kB

CommitLimit:     1987356 kB

Committed_AS:    3272724 kB

VmallocTotal:   34359738367 kB

VmallocUsed:       16884 kB

VmallocChunk:   34359721320 kB

HardwareCorrupted:     0 kB

AnonHugePages:         0 kB

HugePages_Total:       0

HugePages_Free:        0

HugePages_Rsvd:        0

HugePages_Surp:        0

Hugepagesize:       2048 kB

DirectMap4k:     4194304 kB

 

DirectMap2M:           0 kB


 

7. Disk 용량 확인

명령어 : df -h

 

$ df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/xvda1            9.9G  2.3G  7.2G  24% /

tmpfs                 1.9G     0  1.9G   0% /dev/shm

/dev/xvda2             40G  1.8G   36G   5% /home1

 


'ubuntu' 카테고리의 다른 글

[Tip] You have new mail in /var/spool/mail/root  (0) 2014.05.22
sublime text 2, FTP 연동하기....(SFTP 설정) 서브라임  (0) 2014.05.19
ns3 설치  (0) 2014.04.13
vm웨어 툴 설치  (0) 2014.04.13
크롬 설치법  (0) 2014.03.22
Posted by wakira
,

ns3 설치

ubuntu 2014. 4. 13. 21:26

첫번째 아래 설치

sudo apt-get install gcc g++ python python-dev mercurial bzr gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex bison tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev vtun lxc uncrustify doxygen python-pygraphviz imagemagick texlive texlive-latex-extra texlive-generic-extra texlive-generic-recommended texinfo dia texlive texlive-latex-extra texlive-extra-utils texlive-generic-recommended texi2html python-pygraphviz python-pygoocanvas libgoocanvas-dev 


두번째 아래 설치


sudo apt-get install gcc g++ python gcc g++ python python-dev mercurial bzr  gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex bison libfl-dev tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev vtun lxc uncrustify doxygen graphviz imagemagick texlive texlive-extra-utils texlive-latex-extra python-sphinx dia python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev libboost-signals-dev libboost-filesystem-dev openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gcc-multilib



   84  hg clone http://code.nsnam.org/ns-3-allinone

   85  ls

   86  cd ns-3-allinone/

   87  ks

   88  ls

   89  ./download.py -n ns-3-dev

   90  ls

   91  pwd

   92  ./build.py --enable-examples --enable-tests

   93  ls

   94  cd ns-3-dev/

   95  ls

   96  ./test.py -c core

   97  ls

   98  ./waf --run hello-simulator










NS-3 코드의 다운로드. all-in-one 으로 3.9 버전을 다운로드 하는 경우입니다. 다른 버전이나 dev 버전의 경우 해당 옵션을 download.py 뒤에 수정하여 입력하면 됩니다. 가능한 버전 패키지는http://code.nsnam.org 에 들어가서 확인할 수 있습니다.

hg clone http://code.nsnam.org/ns-3-allinone/

./download.py -n ns-3.9 -r ns-3.9-ref-traces

설치하기. NS-3 는 Makefile 대신 WAF 를 사용합니다. 따라서 아래 과정을 통해서 설치할 수 있습니다. -d 옵션을 적용할 때에는 -d debug, -d optimized 등으로 적용할 수 있습니다. 해당 옵션을 빌드 옵션을 변경하는 것입니다. 설정 후 ./waf 를 통해 설치를 컴파일, 설치를 시작합니다.

./waf -d optimized configure

./waf configure

./waf

설치를 완료했으면 NS-3 를 사용하기 전에 아래 명령을 수행합니다. 아래 명령을 수행하면 NS-3 를 사용할 수 있는 환경이 적용된 shell 을 띄우게 됩니다. 새로운 새로운 코드를 작성한 경우 wafscript 를 수정하고 다시 검파일 하면 됩니다. 시뮬레이션 코드 들은 build/optimzed 아래에서 찾을 수 있으며 shell 을 띄운 경우 정상 실행됩니다.

./waf shell

'ubuntu' 카테고리의 다른 글

sublime text 2, FTP 연동하기....(SFTP 설정) 서브라임  (0) 2014.05.19
버전 확인 기본 명령어  (0) 2014.05.01
vm웨어 툴 설치  (0) 2014.04.13
크롬 설치법  (0) 2014.03.22
서브라임 설정법  (0) 2014.03.22
Posted by wakira
,

vm웨어 툴 설치

ubuntu 2014. 4. 13. 21:19

툴 넣은다음에 압축파일을 바탕화면에 끌어 놓는다.

sudo ./vmware-install.pl

'ubuntu' 카테고리의 다른 글

버전 확인 기본 명령어  (0) 2014.05.01
ns3 설치  (0) 2014.04.13
크롬 설치법  (0) 2014.03.22
서브라임 설정법  (0) 2014.03.22
한글설정  (0) 2014.03.15
Posted by wakira
,