- sudoerの追加
sudo
コマンドのインストールzsh
のインストールとデフォルトシェルの変更vim
のインストール- ドットファイルちょっといじる
gcc
インストールmake
コマンドのインストール- Pythonのビルドに必要なパッケージのインストール
git
コマンドのインストールpyenv
のインストール- Python2.6.6環境ディレクトリの作成
- sshKeyの作成
tesseract-ocr
,python-imaging
パッケージのインストールgcutil
コマンドのインストールnvm
,node
,npm
のインストール- mongoDB最新版をインストール(せつこ、これはドライバーや)
- mongoDB最新版をインストール(aptを使う)
go
のインストールrevel
のインストールtmux
のインストール- apache2のインストールとリバースプロキシ設定
-
-
Save otiai10/6779454 to your computer and use it in GitHub Desktop.
sudo
コマンドインストール
otiai10@www15224uf:~$ su -
Password:
root@www15224uf:~# apt-get install sudo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
sudo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 842 kB of archives.
After this operation, 1,882 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main sudo amd64 1.8.5p2-1+nmu1 [842 kB]
Fetched 842 kB in 0s (1,137 kB/s)
Selecting previously unselected package sudo.
(Reading database ... 24559 files and directories currently installed.)
Unpacking sudo (from .../sudo_1.8.5p2-1+nmu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up sudo (1.8.5p2-1+nmu1) ...
root@www15224uf:~# which sudo
/usr/bin/sudo
root@www15224uf:~#
おわり
zsh
のインストールとデフォルトシェルの変更
zsh
インストール
otiai10@www15224uf:~$ sudo apt-get install zsh
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for otiai10:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
zsh-doc
The following NEW packages will be installed:
zsh
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,916 kB of archives.
After this operation, 11.7 MB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main zsh amd64 4.3.17-1 [4,916 kB]
Fetched 4,916 kB in 1s (3,099 kB/s)
Selecting previously unselected package zsh.
(Reading database ... 24628 files and directories currently installed.)
Unpacking zsh (from .../zsh_4.3.17-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up zsh (4.3.17-1) ...
update-alternatives: using /bin/zsh4 to provide /bin/zsh (zsh) in auto mode
update-alternatives: using /bin/zsh4 to provide /bin/rzsh (rzsh) in auto mode
update-alternatives: using /bin/zsh4 to provide /bin/ksh (ksh) in auto mode
otiai10@www15224uf:~$
otiai10@www15224uf:~$ which zsh
/usr/bin/zsh
otiai10@www15224uf:~$
デフォルトシェルの変更
otiai10@www15224uf:~$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/bin/zsh
/usr/bin/zsh
otiai10@www15224uf:~$
otiai10@www15224uf:~$ chsh -s /usr/bin/zsh
Password:
otiai10@www15224uf:~$
一度ログアウトしてもう一度sshしてみる
www15224uf%
www15224uf% echo $SHELL
/usr/bin/zsh
www15224uf%
おわり
vim
のインストール
www15224uf% sudo apt-get install vim
[sudo] password for otiai10:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
vim-runtime
Suggested packages:
ctags vim-doc vim-scripts
The following NEW packages will be installed:
vim vim-runtime
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,448 kB of archives.
After this operation, 24.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main vim-runtime all 2:7.3.547-7 [4,607 kB]
Get:2 http://ftp.jp.debian.org/debian/ wheezy/main vim amd64 2:7.3.547-7 [841 kB]
Fetched 5,448 kB in 2s (2,122 kB/s)
Selecting previously unselected package vim-runtime.
(Reading database ... 25797 files and directories currently installed.)
Unpacking vim-runtime (from .../vim-runtime_2%3a7.3.547-7_all.deb) ...
Adding 'diversion of /usr/share/vim/vim73/doc/help.txt to /usr/share/vim/vim73/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim73/doc/tags to /usr/share/vim/vim73/doc/tags.vim-tiny by vim-runtime'
Selecting previously unselected package vim.
Unpacking vim (from .../vim_2%3a7.3.547-7_amd64.deb) ...
Processing triggers for man-db ...
Setting up vim-runtime (2:7.3.547-7) ...
Processing /usr/share/vim/addons/doc
Setting up vim (2:7.3.547-7) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
www15224uf% which vim
/usr/bin/vim
www15224uf%
おわり
ドットファイルちょっといじる
~/.vimrc
" color
syntax on
" tab
set tabstop=4
set expandtab
~/.zshrc
##### alias
alias vi='vim'
おわり
gcc
インストール
www15224uf% sudo apt-get install -y gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
...中略...
Setting up manpages-dev (3.44-1) ...
www15224uf% gcc --version
gcc (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
www15224uf%
make
コマンドのインストール
www15224uf% sudo apt-get install make
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
make-doc
The following NEW packages will be installed:
make
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 396 kB of archives.
After this operation, 1,172 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main make amd64 3.81-8.2 [396 kB]
Fetched 396 kB in 0s (688 kB/s)
Selecting previously unselected package make.
(Reading database ... 30822 files and directories currently installed.)
Unpacking make (from .../make_3.81-8.2_amd64.deb) ...
Processing triggers for man-db ...
Setting up make (3.81-8.2) ...
www15224uf% make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
www15224uf%
Pythonのビルドに必要なパッケージのインストール
参考
- pyenv/pyenv#40
- http://stackoverflow.com/questions/6169522/no-module-named-zlib
- https://github.com/yyuu/pyenv/wiki/Common-build-problems
libreadline-dev
# zlib-dev
zlib1g-dev
libbz2-dev
libsqlite3-dev
libssl-dev
build-essential
www15224uf% apt-cache search build-essential
build-essential - Informational list of build-essential packages
devscripts - scripts to make the life of a Debian Package maintainer easier
dh-buildinfo - Debhelper addon to track package versions used to build a package
sbuild - Tool for building Debian binary packages from Debian sources
www15224uf% sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
dpkg-dev fakeroot g++ g++-4.7 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libfile-fcntllock-perl libstdc++6-4.7-dev libtimedate-perl
Suggested packages:
debian-keyring g++-multilib g++-4.7-multilib gcc-4.7-doc libstdc++6-4.7-dbg libstdc++6-4.7-doc
The following NEW packages will be installed:
build-essential dpkg-dev fakeroot g++ g++-4.7 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libfile-fcntllock-perl libstdc++6-4.7-dev
libtimedate-perl
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.2 MB of archives.
After this operation, 32.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main libstdc++6-4.7-dev amd64 4.7.2-5 [1,726 kB]
Get:2 http://ftp.jp.debian.org/debian/ wheezy/main g++-4.7 amd64 4.7.2-5 [8,011 kB]
Get:3 http://ftp.jp.debian.org/debian/ wheezy/main g++ amd64 4:4.7.2-1 [1,374 B]
Get:4 http://ftp.jp.debian.org/debian/ wheezy/main libtimedate-perl all 1.2000-1 [41.2 kB]
Get:5 http://ftp.jp.debian.org/debian/ wheezy/main libdpkg-perl all 1.16.10 [949 kB]
Get:6 http://ftp.jp.debian.org/debian/ wheezy/main dpkg-dev all 1.16.10 [1,288 kB]
Get:7 http://ftp.jp.debian.org/debian/ wheezy/main build-essential amd64 11.5 [7,178 B]
Get:8 http://ftp.jp.debian.org/debian/ wheezy/main fakeroot amd64 1.18.4-2 [109 kB]
Get:9 http://ftp.jp.debian.org/debian/ wheezy/main libalgorithm-diff-perl all 1.19.02-2 [51.5 kB]
Get:10 http://ftp.jp.debian.org/debian/ wheezy/main libalgorithm-diff-xs-perl amd64 0.04-2+b1 [12.9 kB]
Get:11 http://ftp.jp.debian.org/debian/ wheezy/main libalgorithm-merge-perl all 0.08-2 [13.5 kB]
Get:12 http://ftp.jp.debian.org/debian/ wheezy/main libfile-fcntllock-perl amd64 0.14-2 [17.2 kB]
Fetched 12.2 MB in 2s (4,943 kB/s)
Selecting previously unselected package libstdc++6-4.7-dev.
(Reading database ... 32347 files and directories currently installed.)
Unpacking libstdc++6-4.7-dev (from .../libstdc++6-4.7-dev_4.7.2-5_amd64.deb) ...
Selecting previously unselected package g++-4.7.
Unpacking g++-4.7 (from .../g++-4.7_4.7.2-5_amd64.deb) ...
Selecting previously unselected package g++.
Unpacking g++ (from .../g++_4%3a4.7.2-1_amd64.deb) ...
Selecting previously unselected package libtimedate-perl.
Unpacking libtimedate-perl (from .../libtimedate-perl_1.2000-1_all.deb) ...
Selecting previously unselected package libdpkg-perl.
Unpacking libdpkg-perl (from .../libdpkg-perl_1.16.10_all.deb) ...
Selecting previously unselected package dpkg-dev.
Unpacking dpkg-dev (from .../dpkg-dev_1.16.10_all.deb) ...
Selecting previously unselected package build-essential.
Unpacking build-essential (from .../build-essential_11.5_amd64.deb) ...
Selecting previously unselected package fakeroot.
Unpacking fakeroot (from .../fakeroot_1.18.4-2_amd64.deb) ...
Selecting previously unselected package libalgorithm-diff-perl.
Unpacking libalgorithm-diff-perl (from .../libalgorithm-diff-perl_1.19.02-2_all.deb) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Unpacking libalgorithm-diff-xs-perl (from .../libalgorithm-diff-xs-perl_0.04-2+b1_amd64.deb) ...
Selecting previously unselected package libalgorithm-merge-perl.
Unpacking libalgorithm-merge-perl (from .../libalgorithm-merge-perl_0.08-2_all.deb) ...
Selecting previously unselected package libfile-fcntllock-perl.
Unpacking libfile-fcntllock-perl (from .../libfile-fcntllock-perl_0.14-2_amd64.deb) ...
Processing triggers for man-db ...
Setting up libtimedate-perl (1.2000-1) ...
Setting up libdpkg-perl (1.16.10) ...
Setting up dpkg-dev (1.16.10) ...
Setting up fakeroot (1.18.4-2) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libalgorithm-diff-perl (1.19.02-2) ...
Setting up libalgorithm-diff-xs-perl (0.04-2+b1) ...
Setting up libalgorithm-merge-perl (0.08-2) ...
Setting up libfile-fcntllock-perl (0.14-2) ...
Setting up g++-4.7 (4.7.2-5) ...
Setting up g++ (4:4.7.2-1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (11.5) ...
Setting up libstdc++6-4.7-dev (4.7.2-5) ...
www15224uf%
git
コマンドのインストール
www15224uf% sudo apt-get install git
www15224uf% git --version
git version 1.7.10.4
www15224uf%
pyenv
のインストール
http://qiita.com/la_luna_azul/items/3f64016feaad1722805c
www15224uf% cd ~
www15224uf% git clone git://github.com/yyuu/pyenv.git .pyenv
Cloning into '.pyenv'...
remote: Counting objects: 2842, done.
remote: Compressing objects: 100% (751/751), done.
remote: Total 2842 (delta 1980), reused 2782 (delta 1935)
Receiving objects: 100% (2842/2842), 440.49 KiB | 177 KiB/s, done.
Resolving deltas: 100% (1980/1980), done.
www15224uf% echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.zshrc
www15224uf% echo 'if [ -d "${PYENV_ROOT}" ]; then' >> ~/.zshrc
www15224uf% echo ' export PATH=${PYENV_ROOT}/bin:$PATH' >> ~/.zshrc
www15224uf% echo ' eval "$(pyenv init -)"' >> ~/.zshrc
www15224uf% echo 'fi' >> ~/.zshrc
www15224uf% exec $SHELL -l
www15224uf% cd $PYENV_ROOT/plugins
www15224uf% git clone git://github.com/yyuu/pyenv-virtualenv.git
Cloning into 'pyenv-virtualenv'...
remote: Counting objects: 340, done.
remote: Compressing objects: 100% (143/143), done.
remote: Total 340 (delta 183), reused 331 (delta 174)
Receiving objects: 100% (340/340), 126.03 KiB | 71 KiB/s, done.
Resolving deltas: 100% (183/183), done.
www15224uf%
www15224uf% cd ~
www15224uf% pyenv --version
pyenv 0.4.0-20130726-32-gc95d446
www15224uf%
Python2.6.6環境ディレクトリの作成
デフォルトPythonを確認
www15224uf% python --version
Python 2.7.3
Python2.6.6をビルド
www15224uf% pyenv install --list
Available versions:
...略...
2.5.3
2.5.4
2.5.5
2.5.6
2.6.6
2.6.7
2.6.8
...略...
www15224uf%
www15224uf% pyenv install 2.6.6
Downloading Python-2.6.6.tgz...
-> http://yyuu.github.io/pythons/b2f209df270a33315e62c1ffac1937f0
Installing Python-2.6.6...
Installed Python-2.6.6 to /home/otiai10/.pyenv/versions/2.6.6
Downloading setuptools-1.1.4.tar.gz...
-> https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.4.tar.gz
Installing setuptools-1.1.4...
Installed setuptools-1.1.4 to /home/otiai10/.pyenv/versions/2.6.6
Downloading pip-1.4.1.tar.gz...
-> https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz
Installing pip-1.4.1...
Installed pip-1.4.1 to /home/otiai10/.pyenv/versions/2.6.6
www15224uf%
local Pythonを設定、確認
(謎に一回ログアウトせねばならぬ)
www15224uf% cd ~
www15224uf% mkdir -p proj/python/my_version-test
www15224uf% cd proj/python/my_version-test
www15224uf% python --version
Python 2.7.3
www15224uf% pyenv local 2.6.6
www15224uf% exit
www15224uf% cd proj/python/my_version-test
www15224uf% python --version
Python 2.6.6
www15224uf%
sshKeyの作成
www15224uf% ls -la ~/.ssh
ls: cannot access /home/otiai10/.ssh: No such file or directory
www15224uf% ssh-keygen
www15224uf% ls -la ~/.ssh
total 16
drwx------ 2 otiai10 otiai10 4096 Oct 2 02:08 .
drwxr-xr-x 5 otiai10 otiai10 4096 Oct 2 02:08 ..
-rw------- 1 otiai10 otiai10 1766 Oct 2 02:08 id_rsa
-rw-r--r-- 1 otiai10 otiai10 400 Oct 2 02:08 id_rsa.pub
www15224uf%
github.comにid_rsa.pubを置いたりするワケ
tesseract-ocr
,python-imaging
パッケージのインストール
https://github.com/otiai10/ocrServer こいつのために必要やったんや
tesseract-ocr
www15224uf% apt-cache search tesseract-ocr
tesseract-ocr - Command line OCR tool
www15224uf% sudo apt-get install tesseract-ocr
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libgif4 libjbig0 liblept3 libpng12-0 libtesseract3 libtiff4 libwebp2 tesseract-ocr-eng tesseract-ocr-equ tesseract-ocr-osd
The following NEW packages will be installed:
libgif4 libjbig0 liblept3 libpng12-0 libtesseract3 libtiff4 libwebp2 tesseract-ocr tesseract-ocr-eng tesseract-ocr-equ tesseract-ocr-osd
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.0 MB of archives.
After this operation, 81.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main libpng12-0 amd64 1.2.49-1 [190 kB]
Get:2 http://ftp.jp.debian.org/debian/ wheezy/main libjbig0 amd64 2.0-2 [32.2 kB]
Get:3 http://ftp.jp.debian.org/debian/ wheezy/main libtiff4 amd64 3.9.6-11 [202 kB]
Get:4 http://ftp.jp.debian.org/debian/ wheezy/main libwebp2 amd64 0.1.3-3+nmu1 [114 kB]
Get:5 http://ftp.jp.debian.org/debian/ wheezy/main libgif4 amd64 4.1.6-10 [42.7 kB]
Get:6 http://ftp.jp.debian.org/debian/ wheezy/main liblept3 amd64 1.69-3.1 [772 kB]
Get:7 http://ftp.jp.debian.org/debian/ wheezy/main libtesseract3 amd64 3.02.01-6 [1,401 kB]
Get:8 http://ftp.jp.debian.org/debian/ wheezy/main tesseract-ocr-eng all 3.02-2 [22.0 MB]
Get:9 http://ftp.jp.debian.org/debian/ wheezy/main tesseract-ocr-osd all 3.02-2 [4,276 kB]
Get:10 http://ftp.jp.debian.org/debian/ wheezy/main tesseract-ocr-equ all 3.02-2 [823 kB]
Get:11 http://ftp.jp.debian.org/debian/ wheezy/main tesseract-ocr amd64 3.02.01-6 [153 kB]
Fetched 30.0 MB in 4s (6,298 kB/s)
Selecting previously unselected package libpng12-0:amd64.
(Reading database ... 34619 files and directories currently installed.)
Unpacking libpng12-0:amd64 (from .../libpng12-0_1.2.49-1_amd64.deb) ...
Selecting previously unselected package libjbig0:amd64.
Unpacking libjbig0:amd64 (from .../libjbig0_2.0-2_amd64.deb) ...
Selecting previously unselected package libtiff4:amd64.
Unpacking libtiff4:amd64 (from .../libtiff4_3.9.6-11_amd64.deb) ...
Selecting previously unselected package libwebp2:amd64.
Unpacking libwebp2:amd64 (from .../libwebp2_0.1.3-3+nmu1_amd64.deb) ...
Selecting previously unselected package libgif4.
Unpacking libgif4 (from .../libgif4_4.1.6-10_amd64.deb) ...
Selecting previously unselected package liblept3.
Unpacking liblept3 (from .../liblept3_1.69-3.1_amd64.deb) ...
Selecting previously unselected package libtesseract3.
Unpacking libtesseract3 (from .../libtesseract3_3.02.01-6_amd64.deb) ...
Selecting previously unselected package tesseract-ocr-eng.
Unpacking tesseract-ocr-eng (from .../tesseract-ocr-eng_3.02-2_all.deb) ...
Selecting previously unselected package tesseract-ocr-osd.
Unpacking tesseract-ocr-osd (from .../tesseract-ocr-osd_3.02-2_all.deb) ...
Selecting previously unselected package tesseract-ocr-equ.
Unpacking tesseract-ocr-equ (from .../tesseract-ocr-equ_3.02-2_all.deb) ...
Selecting previously unselected package tesseract-ocr.
Unpacking tesseract-ocr (from .../tesseract-ocr_3.02.01-6_amd64.deb) ...
Processing triggers for man-db ...
Setting up libpng12-0:amd64 (1.2.49-1) ...
Setting up libjbig0:amd64 (2.0-2) ...
Setting up libtiff4:amd64 (3.9.6-11) ...
Setting up libwebp2:amd64 (0.1.3-3+nmu1) ...
Setting up libgif4 (4.1.6-10) ...
Setting up liblept3 (1.69-3.1) ...
Setting up libtesseract3 (3.02.01-6) ...
Setting up tesseract-ocr-eng (3.02-2) ...
Setting up tesseract-ocr-osd (3.02-2) ...
Setting up tesseract-ocr-equ (3.02-2) ...
Setting up tesseract-ocr (3.02.01-6) ...
www15224uf%
python-imaging
www15224uf% apt-cache search python-imaging
python-imaging - Python Imaging Library
python-imaging-dbg - Python Imaging Library (debug extension)
python-imaging-doc - Examples for the Python Imaging Library
python-imaging-sane - Python Imaging Library - SANE interface
python-imaging-sane-dbg - Python Imaging Library - SANE interface (debug extension)
python-imaging-tk - Python Imaging Library - ImageTk Module
python-imaging-tk-dbg - Python Imaging Library - ImageTk Module (debug extension)
python-imaging-doc-html - Documentation for the Python Imaging Library.
python-imaging-doc-pdf - Documentation for the Python Imaging Library.
www15224uf% sudo apt-get install python-imaging
[sudo] password for otiai10:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libjpeg8 liblcms1
Suggested packages:
liblcms-utils python-imaging-doc python-imaging-dbg
The following NEW packages will be installed:
libjpeg8 liblcms1 python-imaging
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 703 kB of archives.
After this operation, 2,157 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main libjpeg8 amd64 8d-1 [134 kB]
Get:2 http://ftp.jp.debian.org/debian/ wheezy/main liblcms1 amd64 1.19.dfsg-1.2 [113 kB]
Get:3 http://ftp.jp.debian.org/debian/ wheezy/main python-imaging amd64 1.1.7-4 [457 kB]
Fetched 703 kB in 0s (749 kB/s)
Selecting previously unselected package libjpeg8:amd64.
(Reading database ... 34325 files and directories currently installed.)
Unpacking libjpeg8:amd64 (from .../libjpeg8_8d-1_amd64.deb) ...
Selecting previously unselected package liblcms1:amd64.
Unpacking liblcms1:amd64 (from .../liblcms1_1.19.dfsg-1.2_amd64.deb) ...
Selecting previously unselected package python-imaging.
Unpacking python-imaging (from .../python-imaging_1.1.7-4_amd64.deb) ...
Setting up libjpeg8:amd64 (8d-1) ...
Setting up liblcms1:amd64 (1.19.dfsg-1.2) ...
Setting up python-imaging (1.1.7-4) ...
www15224uf%
gcutil
コマンドのインストール
https://developers.google.com/compute/docs/gcutil/
www15224uf% cd ~
www15224uf% wget https://google-compute-engine-tools.googlecode.com/files/gcutil-1.8.4.tar.gz
--2013-10-02 11:29:50-- https://google-compute-engine-tools.googlecode.com/files/gcutil-1.8.4.tar.gz
Resolving google-compute-engine-tools.googlecode.com (google-compute-engine-tools.googlecode.com)... 173.194.72.82, 2404:6800:4008:c01::52
Connecting to google-compute-engine-tools.googlecode.com (google-compute-engine-tools.googlecode.com)|173.194.72.82|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 393068 (384K) [application/x-gzip]
Saving to: `gcutil-1.8.4.tar.gz'
100%[==============================================================================================================================================================================>] 393,068 459K/s in 0.8s
2013-10-02 11:29:52 (459 KB/s) - `gcutil-1.8.4.tar.gz' saved [393068/393068]
www15224uf%
www15224uf% tar xzvpf gcutil-1.8.4.tar.gz -C $HOME
gcutil-1.8.4/
gcutil-1.8.4/VERSION
gcutil-1.8.4/LICENSE
gcutil-1.8.4/CHANGELOG
gcutil-1.8.4/gcutil
gcutil-1.8.4/Makefile
gcutil-1.8.4/lib/
...以下略...
bind PATH to gcutil in .zshrc
# gcutil
GCUTIL=$HOME/gcutil-1.8.4
export PATH=${PATH}:$GCUTIL
www15224uf% which gcutil
/home/otiai10/gcutil-1.8.4/gcutil
www15224uf%
nvm
,node
,npm
のインストール
nvm
のインストール
www15224uf% cd ~
www15224uf% git clone git://github.com/creationix/nvm.git ~/.nvm
Cloning into '/home/otiai10/.nvm'...
remote: Counting objects: 754, done.
remote: Compressing objects: 100% (511/511), done.
remote: Total 754 (delta 363), reused 598 (delta 232)
Receiving objects: 100% (754/754), 116.51 KiB | 138 KiB/s, done.
Resolving deltas: 100% (363/363), done.
www15224uf%
www15224uf% source ~/.nvm/nvm.sh
~/.zshrc
にあとで書いておく
最新版node
のインストール
www15224uf% nvm ls-remote
nvm_ls_remote:10: command not found: curl
N/A
www15224uf%
curl
が無い...
curl
インストール
www15224uf% apt-cache search curl
...略...
curl - command line tool for transferring data with URL syntax
...略...
www15224uf% sudo apt-get install curl
[sudo] password for otiai10:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libcurl3
The following NEW packages will be installed:
curl libcurl3
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 601 kB of archives.
After this operation, 987 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org/ wheezy/updates/main libcurl3 amd64 7.26.0-1+wheezy3 [331 kB]
Get:2 http://security.debian.org/ wheezy/updates/main curl amd64 7.26.0-1+wheezy3 [270 kB]
Fetched 601 kB in 5s (103 kB/s)
Selecting previously unselected package libcurl3:amd64.
(Reading database ... 34747 files and directories currently installed.)
Unpacking libcurl3:amd64 (from .../libcurl3_7.26.0-1+wheezy3_amd64.deb) ...
Selecting previously unselected package curl.
Unpacking curl (from .../curl_7.26.0-1+wheezy3_amd64.deb) ...
Processing triggers for man-db ...
Setting up libcurl3:amd64 (7.26.0-1+wheezy3) ...
Setting up curl (7.26.0-1+wheezy3) ...
www15224uf% which curl
/usr/bin/curl
気を取り直してnode
インストール
www15224uf% nvm ls-remote
www15224uf% nvm install v0.10.20
######################################################################## 100.0%
Now using node v0.10.20
www15224uf% nvm version
v0.10.20
www15224uf% nvm install v0.8.25
######################################################################## 100.0%
Now using node v0.8.25
www15224uf% nvm version
v0.8.25
www15224uf% nvm ls
v0.8.25
v0.10.20
current: v0.8.25
www15224uf% nvm use v0.10.20
Now using node v0.10.20
www15224uf%
www15224uf% node --version
v0.10.20
www15224uf% npm --version
1.3.11
www15224uf% nvm alias default v0.10.20
default -> v0.10.20
www15224uf%
mongoDB最新版をインストール(せつこ、これはドライバーや)
www15224uf% npm search mongodb
mongodb A node.js driver for MongoDB
www15224uf% npm install mongodb
npm http GET https://registry.npmjs.org/mongodb
npm http 200 https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/mongodb/-/mongodb-1.3.19.tgz
npm http 200 https://registry.npmjs.org/mongodb/-/mongodb-1.3.19.tgz
npm http GET https://registry.npmjs.org/bson/0.2.2
npm http GET https://registry.npmjs.org/kerberos/0.0.3
npm http 200 https://registry.npmjs.org/kerberos/0.0.3
npm http GET https://registry.npmjs.org/kerberos/-/kerberos-0.0.3.tgz
npm http 200 https://registry.npmjs.org/bson/0.2.2
npm http GET https://registry.npmjs.org/bson/-/bson-0.2.2.tgz
npm http 200 https://registry.npmjs.org/bson/-/bson-0.2.2.tgz
npm http 200 https://registry.npmjs.org/kerberos/-/kerberos-0.0.3.tgz
> [email protected] install /home/otiai10/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
> [email protected] install /home/otiai10/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/otiai10/node_modules/mongodb/node_modules/kerberos/build'
SOLINK_MODULE(target) Release/obj.target/kerberos.node
SOLINK_MODULE(target) Release/obj.target/kerberos.node: Finished
COPY Release/kerberos.node
make: Leaving directory `/home/otiai10/node_modules/mongodb/node_modules/kerberos/build'
make: Entering directory `/home/otiai10/node_modules/mongodb/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/obj.target/bson.node
SOLINK_MODULE(target) Release/obj.target/bson.node: Finished
COPY Release/bson.node
make: Leaving directory `/home/otiai10/node_modules/mongodb/node_modules/bson/build'
[email protected] node_modules/mongodb
├── [email protected]
└── [email protected]
www15224uf%
mongoDB最新版をインストール
www15224uf% cat /proc/cpuinfo | grep flag
flags : fpu de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl pni ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes hypervisor
flags : fpu de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl pni ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes hypervisor
flags : fpu de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl pni ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes hypervisor
www15224uf% uname -a
Linux www15224uf 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux
www15224uf%
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/
www15224uf% sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
[sudo] password for otiai10:
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.9GwFikOn01 --trustdb-name /etc/apt//trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-stable.gpg --keyserver keyserver.ubuntu.com --recv 7F0CEB10
gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
gpg: key 7F0CEB10: public key "Richard Kreuter <[email protected]>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
www15224uf%
www15224uf% echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen
www15224uf%
www15224uf% sudo apt-get update
Get:1 http://downloads-distro.mongodb.org dist Release.gpg [490 B]
Hit http://ftp.jp.debian.org wheezy Release.gpg
Get:2 http://ftp.jp.debian.org wheezy-updates Release.gpg [1,571 B]
Hit http://ftp.jp.debian.org wheezy Release
Get:3 http://ftp.jp.debian.org wheezy-updates Release [124 kB]
Get:4 http://downloads-distro.mongodb.org dist Release [2,032 B]
Hit http://ftp.jp.debian.org wheezy/main Sources
Hit http://ftp.jp.debian.org wheezy/main amd64 Packages
Hit http://ftp.jp.debian.org wheezy/main Translation-en
Get:5 http://ftp.jp.debian.org wheezy-updates/main Sources [1,995 B]
Hit http://ftp.jp.debian.org wheezy-updates/main amd64 Packages/DiffIndex
Hit http://ftp.jp.debian.org wheezy-updates/main Translation-en/DiffIndex
Hit http://security.debian.org wheezy/updates Release.gpg
Get:6 http://downloads-distro.mongodb.org dist/10gen amd64 Packages [7,272 B]
Hit http://security.debian.org wheezy/updates Release
Hit http://security.debian.org wheezy/updates/main Sources
Hit http://security.debian.org wheezy/updates/main amd64 Packages
Hit http://security.debian.org wheezy/updates/main Translation-en
Ign http://downloads-distro.mongodb.org dist/10gen Translation-en_US
Ign http://downloads-distro.mongodb.org dist/10gen Translation-en
Fetched 137 kB in 4s (27.7 kB/s)
Reading package lists... Done
www15224uf%
aptで入れれるパッケージが更新された感ある
www15224uf% sudo apt-get install mongodb-10gen
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
mongodb-10gen
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 87.8 MB of archives.
After this operation, 225 MB of additional disk space will be used.
Get:1 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen mongodb-10gen amd64 2.4.6 [87.8 MB]
Fetched 87.8 MB in 25s (3,418 kB/s)
Selecting previously unselected package mongodb-10gen.
(Reading database ... 34781 files and directories currently installed.)
Unpacking mongodb-10gen (from .../mongodb-10gen_2.4.6_amd64.deb) ...
Processing triggers for man-db ...
Setting up mongodb-10gen (2.4.6) ...
Adding system user `mongodb' (UID 104) ...
Adding new user `mongodb' (UID 104) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 106) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
[ ok ] Starting database: mongodb.
www15224uf%
いけた感ある
www15224uf% mongo
MongoDB shell version: 2.4.6
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
> exit
bye
www15224uf%
いけたしv2.4.6である
go
のインストール
https://gist.github.com/otiai10/6596982
mercurial(hg
)のインストール
www15224uf% apt-cache search mercurial
mercurial - easy-to-use, scalable distributed version control system
www15224uf% sudo apt-get install mercurial
[sudo] password for otiai10:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mercurial-common
Suggested packages:
qct wish kdiff3 kdiff3-qt kompare meld xxdiff tkcvs mgdiff python-mysqldb python-pygments python-openssl
The following NEW packages will be installed:
mercurial mercurial-common
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,413 kB of archives.
After this operation, 8,067 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main mercurial-common all 2.2.2-3 [2,320 kB]
Get:2 http://ftp.jp.debian.org/debian/ wheezy/main mercurial amd64 2.2.2-3 [93.1 kB]
Fetched 2,413 kB in 1s (1,630 kB/s)
Selecting previously unselected package mercurial-common.
(Reading database ... 34815 files and directories currently installed.)
Unpacking mercurial-common (from .../mercurial-common_2.2.2-3_all.deb) ...
Selecting previously unselected package mercurial.
Unpacking mercurial (from .../mercurial_2.2.2-3_amd64.deb) ...
Processing triggers for man-db ...
Setting up mercurial-common (2.2.2-3) ...
Setting up mercurial (2.2.2-3) ...
Creating config file /etc/mercurial/hgrc.d/hgext.rc with new version
www15224uf% which hg
/usr/bin/hg
www15224uf%
$GOROOT
,$GOPATH
の設定
~/.zshrc
# - go
export GOROOT=$HOME/proj/go
export GOPATH=$HOME/proj/go/packages
export PATH=${PATH}:$GOROOT/bin:$GOPATH/bin
www15224uf% source ~/.zshrc
ソースのダウンロード
www15224uf% cd ~/src
www15224uf% wget https://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
--2013-10-02 14:48:42-- https://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
Resolving go.googlecode.com (go.googlecode.com)... 74.125.31.82, 2404:6800:4008:c00::52
Connecting to go.googlecode.com (go.googlecode.com)|74.125.31.82|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 41756805 (40M) [application/x-gzip]
Saving to: `go1.1.2.linux-amd64.tar.gz'
100%[==============================================================================================================================================================================>] 41,756,805 4.35M/s in 17s
2013-10-02 14:49:01 (2.28 MB/s) - `go1.1.2.linux-amd64.tar.gz' saved [41756805/41756805]
www15224uf% tar -xzf go1.1.2.linux-amd64.tar.gz
www15224uf% cp -r go ~/proj
www15224uf%
ビルド
www15224uf% cd $GOROOT/src
www15224uf% ./all.bash
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, linux/amd64.
...中略...
ALL TESTS PASSED
---
Installed Go for linux/amd64 in /home/otiai10/proj/go
Installed commands in /home/otiai10/proj/go/bin
www15224uf%
www15224uf% which go
/home/otiai10/proj/go/bin/go
GOROOT
もGOPATH
もちゃんと効いてるもよう
revel
のインストール
www15224uf% cd ~
www15224uf% go get github.com/robfig/revel/revel
www15224uf% which revel
/home/otiai10/proj/go/packages/bin/revel
www15224uf%
サンプルアプリの起動
www15224uf% revel run github.com/robfig/revel/samples/chat
~
~ revel! http://robfig.github.com/revel
~
2013/10/02 15:04:26 revel.go:292: Loaded module static
2013/10/02 15:04:26 revel.go:292: Loaded module testrunner
2013/10/02 15:04:26 run.go:57: Running chat (github.com/robfig/revel/samples/chat) in dev mode
2013/10/02 15:04:26 harness.go:157: Listening on :9000
2013/10/02 15:04:39 revel.go:292: Loaded module static
2013/10/02 15:04:39 revel.go:292: Loaded module testrunner
2013/10/02 15:04:39 main.go:30: Running revel server
Go to /@tests to run the tests.
Listening on port 49160...
^C% www15224uf%
いけた
mgo
のインストール
mgo
Rich MongoDB driver for Go
bzr
のインストール
パッケージ: bzr (2.6.0~bzr6526-1) 簡単に使える分散型バージョン管理システム
Bazaar は分散型バージョン管理システムです。簡単に使えて、直感的で、いろいろ なワークフローに適用でき、信頼性があり、かつ、簡単に拡張できるように設計されています。
www15224uf% apt-cache search bzr
bzr - easy to use distributed version control system
www15224uf% sudo apt-get install bzr
[sudo] password for otiai10:
...中略...
Setting up python-configobj (4.7.2+ds-4) ...
Setting up python-bzrlib (2.6.0~bzr6526-1) ...
Setting up bzr (2.6.0~bzr6526-1) ...
Setting up wwwconfig-common (0.2.2) ...
Setting up javascript-common (7) ...
Setting up libjs-jquery (1.7.2+dfsg-1) ...
Setting up python-crypto (2.6-4) ...
Setting up python-gpgme (0.2-3) ...
Setting up python-httplib2 (0.7.4-2) ...
Setting up python-keyring (0.7.1-1+deb7u1) ...
Setting up python-pkg-resources (0.6.24-1) ...
Setting up python-simplejson (2.5.2-1) ...
Setting up python-lazr.uri (1.0.3-1) ...
Setting up python-wadllib (1.3.0-2) ...
Setting up python-zope.interface (3.6.1-3) ...
Setting up python-oauth (1.0.1-3) ...
Setting up python-lazr.restfulclient (0.12.0-2) ...
Setting up python-launchpadlib (1.9.12-2) ...
Setting up python-paramiko (1.7.7.1-3.1) ...
www15224uf%
なんか色々入ったな...
mgo
のインストール
www15224uf% go get labix.org/v2/mgo
www15224uf%
サンプルアプリ作るためのデータをつくる
www15224uf% mongo
MongoDB shell version: 2.4.6
connecting to: test
> help
db.help() help on db methods
db.mycoll.help() help on collection methods
sh.help() sharding helpers
rs.help() replica set helpers
help admin administrative help
help connect connecting to a db help
help keys key shortcuts
help misc misc things to know
help mr mapreduce
show dbs show database names
show collections show collections in current database
show users show users in current database
show profile show most recent system.profile entries with time >= 1ms
show logs show the accessible logger names
show log [name] prints out the last segment of log in memory, 'global' is default
use <db_name> set current database
db.foo.find() list objects in collection foo
db.foo.find( { a : 1 } ) list objects in foo where a == 1
it result of the last line evaluated; use to further iterate
DBQuery.shellBatchSize = x set default number of items to display on shell
exit quit the mongo shell
> db.createCollection('hoge')
{ "ok" : 1 }
> db.hoge.find()
>
> exit
bye
サンプルアプリをつくる
www15224uf% mkdir -p labo/mgo
www15224uf% cd labo/mgo
www15224uf% vi sample.go
sample.go
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
)
type Person struct {
Name string
Phone string
}
func main() {
session, err := mgo.Dial("localhost")
if err != nil {
panic(err)
}
defer session.Close()
// Optional. Switch the session to a monotonic behavior.
session.SetMode(mgo.Monotonic, true)
c := session.DB("test").C("hoge")
err = c.Insert(&Person{"Ale", "+55 53 8116 9639"},
&Person{"Cla", "+55 53 8402 8510"})
if err != nil {
panic(err)
}
result := Person{}
err = c.Find(bson.M{"name": "Ale"}).One(&result)
if err != nil {
panic(err)
}
fmt.Println("Phone:", result.Phone)
}
www15224uf% go run sample.go
Phone: +55 53 8116 9639
おお動いた
www15224uf% mongo
MongoDB shell version: 2.4.6
connecting to: test
> db.hoge.find()
{ "_id" : ObjectId("524bbd58af5c4c9ebe7961f1"), "name" : "Ale", "phone" : "+55 53 8116 9639" }
{ "_id" : ObjectId("524bbd58af5c4c9ebe7961f2"), "name" : "Cla", "phone" : "+55 53 8402 8510" }
> exit
bye
www15224uf%
DBにも入っとる
tmux
のインストール
www15224uf% sudo apt-get install tmux
[sudo] password for otiai10:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
tmux
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 249 kB of archives.
After this operation, 543 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main tmux amd64 1.6-2 [249 kB]
Fetched 249 kB in 0s (592 kB/s)
Selecting previously unselected package tmux.
(Reading database ... 38622 files and directories currently installed.)
Unpacking tmux (from .../archives/tmux_1.6-2_amd64.deb) ...
Processing triggers for man-db ...
Setting up tmux (1.6-2) ...
www15224uf% which tmux
/usr/bin/tmux
apache2のインストールとリバースプロキシ設定
インストール
www15224uf% sudo apt-get install apache2
proxyモジュールを有効にする
http://otiai10.hatenablog.com/entry/2013/02/12/162501
www15224uf% sudo a2enmod proxy
www15224uf% sudo a2enmod proxy_http
www15224uf% sudo a2enmod proxy_connect
httpd.confを編集する
/etc/apache2/conf.d/httpd.conf
であった。/etc/apache2/httpd.conf
でうまくいってたのはなぜだ?
<VirtualHost *:80>
ServerName yourservicename.com
ServerAdmin [email protected]
ProxyRequests off
ProxyPass / http://applicationserver.com:7777/
<Location />
ProxyPassReverse http://applicationserver.com:7777/
ProxyPassReverseCookieDomain localhost yourservicename.com
ProxyPassReverseCookiePath / /
Order allow,deny
# Allow Allでいいのかな?
Allow from all
</Location>
</VirtualHost>
apache restart
www15224uf% sudo /etc/init.d/apache2 restart
ちょっと訂正
ユーザ関係
- suでrootに
- apt-getでsudoをinstall
- visudoも一緒に入ってくるから一般ユーザをsudoerに追加
- exitで一般ユーザに戻る
nginx
- sudo apt-get install nginx
- sudo which nginx (入ってる確認)
- exitで一般ユーザに戻る
- sudo nginx
- なんも記述無いけどデフォルトのドキュメントルートは/usr/share/nginx/index.htmlっぽい
sudoerの追加
super userになる
デフォルトEDITORをviにしとく
/home/root/.bashrc
にてして
/etc/sudoers
の編集は、
visudo
コマンドから行うおわり