2013年4月1日月曜日

Ubuntu12.04にmongodbをインストールする


今回はmongodbをインストールしていきたいと思います。

そもそもmongodbとは

  • MongoDBは10genにより開発/サポートされているC++で実装されたオープンソースのデータベースです。
  • いわゆるNoSQLに分類されるタイプのデータベースで対障害性とスケーラビリティに優れ、またNoSQLでは珍しくインデックスをサポートしており表結合(JOIN)は出来ないながらRDBMSの様な使い方が出来る事も大きな特徴です。

日本MongoDBユーザー会 githubページより引用
今回はまった点はポート制限(社内環境とか)でPPAリポジトリに追加出来なかったことです。
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.d7d4H76yrY --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 7F0CEB10
gpg: 鍵7F0CEB10をhkpからサーバーkeyserver.ubuntu.comに要求
gpg: 鍵サーバーのタイムアウト
gpg: 鍵サーバーからの受信に失敗しました: 鍵サーバーのエラー

これは、以下の参考に解決できました。
  • ポート制限のある環境でUbuntuにPPAリポジトリを追加する

  • $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7F0CEB10
    Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.95cMrkmRXT --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7F0CEB10
    gpg: 鍵7F0CEB10をhkpからサーバーkeyserver.ubuntu.comに要求
    gpg: 鍵7F0CEB10: 公開鍵“Richard Kreuter ”を読み込みました
    gpg: 絶対的に信用する鍵が見つかりません
    gpg: 処理数の合計: 1
    gpg:               読込み: 1  (RSA: 1)
    
    登録がおわったら、アップデートします。
    sudo apt-get update
    
    バージョンを指定してインストールします。
    sudo apt-get install mongodb-10gen=2.2.3
    
    これで、mongoDBがインストール出来ました。
    次は、簡単な取り扱い等を学んでいければと思います。

    最後までお読み頂き、ありがとうございました。

  • 参考サイト様
  • Install MongoDB on Ubuntu

    2013年3月21日木曜日

    vimのキーマッピングを学ぶ

    ここまでの.vimrcはただ先人たちのモノをコピペする簡単なお仕事だったので、とりあえず少しづつ学習していこうと思います。
    キーマッピング
    コマンド ノーマルモード 挿入モード コマンドラインモード ビジュアルモード
    map/noremap
    nmap/nnoremap
    imap/inoremap
    cmap/cnoremap
    vmap/vnoremap
    map!/noremap!

    mapとnoremap

    • map系
    • キーシーケンスを展開したあと、さらに別のマップを適応しようとする
    • noremap系
    • 一度だけ展開する

    Vimのキーマッピング

    キーマッピングの設定は各モードごとに独立しています。
    上記の様にモードごとに設定します。 例)ノーマルモードで設定したものは、コマンドモードでは適応されないとか。

    特殊なキーの指定

    方向キーや修飾キー付きのキーなど、特殊なキーをキーマッピングで指定したい場合は、<>記法を使うそうです。
    mapのオプション
    オプション 説明
    <silent> コマンドラインへの表示を抑制。キーマッピングからコマンドを実行する場合に指定
    <unique> すでにキーマッピングが存在する場合、エラーにします。通常は上書きされる
    <buffer> バッファローカルなキーマッピングを定義
    <expr> マップ先の文字列をVim式とみなして、評価した結果を文字列のマップ先とする
    ここで、IDEの機能でよくある括弧の自動挿入の機能を実現してみます。
    したのようにしてみました。
    今回は、挿入モードの時の設定なので、inoremapと使います。(一度しか展開されないやつですね。)
    それぞれの括弧を入力したら、遂になる括弧の閉じる方を自動的に挿入して、で←を押して括弧のなかに移動しています。
    長々と書いて来ましたが、今回はこのへんで失礼します。

    最後までお読み頂きありがとうございました。

    2013年3月18日月曜日

    jsl.vimの導入する

    Node.jsの本にはjsl.vimいいよ書いてあったので、入れてみようと思います。

    参考サイト様

  • 最新の JavaScript Lint をインストールする -mollifier delta blog-

    環境

    • Ubuntu12.04LTS
    • python 2.7.3

    下準備

    以下のパッケージをインストールする
    $ sudo apt-get install build-essential
    $ sudo apt-get install python-dev
    

    JavaScript Lintのインストール

    $ svn co https://javascriptlint.svn.sourceforge.net/svnroot/javascriptlint javascriptlint
    
    いろいろ落としてきます。 最新を使いたいので、trunkを使います。
    $ cd javascriptlint/trunk
    では、ビルドしてインストールしていきます。
    $ python setup.py build
    $ sudo python setup.py install
    ...
    changing mode of /usr/local/bin/jsl to 775
    ..
    /usr/local/bin/jslが本体みたいですね。

    動作確認

    tests にテスト用ファイルがあるので、試してみます。
    $ jsl jsl tests/errors/syntax_error.js
    
    ちなみに、こんなコードでした。
    function syntax_error() {
        &; /*warning:syntax_error*/
    }
    実行結果
    JavaScript Lint
    Developed by Matthias Miller (http://www.JavaScriptLint.com)
    /home/typosterr/javascriptlint/trunk/tests/errors/syntax_error.js
    /home/typosterr/javascriptlint/trunk/tests/errors/syntax_error.js(2): warning: s
    yntax_error
    
    0 error(s), 1 warnings(s)
    
    うまくいったみたいです。 ここで、jslのヘルプを見てみましょう。
    $ jsl -h
    Usage: jsl [options] [files]
    
    Options:
      -h, --help          show this help message and exit
      --conf=CONF         set the conf file
      --profile           turn on hotshot profiling
      --recurse           recursively search directories on the command line
      --enable-wildcards  resolve wildcards in the command line
      --dump              dump this script
      --unittest          run the python unittests
      --quiet             minimal output
      --verbose           verbose output
      --nologo            suppress version information
      --nofilelisting     suppress file names
      --nosummary         suppress lint summary
      --help:conf         display the default configuration file
    
    なので、さくっと見たいときは
    $ jsl --nologo --nosummary --nofilelisting tests/errors/syntax_error.js
    /home/typosterr/javascriptlint/trunk/tests/errors/syntax_error.js(2): warning: syntax_error
    
    こんな感じになります。

    vimの設定

    vimで開いているファイルのチェックを可能に。
    ~/.vim/compiler/jsl.vim に記述。
    if exists("current_compiler")
        finish
    endif
    
    let current_compiler = "jsl"
    
    if exists(":CompilerSet") != 2
        command -nargs=* CompilerSet setlocal 
    endif
    
    let s:cpo_save = &cpo
    set cpo-=C
    
    CompilerSet makeprg=jsl\ --nologo\ --nofilelisting\ --nosummary\ %
    CompilerSet errorformat=%f(%l):\ %m
    
    let &cpo = s:cpo_save
    unlet s:cpo_save
    
    ~/.vim/after/ftplugin/jsl.vim に以下を記述。
    compiler jsl
    
    if !exists('b:undo_ftplugin')
        let b:undo_ftplugin = ''
    endif
    
    let b:undo_ftplugin .= '
    \ | setlocal makeprg<
    \ | setlocal errorformat<
    \'
    
    .vimrcに以下を記述
    " JavaScript Lint
    if !exist('b:current_compiler')
      compiler jsl
    endif
    autocmd QuickFixCmdPost make copen
    
    これで、準備が整いました。
    サンプルとして以下のようなファイルを作って、実行したいと思います。
    [1, 2, 3, 4, 5].forEach(function (n) {
        console.log(n * n)
    })
    
    これをSample.jsとかにしてvimで開きます。
    其の状態で:makeを打つと

    quickfixウィンドウを消すときは:ccloseと打ちます。
    とりあえず、できたみたいだけど設定ファイルがわけがわからないよ。

    追記

    Google Closure Linter gjslint
    googleさんのGoogle JavaScript Style Guideにあわせたものもあるみたいです。

    最後までお読みいただきありがとうございました。

  • vimの基本的な設定をする

    ついに、IDE厨な僕もvimを使うことを強いられたので、巷で流行の設定くらい出来ないといけないなと思い、筆をとりました。

    環境

    • Ubuntu12.04LTS
    • vim@7.3.429

    やること

    • NeoBundleの導入
    • チョコっとキーバインディングの設定
    • カラースキームの変更

    NeoBundleとは

    Hack #238: neobundle.vim で plugin をモダンに管理する -vim-users.jp-

    NeoBundleの導入

    vimのプラグインは、こいつを使ってみたいと思います。

    インストール

    インストールは簡単で以下の通りです。
    mkdir -p ~/.vim/bundle
    git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
    git clone https://github.com/Shougo/vimproc ~/.vim/bundle/vimproc
    以下は、作者様のgithubからの.vimrcのSampleです。
    set nocompatible               " Be iMproved
    
     if has('vim_starting')
       set runtimepath+=~/.vim/bundle/neobundle.vim/
     endif
    
     call neobundle#rc(expand('~/.vim/bundle/'))
    
     " Let NeoBundle manage NeoBundle
     NeoBundleFetch 'Shougo/neobundle.vim'
    
     " Recommended to install
     " After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
     NeoBundle 'Shougo/vimproc'
    
     " My Bundles here:
     "
     " Note: You don't set neobundle setting in .gvimrc!
     " Original repos on github
     NeoBundle 'tpope/vim-fugitive'
     NeoBundle 'Lokaltog/vim-easymotion'
     NeoBundle 'rstacruz/sparkup', {'rtp': 'vim/'}
     " vim-scripts repos
     NeoBundle 'L9'
     NeoBundle 'FuzzyFinder'
     NeoBundle 'rails.vim'
     " Non github repos
     NeoBundle 'git://git.wincent.com/command-t.git'
     " Non git repos
     NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'
     NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'
    
     " ...
    
     filetype plugin indent on     " Required!
     "
     " Brief help
     " :NeoBundleList          - list configured bundles
     " :NeoBundleInstall(!)    - install(update) bundles
     " :NeoBundleClean(!)      - confirm(or auto-approve) removal of unused bundles
    
     " Installation check.
     NeoBundleCheck
    
    この状態で、vimを立ち上げて:NeoBundeInstallで.vimrcに記述したプラグインがインストールされます。
    簡単ですね。
    また、上記のように削除したい場合は、.vimrcから記述を削除して:NeoBundleCleanとすればアンインストールされます。

    チョコっとキーバインディングの設定

    hjklの移動も良いのですが、Insertモードの時にEmacs風のキー移動がしたいと思ったので、設定してみました。
    .vimrcにこんな記述をしました。
  • 参考:cocopon / dotfiles

    カラースキームの変更


    参考サイト様
  • [vim] 黒背景好きの僕の心を揺さぶるカラースキーム「hybrid」
  • 題名とは異なるのですが、jellybeansにしてみます。
    とはいっても、これもNeoBundleで管理できるみたいですね。

    必要なplugin

    NeoBundle 'ujihisa/unite-colorscheme'

    を追加して、好きなカラースキームのリポジトリも追加します。
    今回なら、

    NeoBundle 'nanotech/jellybeans.vim'

    ですね。
    deaultでカラースキームの指定する場合は、

    colorscheme jellybeans[カラースキーム名]

    をそれぞれ、.vimrcに追加します。
    要は、
    NeoBundle 'nanotech/jellybeans.vim'
    " color scheme
    colorscheme jellybeans
    こんな感じになるのでしょうか?
    後は、NeoBundleInstallでプラグインをインストールして、vimを再起動させればOKですかね。
    また、ujihisa/unite-colorscheme(Shougo/unite.vimが必要)を使用すると、vimの起動中にカラースキームを変更できます。

    :Unite colorscheme -auto-preview

    と、コマンドモードで入力すると
    カラースキームの一覧が表示され、インタラクティブにプレビューすることができ、変更できます。
    便利ですね。

    これから、vimを使用する機会が増えそうなので、もっともっと精進していきます。


    最後まで、お読み頂きありがとうございました。

    2013年3月16日土曜日

    Ubuntu12.04LTSにNode環境を構築する

    久々の更新になってしまいました。
    今回は、Nodeの勉強がてら開発環境を構築していきます。

    Nodeとは

    Ryan Dahlという開発者が作った、サーバサイドのプラットフォーム。
    プログラミング言語でも、ライブラリでも、フレームワークでもない。
    現在のstatableはv0.10.0
    http://nodejs.org

    経緯

    アイディアは元からあったのですが、一人だと怠けてしまいますよね。なので、出来る先輩と、出来る後輩が興味があるとわかったので巻き込んでみました。
    サーバの手配は言い出しっぺの自分がやって、ユーザの登録とか、GitLabのリポジトリの登録とかしました。
    折角なので、継続的デリバリーを盛り込んで、Jenkins,TDD,BDD,を組み合わせみたいと思ってます。
    って、まずはJavaScriptから勉強しないとなぁ。
    その前に、nodeのバージョン管理マネージャであるnodebrewをインストールしたいと思います。
    $ curl https://raw.github.com/hokaccha/nodebrew/master/nodebrew | perl - setup
    プログラム 'curl' はまだインストールされていません。  次のように入力することでインストールできます:
    sudo apt-get install curl
    $ sudo apt-get install curl
    [sudo] password for typosterr: 
    パッケージリストを読み込んでいます... 完了
    依存関係ツリーを作成しています                
    状態情報を読み取っています... 完了
    以下のパッケージが自動でインストールされましたが、もう必要とされていません:
      linux-headers-3.2.0-36-generic-pae linux-headers-3.2.0-30
      linux-headers-3.2.0-30-generic-pae linux-headers-3.2.0-36
    これらを削除するには 'apt-get autoremove' を利用してください。
    以下のパッケージが新たにインストールされます:
      curl
    アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。
    137 kB のアーカイブを取得する必要があります。
    この操作後に追加で 346 kB のディスク容量が消費されます。
    警告: 以下のパッケージは認証されていません!
      curl
    検証なしにこれらのパッケージをインストールしますか [y/N]? y
    取得:1 http://jp.archive.ubuntu.com/ubuntu/ precise/main curl i386 7.22.0-3ubuntu4 [137 kB]
    137 kB を 0秒 で取得しました (425 kB/s)
    以前に未選択のパッケージ curl を選択しています。
    (データベースを読み込んでいます ... 現在 206702 個のファイルとディレクトリがインストールされています。)
    (.../curl_7.22.0-3ubuntu4_i386.deb から) curl を展開しています...
    man-db のトリガを処理しています ...
    curl (7.22.0-3ubuntu4) を設定しています ...
    typosterr@Ptolemaios:~$ curl https://raw.github.com/hokaccha/nodebrew/master/nodebrew | perl - setup
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 18289  100 18289    0     0  21188      0 --:--:-- --:--:-- --:--:-- 26015
    fetching nodebrew...
    install nodebrew in $HOME/.nodebrew
    
    ========================================
    Add path:
    
    export PATH=$HOME/.nodebrew/current/bin:$PATH
    ========================================
    $
    
    あと、お好きなリソースファイルにパスを通すだけです。
    $ vim .bashrc 
    $ source .bashrc 
    
    簡単ですね。
    では、実際に使ってみましょう。
    $ nodebrew ls-remote # インストールできるバージョンを表示
    v0.0.1    v0.0.2    v0.0.3    v0.0.4    v0.0.5    v0.0.6    
    
    v0.1.0    v0.1.1    v0.1.2    v0.1.3    v0.1.4    v0.1.5    v0.1.6    v0.1.7
    v0.1.8    v0.1.9    v0.1.10   v0.1.11   v0.1.12   v0.1.13   v0.1.14   v0.1.15
    v0.1.16   v0.1.17   v0.1.18   v0.1.19   v0.1.20   v0.1.21   v0.1.22   v0.1.23
    v0.1.24   v0.1.25   v0.1.26   v0.1.27   v0.1.28   v0.1.29   v0.1.30   v0.1.31
    v0.1.32   v0.1.33   v0.1.90   v0.1.91   v0.1.92   v0.1.93   v0.1.94   v0.1.95
    v0.1.96   v0.1.97   v0.1.98   v0.1.99   v0.1.100  v0.1.101  v0.1.102  v0.1.103
    v0.1.104  
    
    v0.2.0    v0.2.1    v0.2.2    v0.2.3    v0.2.4    v0.2.5    v0.2.6    
    
    v0.3.0    v0.3.1    v0.3.2    v0.3.3    v0.3.4    v0.3.5    v0.3.6    v0.3.7
    v0.3.8    
    
    v0.4.0    v0.4.1    v0.4.2    v0.4.3    v0.4.4    v0.4.5    v0.4.6    v0.4.7
    v0.4.8    v0.4.9    v0.4.10   v0.4.11   v0.4.12   
    
    v0.5.0    v0.5.1    v0.5.2    v0.5.3    v0.5.4    v0.5.5    v0.5.6    v0.5.7
    v0.5.8    v0.5.9    v0.5.10   
    
    v0.6.0    v0.6.1    v0.6.2    v0.6.3    v0.6.4    v0.6.5    v0.6.6    v0.6.7
    v0.6.8    v0.6.9    v0.6.10   v0.6.11   v0.6.12   v0.6.13   v0.6.14   v0.6.15
    v0.6.16   v0.6.17   v0.6.18   v0.6.19   v0.6.20   v0.6.21   
    
    v0.7.0    v0.7.1    v0.7.2    v0.7.3    v0.7.4    v0.7.5    v0.7.6    v0.7.7
    v0.7.8    v0.7.9    v0.7.10   v0.7.11   v0.7.12   
    
    v0.8.0    v0.8.1    v0.8.2    v0.8.3    v0.8.4    v0.8.5    v0.8.6    v0.8.7
    v0.8.8    v0.8.9    v0.8.10   v0.8.11   v0.8.12   v0.8.13   v0.8.14   v0.8.15
    v0.8.16   v0.8.17   v0.8.18   v0.8.19   v0.8.20   v0.8.21   v0.8.22   
    
    v0.9.0    v0.9.1    v0.9.2    v0.9.3    v0.9.4    v0.9.5    v0.9.6    v0.9.7
    v0.9.8    v0.9.9    v0.9.10   v0.9.11   v0.9.12   
    
    v0.10.0  
    
    $ nodebrew install 0.8.22 0.10.0
    
    コンパイラが無いのをおもいだしたので、、
    $ sudo apt-get install build-essential
    パッケージリストを読み込んでいます... 完了
    依存関係ツリーを作成しています                
    状態情報を読み取っています... 完了
    以下のパッケージが自動でインストールされましたが、もう必要とされていません:
      linux-headers-3.2.0-36-generic-pae linux-headers-3.2.0-30 linux-headers-3.2.0-30-generic-pae linux-headers-3.2.0-36
    これらを削除するには 'apt-get autoremove' を利用してください。
    以下の特別パッケージがインストールされます:
      dpkg-dev fakeroot g++ g++-4.6 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libstdc++6-4.6-dev libtimedate-perl
    提案パッケージ:
      debian-keyring g++-multilib g++-4.6-multilib gcc-4.6-doc libstdc++6-4.6-dbg libstdc++6-4.6-doc
    以下のパッケージが新たにインストールされます:
      build-essential dpkg-dev fakeroot g++ g++-4.6 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libstdc++6-4.6-dev libtimedate-perl
    アップグレード: 0 個、新規インストール: 11 個、削除: 0 個、保留: 0 個。
    9,250 kB のアーカイブを取得する必要があります。
    この操作後に追加で 27.4 MB のディスク容量が消費されます。
    続行しますか [Y/n]? y
    警告: 以下のパッケージは認証されていません!
      libstdc++6-4.6-dev g++-4.6 g++ libtimedate-perl libdpkg-perl dpkg-dev build-essential fakeroot libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
    検証なしにこれらのパッケージをインストールしますか [y/N]? y
    取得:1 http://jp.archive.ubuntu.com/ubuntu/ precise/main libstdc++6-4.6-dev i386 4.6.3-1ubuntu5 [1,643 kB]
    取得:2 http://jp.archive.ubuntu.com/ubuntu/ precise/main g++-4.6 i386 4.6.3-1ubuntu5 [6,745 kB]
    取得:3 http://jp.archive.ubuntu.com/ubuntu/ precise/main g++ i386 4:4.6.3-1ubuntu5 [1,444 B]
    取得:4 http://jp.archive.ubuntu.com/ubuntu/ precise/main libtimedate-perl all 1.2000-1 [41.6 kB]
    取得:5 http://jp.archive.ubuntu.com/ubuntu/ precise-updates/main libdpkg-perl all 1.16.1.2ubuntu7.1 [180 kB]
    取得:6 http://jp.archive.ubuntu.com/ubuntu/ precise-updates/main dpkg-dev all 1.16.1.2ubuntu7.1 [469 kB]
    取得:7 http://jp.archive.ubuntu.com/ubuntu/ precise-updates/main build-essential i386 11.5ubuntu2.1 [5,796 B]
    取得:8 http://jp.archive.ubuntu.com/ubuntu/ precise/main fakeroot i386 1.18.2-1 [87.9 kB]
    取得:9 http://jp.archive.ubuntu.com/ubuntu/ precise/main libalgorithm-diff-perl all 1.19.02-2 [50.7 kB]
    取得:10 http://jp.archive.ubuntu.com/ubuntu/ precise/main libalgorithm-diff-xs-perl i386 0.04-2build2 [12.9 kB]
    取得:11 http://jp.archive.ubuntu.com/ubuntu/ precise/main libalgorithm-merge-perl all 0.08-2 [12.7 kB]
    9,250 kB を 5秒 で取得しました (1,699 kB/s)     
    以前に未選択のパッケージ libstdc++6-4.6-dev を選択しています。
    (データベースを読み込んでいます ... 現在 206718 個のファイルとディレクトリがインストールされています。)
    (.../libstdc++6-4.6-dev_4.6.3-1ubuntu5_i386.deb から) libstdc++6-4.6-dev を展開しています...
    以前に未選択のパッケージ g++-4.6 を選択しています。
    (.../g++-4.6_4.6.3-1ubuntu5_i386.deb から) g++-4.6 を展開しています...
    以前に未選択のパッケージ g++ を選択しています。
    (.../g++_4%3a4.6.3-1ubuntu5_i386.deb から) g++ を展開しています...
    以前に未選択のパッケージ libtimedate-perl を選択しています。
    (.../libtimedate-perl_1.2000-1_all.deb から) libtimedate-perl を展開しています...
    以前に未選択のパッケージ libdpkg-perl を選択しています。
    (.../libdpkg-perl_1.16.1.2ubuntu7.1_all.deb から) libdpkg-perl を展開しています...
    以前に未選択のパッケージ dpkg-dev を選択しています。
    (.../dpkg-dev_1.16.1.2ubuntu7.1_all.deb から) dpkg-dev を展開しています...
    以前に未選択のパッケージ build-essential を選択しています。
    (.../build-essential_11.5ubuntu2.1_i386.deb から) build-essential を展開しています...
    以前に未選択のパッケージ fakeroot を選択しています。
    (.../fakeroot_1.18.2-1_i386.deb から) fakeroot を展開しています...
    以前に未選択のパッケージ libalgorithm-diff-perl を選択しています。
    (.../libalgorithm-diff-perl_1.19.02-2_all.deb から) libalgorithm-diff-perl を展開しています...
    以前に未選択のパッケージ libalgorithm-diff-xs-perl を選択しています。
    (.../libalgorithm-diff-xs-perl_0.04-2build2_i386.deb から) libalgorithm-diff-xs-perl を展開しています...
    以前に未選択のパッケージ libalgorithm-merge-perl を選択しています。
    (.../libalgorithm-merge-perl_0.08-2_all.deb から) libalgorithm-merge-perl を展開しています...
    man-db のトリガを処理しています ...
    libtimedate-perl (1.2000-1) を設定しています ...
    libdpkg-perl (1.16.1.2ubuntu7.1) を設定しています ...
    dpkg-dev (1.16.1.2ubuntu7.1) を設定しています ...
    fakeroot (1.18.2-1) を設定しています ...
    update-alternatives: /usr/bin/fakeroot (fakeroot) を提供するために 自動モード で /usr/bin/fakeroot-sysv を使います。
    libalgorithm-diff-perl (1.19.02-2) を設定しています ...
    libalgorithm-diff-xs-perl (0.04-2build2) を設定しています ...
    libalgorithm-merge-perl (0.08-2) を設定しています ...
    libstdc++6-4.6-dev (4.6.3-1ubuntu5) を設定しています ...
    g++-4.6 (4.6.3-1ubuntu5) を設定しています ...
    g++ (4:4.6.3-1ubuntu5) を設定しています ...
    update-alternatives: /usr/bin/c++ (c++) を提供するために 自動モード で /usr/bin/g++ を使います。
    build-essential (11.5ubuntu2.1) を設定しています ...
    いよいよ、インストールしていきます。
    $ nodebrew install 0.8.22 0.10.0 #引数は1つまでらしいです。なので、再度0.10.0をインストール
    
    $ nodebrew list #nodebrewでインストール済みのnodeのバージョンを表示
    v0.8.22
    v0.10.0
    
    current: none
    $ nodebrew use 0.8.22 #採用するnodeのバージョンを指定
    use v0.8.22
    $ npm --version #npmはnodeのパッケージ管理マネージャ
    1.2.14
    
    簡単ですね。

    2013/03/16 追記

    TODO

    Better JavaScript Indentation
    jsl.vim ->書きました
    quickrun
    これら3つのvimのプラグインの導入をする。

    最後までお読みいただきありがとうございました。

    2013年2月24日日曜日

    Ubuntu12.04LTSにfluentdをインストールする

    今回は、ずいぶん乗り遅れましたが、fluentdをubuntuにインストールしていきたいと思います。
    説明は必要ないかと思いますがfluentdは、Webアプリ、サーバ、ApacheのアクセスログなどをJSON形式で吐いて、メールしたり、ファイルにしたり、他のfluentdに投げたりするとても便利なツールです。
  • https://github.com/fluent/fluentd


  • アーキテクチャや実際の構成など、こちらのスライドがわかりやすかったです。

    では、張り切ってインストールしていきます。

    参考サイト様

  • 2013-01-24 fluentd便利すぎる -年中アイス-
  • 公式ドキュメント

  • やることは至ってシンプルでコマンド一発です。
    $ curl -L http://toolbelt.treasure-data.com/sh/install-ubuntu-precise.sh | sh

    以下ログです。
    $ curl -L http://toolbelt.treasure-data.com/sh/install-ubuntu-precise.sh | sh  % Total % Received % Xferd Average Speed Time Time Time Current
                                     Dload Upload Total Spent Left Speed
    100 483 100 483 0 0 353 0 0:00:01 0:00:01 --:--:-- 2427
    This script requires superuser access to install apt packages.
    You will be prompted for your password by sudo.
    [sudo] password for typosterr: 
    無視 http://jp.archive.ubuntu.com precise InRelease
    無視 http://jp.archive.ubuntu.com precise-updates InRelease                                                                          
    無視 http://jp.archive.ubuntu.com precise-backports InRelease                                                                        
    ヒット http://jp.archive.ubuntu.com precise Release.gpg                                                                              
    ヒット http://jp.archive.ubuntu.com precise-updates Release.gpg                                                                      
    ヒット http://jp.archive.ubuntu.com precise-backports Release.gpg                            
    ヒット http://jp.archive.ubuntu.com precise Release                                          
    ヒット http://jp.archive.ubuntu.com precise-updates Release                                                                          
    ヒット http://jp.archive.ubuntu.com precise-backports Release                                                                        
    ヒット http://jp.archive.ubuntu.com precise/main Sources                                                                             
    ヒット http://jp.archive.ubuntu.com precise/restricted Sources                                                                       
    ヒット http://jp.archive.ubuntu.com precise/universe Sources                                                                         
    ヒット http://jp.archive.ubuntu.com precise/multiverse Sources                                                                       
    ヒット http://jp.archive.ubuntu.com precise/main amd64 Packages                                                                      
    ヒット http://jp.archive.ubuntu.com precise/restricted amd64 Packages                                                      
    ヒット http://jp.archive.ubuntu.com precise/universe amd64 Packages                                                        
    ヒット http://jp.archive.ubuntu.com precise/multiverse amd64 Packages                                                      
    ヒット http://jp.archive.ubuntu.com precise/main i386 Packages                                                             
    ヒット http://jp.archive.ubuntu.com precise/restricted i386 Packages                                                       
    ヒット http://jp.archive.ubuntu.com precise/universe i386 Packages                                                         
    ヒット http://jp.archive.ubuntu.com precise/multiverse i386 Packages                                                       
    ヒット http://jp.archive.ubuntu.com precise/main TranslationIndex                                                          
    ヒット http://jp.archive.ubuntu.com precise/multiverse TranslationIndex                                                    
    無視 http://packages.treasure-data.com lucid InRelease                                                                     
    無視 http://packages.treasure-data.com precise InRelease                                                                   
    無視 http://security.ubuntu.com precise-security InRelease                                                                 
    ヒット http://jp.archive.ubuntu.com precise/restricted TranslationIndex                      
    ヒット http://jp.archive.ubuntu.com precise/universe TranslationIndex                        
    ヒット http://jp.archive.ubuntu.com precise-updates/main Sources                             
    ヒット http://jp.archive.ubuntu.com precise-updates/restricted Sources                       
    ヒット http://jp.archive.ubuntu.com precise-updates/universe Sources                         
    ヒット http://jp.archive.ubuntu.com precise-updates/multiverse Sources                                                     
    ヒット http://jp.archive.ubuntu.com precise-updates/main amd64 Packages                                                    
    ヒット http://jp.archive.ubuntu.com precise-updates/restricted amd64 Packages                                              
    ヒット http://jp.archive.ubuntu.com precise-updates/universe amd64 Packages                                                
    ヒット http://jp.archive.ubuntu.com precise-updates/multiverse amd64 Packages                                              
    ヒット http://jp.archive.ubuntu.com precise-updates/main i386 Packages                                                     
    ヒット http://jp.archive.ubuntu.com precise-updates/restricted i386 Packages                                               
    ヒット http://jp.archive.ubuntu.com precise-updates/universe i386 Packages                                                 
    ヒット http://jp.archive.ubuntu.com precise-updates/multiverse i386 Packages                                               
    ヒット http://jp.archive.ubuntu.com precise-updates/main TranslationIndex                                                  
    ヒット http://jp.archive.ubuntu.com precise-updates/multiverse TranslationIndex                                            
    ヒット http://jp.archive.ubuntu.com precise-updates/restricted TranslationIndex                                            
    ヒット http://jp.archive.ubuntu.com precise-updates/universe TranslationIndex                                              
    ヒット http://jp.archive.ubuntu.com precise-backports/main Sources                                                         
    ヒット http://jp.archive.ubuntu.com precise-backports/restricted Sources                                                   
    無視 http://ppa.launchpad.net precise InRelease                                                                            
    無視 http://ppa.launchpad.net precise InRelease                                                                            
    ヒット http://jp.archive.ubuntu.com precise-backports/universe Sources                                                     
    ヒット http://jp.archive.ubuntu.com precise-backports/multiverse Sources                     
    ヒット http://jp.archive.ubuntu.com precise-backports/main amd64 Packages                    
    ヒット http://jp.archive.ubuntu.com precise-backports/restricted amd64 Packages              
    ヒット http://jp.archive.ubuntu.com precise-backports/universe amd64 Packages                
    ヒット http://jp.archive.ubuntu.com precise-backports/multiverse amd64 Packages                                            
    ヒット http://jp.archive.ubuntu.com precise-backports/main i386 Packages                                                   
    ヒット http://jp.archive.ubuntu.com precise-backports/restricted i386 Packages                                             
    ヒット http://jp.archive.ubuntu.com precise-backports/universe i386 Packages                                               
    ヒット http://jp.archive.ubuntu.com precise-backports/multiverse i386 Packages                                             
    ヒット http://jp.archive.ubuntu.com precise-backports/main TranslationIndex                                                
    ヒット http://jp.archive.ubuntu.com precise-backports/multiverse TranslationIndex                                          
    ヒット http://jp.archive.ubuntu.com precise-backports/restricted TranslationIndex            
    ヒット http://jp.archive.ubuntu.com precise-backports/universe TranslationIndex              
    ヒット http://jp.archive.ubuntu.com precise/main Translation-ja                              
    ヒット http://jp.archive.ubuntu.com precise/main Translation-en                                                            
    ヒット http://jp.archive.ubuntu.com precise/multiverse Translation-ja                                                      
    ヒット http://jp.archive.ubuntu.com precise/multiverse Translation-en                        
    ヒット http://jp.archive.ubuntu.com precise/restricted Translation-ja                        
    ヒット http://jp.archive.ubuntu.com precise/restricted Translation-en                        
    ヒット http://jp.archive.ubuntu.com precise/universe Translation-ja                          
    ヒット http://jp.archive.ubuntu.com precise/universe Translation-en                          
    ヒット http://jp.archive.ubuntu.com precise-updates/main Translation-ja                      
    ヒット http://jp.archive.ubuntu.com precise-updates/main Translation-en                      
    ヒット http://jp.archive.ubuntu.com precise-updates/multiverse Translation-ja                
    無視 http://packages.treasure-data.com lucid Release.gpg                                     
    ヒット http://jp.archive.ubuntu.com precise-updates/multiverse Translation-en                
    ヒット http://jp.archive.ubuntu.com precise-updates/restricted Translation-en                
    ヒット http://jp.archive.ubuntu.com precise-updates/universe Translation-ja                  
    ヒット http://jp.archive.ubuntu.com precise-updates/universe Translation-en                  
    ヒット http://jp.archive.ubuntu.com precise-backports/main Translation-en                    
    ヒット http://security.ubuntu.com precise-security Release.gpg                               
    ヒット http://jp.archive.ubuntu.com precise-backports/multiverse Translation-en              
    ヒット http://jp.archive.ubuntu.com precise-backports/restricted Translation-en              
    ヒット http://jp.archive.ubuntu.com precise-backports/universe Translation-en                
    無視 http://ppa.launchpad.net precise Release.gpg                                            
    無視 http://packages.treasure-data.com precise Release.gpg                                   
    ヒット http://security.ubuntu.com precise-security Release     
    ヒット http://packages.treasure-data.com lucid Release                                
    ヒット http://ppa.launchpad.net precise Release.gpg            
    ヒット http://security.ubuntu.com precise-security/main Sources
    取得:1 http://packages.treasure-data.com precise Release [2,377 B]
    無視 http://ppa.launchpad.net precise Release                                                  
    ヒット http://security.ubuntu.com precise-security/restricted Sources
    ヒット http://security.ubuntu.com precise-security/universe Sources
    ヒット http://security.ubuntu.com precise-security/multiverse Sources
    ヒット http://security.ubuntu.com precise-security/main amd64 Packages
    ヒット http://security.ubuntu.com precise-security/restricted amd64 Packages
    ヒット http://security.ubuntu.com precise-security/universe amd64 Packages
    ヒット http://security.ubuntu.com precise-security/multiverse amd64 Packages
    ヒット http://security.ubuntu.com precise-security/main i386 Packages
    ヒット http://security.ubuntu.com precise-security/restricted i386 Packages
    ヒット http://security.ubuntu.com precise-security/universe i386 Packages
    無視 http://packages.treasure-data.com lucid/contrib Sources/DiffIndex
    無視 http://packages.treasure-data.com lucid/contrib amd64 Packages/DiffIndex                
    無視 http://packages.treasure-data.com lucid/contrib i386 Packages/DiffIndex                 
    無視 http://packages.treasure-data.com lucid/contrib TranslationIndex                        
    ヒット http://ppa.launchpad.net precise Release                                              
    ヒット http://security.ubuntu.com precise-security/multiverse i386 Packages                                         
    無視 http://packages.treasure-data.com precise/contrib TranslationIndex                      
    ヒット http://security.ubuntu.com precise-security/main TranslationIndex                     
    ヒット http://security.ubuntu.com precise-security/multiverse TranslationIndex
    ヒット http://security.ubuntu.com precise-security/restricted TranslationIndex
    ヒット http://security.ubuntu.com precise-security/universe TranslationIndex
    無視 http://ppa.launchpad.net precise/main TranslationIndex    
    ヒット http://security.ubuntu.com precise-security/main Translation-en
    ヒット http://security.ubuntu.com precise-security/multiverse Translation-en
    ヒット http://security.ubuntu.com precise-security/restricted Translation-en
    ヒット http://ppa.launchpad.net precise/main Sources           
    ヒット http://ppa.launchpad.net precise/main amd64 Packages    
    ヒット http://ppa.launchpad.net precise/main i386 Packages     
    無視 http://ppa.launchpad.net precise/main TranslationIndex    
    ヒット http://security.ubuntu.com precise-security/universe Translation-en                   
    取得:2 http://packages.treasure-data.com precise/contrib amd64 Packages [446 B]              
    取得:3 http://packages.treasure-data.com precise/contrib i386 Packages [449 B]
    ヒット http://packages.treasure-data.com lucid/contrib Sources 
    ヒット http://packages.treasure-data.com lucid/contrib amd64 Packages                
    ヒット http://packages.treasure-data.com lucid/contrib i386 Packages
    無視 http://packages.treasure-data.com lucid/contrib Translation-ja_JP
    無視 http://packages.treasure-data.com lucid/contrib Translation-ja
    無視 http://packages.treasure-data.com lucid/contrib Translation-en
    無視 http://packages.treasure-data.com precise/contrib Translation-ja_JP
    無視 http://packages.treasure-data.com precise/contrib Translation-ja
    無視 http://packages.treasure-data.com precise/contrib Translation-en
    エラー http://ppa.launchpad.net precise/main Sources            
      404 Not Found
    エラー http://ppa.launchpad.net precise/main amd64 Packages
      404 Not Found
    エラー http://ppa.launchpad.net precise/main i386 Packages
      404 Not Found
    無視 http://ppa.launchpad.net precise/main Translation-ja_JP
    無視 http://ppa.launchpad.net precise/main Translation-ja
    無視 http://ppa.launchpad.net precise/main Translation-en
    無視 http://ppa.launchpad.net precise/main Translation-ja_JP
    無視 http://ppa.launchpad.net precise/main Translation-ja
    無視 http://ppa.launchpad.net precise/main Translation-en
    3,272 B を 5秒 で取得しました (617 B/s)
    W: http://ppa.launchpad.net/brianmercer/php5/ubuntu/dists/precise/main/source/Sources の取得に失敗しました 404 Not Found
    
    W: http://ppa.launchpad.net/brianmercer/php5/ubuntu/dists/precise/main/binary-amd64/Packages の取得に失敗しました 404 Not Found
    
    W: http://ppa.launchpad.net/brianmercer/php5/ubuntu/dists/precise/main/binary-i386/Packages の取得に失敗しました 404 Not Found
    
    E: いくつかのインデックスファイルのダウンロードに失敗しました。これらは無視されるか、古いものが代わりに使われます。
    パッケージリストを読み込んでいます… 完了
    依存関係ツリーを作成しています                
    状態情報を読み取っています… 完了
    以下の特別パッケージがインストールされます:
    
      libcap2 libopts25 libssl0.9.8 ntp
    
    提案パッケージ:
    
      ntp-doc
    
    以下のパッケージが新たにインストールされます:
    
      libcap2 libopts25 libssl0.9.8 ntp td-agent
    
    アップグレード: 0 個、新規インストール: 5 個、削除: 0 個、保留: 8 個。
    15.0 MB のアーカイブを取得する必要があります。
    この操作後に追加で 54.4 MB のディスク容量が消費されます。
    警告: 以下のパッケージは認証されていません!
    
      td-agent
    
    取得:1 http://jp.archive.ubuntu.com/ubuntu/ precise-updates/universe libssl0.9.8 amd64 0.9.8o-7ubuntu3.1 [861 kB]
    取得:2 http://jp.archive.ubuntu.com/ubuntu/ precise/main libcap2 amd64 1:2.22-1ubuntu3 [12.0 kB]
    取得:3 http://jp.archive.ubuntu.com/ubuntu/ precise/main libopts25 amd64 1:5.12-0.1ubuntu1 [59.9 kB]
    取得:4 http://jp.archive.ubuntu.com/ubuntu/ precise-updates/main ntp amd64 1:4.2.6.p3+dfsg-1ubuntu3.1 [612 kB]
    取得:5 http://packages.treasure-data.com/debian/ lucid/contrib td-agent amd64 1.1.11-1 [13.4 MB]
    15.0 MB を 9秒 で取得しました (1,515 kB/s)                                                                                           
    パッケージを事前設定しています …
    以前に未選択のパッケージ libssl0.9.8 を選択しています。
    (データベースを読み込んでいます ... 現在 57537 個のファイルとディレクトリがインストールされています。)
    (.../libssl0.9.8_0.9.8o-7ubuntu3.1_amd64.deb から) libssl0.9.8 を展開しています…
    以前に未選択のパッケージ libcap2 を選択しています。
    (.../libcap2_1%3a2.22-1ubuntu3_amd64.deb から) libcap2 を展開しています…
    以前に未選択のパッケージ libopts25 を選択しています。
    (.../libopts25_1%3a5.12-0.1ubuntu1_amd64.deb から) libopts25 を展開しています…
    以前に未選択のパッケージ ntp を選択しています。
    (.../ntp_1%3a4.2.6.p3+dfsg-1ubuntu3.1_amd64.deb から) ntp を展開しています…
    以前に未選択のパッケージ td-agent を選択しています。
    (.../td-agent_1.1.11-1_amd64.deb から) td-agent を展開しています…
    ureadahead のトリガを処理しています …
    ureadahead will be reprofiled on next reboot
    man-db のトリガを処理しています …
    libssl0.9.8 (0.9.8o-7ubuntu3.1) を設定しています …
    libcap2 (1:2.22-1ubuntu3) を設定しています …
    libopts25 (1:5.12-0.1ubuntu1) を設定しています …
    ntp (1:4.2.6.p3+dfsg-1ubuntu3.1) を設定しています …
    
     * Starting NTP server ntpd [ OK ] 
    
    td-agent (1.1.11-1) を設定しています …
    システムユーザ `td-agent' (UID 106) を追加しています…
    新しいグループ `td-agent' (GID 112) を追加しています…
    新しいユーザー `td-agent' (UID 106) をグループ `td-agent' に追加しています…
    ホームディレクトリ `/home/td-agent' を作成しません。
    Installing default conffile /etc/td-agent/td-agent.conf …
    
     * Starting td-agent td-agent [ OK ] 
    
    libc-bin のトリガを処理しています …
    ldconfig deferred processing now taking place
    あっさり入りました。もう動いてるようです。
    起動や停止のコマンドは以下のようになってます。
    $ /etc/init.d/td-agent start
    $ /etc/init.d/td-agent stop
    $ /etc/init.d/td-agent restart

    fluentdのコマンドツール群が
    /usr/lib/fluent/ruby/bin/
    にあるので、お好きなシェルのリソースファイルにPathを追加しておきます。
    $ vi .bashrc
    export PATH="/usr/lib/fluent/ruby/bin/:$PATH"

    これで以下のコマンドが使えるようになったはずです。
    $ ls /usr/lib/fluent/ruby/bin/
    b2json        fluent-cat           fluent-post           httparty  mongo-tail        rake  td
    bundle        fluent-debug         fluent-scribe-remote  irb       mongo_console     rdoc  testrb
    edit_json.rb  fluent-flume-remote  fluentd               j2bson    nokogiri          ri
    erb           fluent-gem           gem                   jeweler   prettify_json.rb  ruby
    
    たとえば
    $ fluent-gem 
    RubyGems is a sophisticated package manager for Ruby.  This is a
    basic help message containing pointers to more information.
    
      Usage:
        gem -h/--help
        gem -v/--version
        gem command [arguments...] [options...]
    
      Examples:
        gem install rake
        gem list --local
        gem build package.gemspec
        gem help install
    
      Further help:
        gem help commands            list all 'gem' commands
        gem help examples            show some examples of usage
        gem help platforms           show information about platforms
        gem help            show help on COMMAND
                                       (e.g. 'gem help install')
        gem server                   present a web page at
                                     http://localhost:8808/
                                     with info about installed gems
      Further information:
        http://rubygems.rubyforge.org
    ということで、インストールできました。
    つぎは、実際にログの出力をやりたいと思います。
    まとめサイトがあったので貼っておきますね。

    最後までお読みいただき、ありがとうございましたm(_ _)m



    2013年2月11日月曜日

    Ubuntu12.04-LTSにsun-java-jdkをインストールする

    VMにいれたubuntuに巷で噂の引っ張りだこ執事を入れようと思い、まずは意気揚々としていたのですが、Javaが入っていないことが判明したので、まずそこから解決しようと思います。


    参考サイト様

    Ubuntu 12.04 LTSにSun Javaをインストール

    検証環境

    • Ubuntu12.04-LTS_i386(macのVM−Fusion上)

    とはいっても、コマンドまんまコピペですけどねXD


    まず、Javaが入っていなことを確認


    $ java -version
    プログラム 'java' は以下のパッケージで見つかりました:
     * default-jre
     * gcj-4.6-jre-headless
     * openjdk-6-jre-headless
     * gcj-4.5-jre-headless
     * openjdk-7-jre-headless
    次の操作を試してください: sudo apt-get install <選択したパッケージ>
    

    add-apt-repositoryコマンドをインストール

    $ sudo apt-get install python-software-properties
    [sudo] password for typosterr: 
    パッケージリストを読み込んでいます... 完了
    依存関係ツリーを作成しています                
    状態情報を読み取っています... 完了
    python-software-properties はすでに最新バージョンです。
    以下のパッケージが自動でインストールされましたが、もう必要とされていません:
      linux-headers-3.2.0-36-generic-pae linux-headers-3.2.0-30 linux-headers-3.2.0-30-generic-pae linux-headers-3.2.0-36
    これらを削除するには 'apt-get autoremove' を利用してください。
    アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 0 個。

    すでに入っているようです。

  • "sudo: apt-add-repository: command not found" の対処法

  • Javaリポジトリの追加

    ppaの説明はこちらが詳しいと思います。

    $ sudo apt-add-repository ppa:flexiondotorg/java
    You are about to add the following PPA to your system:
     tag:launchpad.net:2008:redacted
     More info: https://launchpad.net/~flexiondotorg/+archive/java
    Press [ENTER] to continue or ctrl-c to cancel adding it
    
    gpg: 鍵輪「/tmp/tmpuo6OgV/secring.gpg」ができました
    gpg: 鍵輪「/tmp/tmpuo6OgV/pubring.gpg」ができました
    gpg: “tag:launchpad.net:2008:redacted”鍵IDではありません: とばします
    recv failed
    

    なんか、嫌な予感が、、、

    $ sudo apt-get update
    
    ~~~~
    パッケージリストを読み込んでいます... 完了
    W: GPG エラー: http://ppa.launchpad.net precise Release: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 2EA8F35793D8809A
    

    やっぱり、、

    でもこんなときは、焦らずまずグーグル先生にエラー文言でググるというバッドノウハウを適応します。

    早速、ヒットしました。

  • Ubuntu日本語フォーラム
    どうやら、鍵のインポートをしているようです。(まったく分かってない)
  • Ubuntu 8.04 に Firefox 3.5 を入れる

  • ではやってみます。(作業として)

    $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2EA8F35793D8809A
    Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.yOaJ8M7pBc --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 2EA8F35793D8809A
    gpg: 鍵93D8809Aをhkpからサーバーkeyserver.ubuntu.comに要求
    gpg: 鍵93D8809A: 公開鍵“Launchpad PPA for Martin Wimpress”を読み込みました
    gpg: 処理数の合計: 1
    gpg:               読込み: 1  (RSA: 1)
    

    今度こそ

    $ sudo apt-get update
    ~~~~~
    316 B を 4秒 で取得しました (71 B/s)
    パッケージリストを読み込んでいます... 完了
    

    おっ、エラーってない。


    どうやら、うまく行ったみたいなので、インストールしてみます。

    $ sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin
    パッケージリストを読み込んでいます... 完了
    依存関係ツリーを作成しています                
    状態情報を読み取っています... 完了
    以下のパッケージが自動でインストールされましたが、もう必要とされていません:
      linux-headers-3.2.0-36-generic-pae linux-headers-3.2.0-30 linux-headers-3.2.0-30-generic-pae linux-headers-3.2.0-36
    これらを削除するには 'apt-get autoremove' を利用してください。
    以下の特別パッケージがインストールされます:
      gsfonts-x11 java-common libodbc1 odbcinst odbcinst1debian2 sun-java6-bin unixodbc
    提案パッケージ:
      default-jre equivs libmyodbc odbc-postgresql tdsodbc unixodbc-bin binfmt-support sun-java6-demo default-jdk-doc sun-java6-source sun-java6-fonts ttf-baekmuk
      ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming
    以下のパッケージが新たにインストールされます:
      gsfonts-x11 java-common libodbc1 odbcinst odbcinst1debian2 sun-java6-bin sun-java6-jdk sun-java6-jre sun-java6-plugin unixodbc
    アップグレード: 0 個、新規インストール: 10 個、削除: 0 個、保留: 0 個。
    57.3 MB のアーカイブを取得する必要があります。
    この操作後に追加で 165 MB のディスク容量が消費されます。
    続行しますか [Y/n]? y
    取得:1 http://jp.archive.ubuntu.com/ubuntu/ precise/main libodbc1 i386 2.2.14p2-5ubuntu3 [225 kB]
    取得:2 http://jp.archive.ubuntu.com/ubuntu/ precise/main odbcinst i386 2.2.14p2-5ubuntu3 [13.6 kB]
    取得:3 http://jp.archive.ubuntu.com/ubuntu/ precise/main odbcinst1debian2 i386 2.2.14p2-5ubuntu3 [47.9 kB]
    取得:4 http://jp.archive.ubuntu.com/ubuntu/ precise/main gsfonts-x11 all 0.22 [9,108 B]
    取得:5 http://jp.archive.ubuntu.com/ubuntu/ precise/main java-common all 0.43ubuntu2 [61.7 kB]
    取得:6 http://jp.archive.ubuntu.com/ubuntu/ precise/main unixodbc i386 2.2.14p2-5ubuntu3 [21.8 kB]
    取得:7 http://ppa.launchpad.net/flexiondotorg/java/ubuntu/ precise/main sun-java6-jre all 6.30-2~precise1 [9,227 kB]
    取得:8 http://ppa.launchpad.net/flexiondotorg/java/ubuntu/ precise/main sun-java6-bin i386 6.30-2~precise1 [27.5 MB]                                                      
    取得:9 http://ppa.launchpad.net/flexiondotorg/java/ubuntu/ precise/main sun-java6-jdk i386 6.30-2~precise1 [20.2 MB]                                                      
    取得:10 http://ppa.launchpad.net/flexiondotorg/java/ubuntu/ precise/main sun-java6-plugin i386 6.30-2~precise1 [1,808 B]                                                  
    57.3 MB を 38秒 で取得しました (1,497 kB/s)                                                                                                                               
    以前に未選択のパッケージ libodbc1 を選択しています。
    (データベースを読み込んでいます ... 現在 205007 個のファイルとディレクトリがインストールされています。)
    (.../libodbc1_2.2.14p2-5ubuntu3_i386.deb から) libodbc1 を展開しています...
    以前に未選択のパッケージ odbcinst を選択しています。
    (.../odbcinst_2.2.14p2-5ubuntu3_i386.deb から) odbcinst を展開しています...
    以前に未選択のパッケージ odbcinst1debian2 を選択しています。
    (.../odbcinst1debian2_2.2.14p2-5ubuntu3_i386.deb から) odbcinst1debian2 を展開しています...
    以前に未選択のパッケージ gsfonts-x11 を選択しています。
    (.../gsfonts-x11_0.22_all.deb から) gsfonts-x11 を展開しています...
    以前に未選択のパッケージ java-common を選択しています。
    (.../java-common_0.43ubuntu2_all.deb から) java-common を展開しています...
    以前に未選択のパッケージ sun-java6-jre を選択しています。
    (.../sun-java6-jre_6.30-2~precise1_all.deb から) sun-java6-jre を展開しています...
    以前に未選択のパッケージ unixodbc を選択しています。
    (.../unixodbc_2.2.14p2-5ubuntu3_i386.deb から) unixodbc を展開しています...
    以前に未選択のパッケージ sun-java6-bin を選択しています。
    (.../sun-java6-bin_6.30-2~precise1_i386.deb から) sun-java6-bin を展開しています...
    以前に未選択のパッケージ sun-java6-jdk を選択しています。
    (.../sun-java6-jdk_6.30-2~precise1_i386.deb から) sun-java6-jdk を展開しています...
    以前に未選択のパッケージ sun-java6-plugin を選択しています。
    (.../sun-java6-plugin_6.30-2~precise1_i386.deb から) sun-java6-plugin を展開しています...
    man-db のトリガを処理しています ...
    fontconfig のトリガを処理しています ...
    doc-base のトリガを処理しています ...
    Processing 3 added doc-base files...
    Registering documents with scrollkeeper...
    shared-mime-info のトリガを処理しています ...
    bamfdaemon のトリガを処理しています ...
    Rebuilding /usr/share/applications/bamf.index...
    desktop-file-utils のトリガを処理しています ...
    gnome-menus のトリガを処理しています ...
    libodbc1 (2.2.14p2-5ubuntu3) を設定しています ...
    gsfonts-x11 (0.22) を設定しています ...
    java-common (0.43ubuntu2) を設定しています ...
    odbcinst1debian2 (2.2.14p2-5ubuntu3) を設定しています ...
    unixodbc (2.2.14p2-5ubuntu3) を設定しています ...
    sun-java6-jre (6.30-2~precise1) を設定しています ...
    sun-java6-bin (6.30-2~precise1) を設定しています ...
    update-alternatives: /usr/bin/ControlPanel (ControlPanel) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/ControlPanel を使います。
    update-alternatives: /usr/bin/java (java) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/java を使います。
    update-alternatives: /usr/bin/java_vm (java_vm) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/java_vm を使います。
    update-alternatives: /usr/bin/javaws (javaws) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/javaws を使います。
    update-alternatives: /usr/bin/jcontrol (jcontrol) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/jcontrol を使います。
    update-alternatives: /usr/bin/keytool (keytool) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/keytool を使います。
    update-alternatives: /usr/bin/pack200 (pack200) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/pack200 を使います。
    update-alternatives: /usr/bin/policytool (policytool) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/policytool を使います。
    update-alternatives: /usr/bin/rmid (rmid) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/rmid を使います。
    update-alternatives: /usr/bin/rmiregistry (rmiregistry) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/rmiregistry を使います。
    update-alternatives: /usr/bin/unpack200 (unpack200) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/unpack200 を使います。
    update-alternatives: /usr/bin/orbd (orbd) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/orbd を使います。
    update-alternatives: /usr/bin/servertool (servertool) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/servertool を使います。
    update-alternatives: /usr/bin/tnameserv (tnameserv) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/bin/tnameserv を使います。
    update-alternatives: /usr/bin/jexec (jexec) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/jre/lib/jexec を使います。
    sun-java6-jdk (6.30-2~precise1) を設定しています ...
    update-alternatives: /usr/bin/HtmlConverter (HtmlConverter) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/HtmlConverter を使います。
    update-alternatives: /usr/bin/appletviewer (appletviewer) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/appletviewer を使います。
    update-alternatives: /usr/bin/apt (apt) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/apt を使います。
    update-alternatives: /usr/bin/extcheck (extcheck) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/extcheck を使います。
    update-alternatives: /usr/bin/idlj (idlj) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/idlj を使います。
    update-alternatives: /usr/bin/jar (jar) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jar を使います。
    update-alternatives: /usr/bin/jarsigner (jarsigner) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jarsigner を使います。
    update-alternatives: /usr/bin/java-rmi.cgi (java-rmi.cgi) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/java-rmi.cgi を使います。
    update-alternatives: /usr/bin/javac (javac) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/javac を使います。
    update-alternatives: /usr/bin/javadoc (javadoc) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/javadoc を使います。
    update-alternatives: /usr/bin/javah (javah) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/javah を使います。
    update-alternatives: /usr/bin/javap (javap) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/javap を使います。
    update-alternatives: /usr/bin/jconsole (jconsole) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jconsole を使います。
    update-alternatives: /usr/bin/jdb (jdb) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jdb を使います。
    update-alternatives: /usr/bin/jhat (jhat) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jhat を使います。
    update-alternatives: /usr/bin/jinfo (jinfo) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jinfo を使います。
    update-alternatives: /usr/bin/jmap (jmap) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jmap を使います。
    update-alternatives: /usr/bin/jps (jps) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jps を使います。
    update-alternatives: /usr/bin/jrunscript (jrunscript) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jrunscript を使います。
    update-alternatives: /usr/bin/jsadebugd (jsadebugd) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jsadebugd を使います。
    update-alternatives: /usr/bin/jstack (jstack) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jstack を使います。
    update-alternatives: /usr/bin/jstat (jstat) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jstat を使います。
    update-alternatives: /usr/bin/jstatd (jstatd) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/jstatd を使います。
    update-alternatives: /usr/bin/native2ascii (native2ascii) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/native2ascii を使います。
    update-alternatives: /usr/bin/rmic (rmic) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/rmic を使います。
    update-alternatives: /usr/bin/schemagen (schemagen) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/schemagen を使います。
    update-alternatives: /usr/bin/serialver (serialver) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/serialver を使います。
    update-alternatives: /usr/bin/wsgen (wsgen) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/wsgen を使います。
    update-alternatives: /usr/bin/wsimport (wsimport) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/wsimport を使います。
    update-alternatives: /usr/bin/xjc (xjc) を提供するために 自動モード で /usr/lib/jvm/java-6-sun/bin/xjc を使います。
    sun-java6-plugin (6.30-2~precise1) を設定しています ...
    odbcinst (2.2.14p2-5ubuntu3) を設定しています ...
    libc-bin のトリガを処理しています ...
    ldconfig deferred processing now taking place
    

    では、確認してみます。

    $ java -version
    java version "1.6.0_30"
    Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
    Java HotSpot(TM) Server VM (build 20.5-b03, mixed mode)
    

    成功です


    インストールが成功すると、シンボリックリンクが貼られてますね。

    $ cd /usr/lib/jvm/
    $ ll
    合計 48
    drwxr-xr-x   3 root root  4096  2月 11 19:38 ./
    drwxr-xr-x 186 root root 36864  2月 11 19:38 ../
    -rw-r--r--   1 root root  2448  1月 10  2012 .java-6-sun.jinfo
    lrwxrwxrwx   1 root root    19  1月 10  2012 java-6-sun -> java-6-sun-1.6.0.30/
    drwxr-xr-x   8 root root  4096  2月 11 19:38 java-6-sun-1.6.0.30/
    

    あとは、Javaの設定などをリソースファイルに書いておくと楽だよと書いてあります


    こんな風らしいです

    JAVA_HOME="/usr/lib/jvm/java-6-sun"
    CLASSPATH=".:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar"
    export JAVA_HOME CLASSPATH

    Javaをインストールするにも色々あるものですね。


    最後までお読みいただきありがとうございましたm(_ _)m

    2013年1月26日土曜日

    Ubuntu12.04をインストールしてやったこと

    どうもこんにちは、typosterrといいます。
     趣味でプログラムを書いています。今後とも宜しくおねがいします。
     普段はmacを使っていて、UbuntuもVMWare上にインストールしているのですが、Linuxもきちんとおさえていきたいと思って、このブログを始めようと思います。

     はじめに
    •  なにぶん情弱なので、間違っていたら教えていただけると嬉しいです。(もちろん、事前にそのようなことのないように努めていく所存です)
    •  ここに書いてある記事によって生じた問題は私は負いかねますので、すみませんがご了承お願いします。

    では早速。。

     環境
    • mac Mountain Lion 10.8 .2 on VMFusion4
    •  Ubuntu12.04(32bit)
    やったこと

    VMware-Toolsのインストール
      VMwareのメニューのVirtual Machineー>Install VMware Toolsを選択

      Installをクリック

      ターミナルからのコマンドを実行
      ~$ sudo su -
      ~# cp /media/VMware\ Tools/VMwareTools-8.8.4-730257.tar.gz /tmp/
      ~# cd /tmp/
      /tmp# tar zxpf VMwareTools-8.8.4-730257.tar.gz 
      /tmp# cd vmware-tools-distrib/
      /tmp/vmware-tools-distrib# ./vmware-install.pl 
      Creating a new VMware Tools installer database using the tar4 format.
      
      Installing VMware Tools.
      
      In which directory do you want to install the binary files? 
      [/usr/bin] 
      
      What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
      [/etc] 
      
      What is the directory that contains the init scripts? 
      [/etc/init.d] 
      
      In which directory do you want to install the daemon files? 
      [/usr/sbin] 
      
      In which directory do you want to install the library files? 
      [/usr/lib/vmware-tools] 
      
      The path "/usr/lib/vmware-tools" does not exist currently. This program is 
      going to create it, including needed parent directories. Is this what you want?
      [yes] 
      
      In which directory do you want to install the documentation files? 
      [/usr/share/doc/vmware-tools] 
      
      The path "/usr/share/doc/vmware-tools" does not exist currently. This program 
      is going to create it, including needed parent directories. Is this what you 
      want? [yes] 
      
      The installation of VMware Tools 8.8.4 build-730257 for Linux completed 
      successfully. You can decide to remove this software from your system at any 
      time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
      
      Before running VMware Tools for the first time, you need to configure it by 
      invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want 
      this program to invoke the command for you now? [yes] 
      
      Initializing...
      
      
      Making sure services for VMware Tools are stopped.
      
      
      
      [EXPERIMENTAL] The VMware FileSystem Sync Driver (vmsync) is a new feature that
      creates backups of virtual machines. Please refer to the VMware Knowledge Base 
      for more details on this capability. Do you wish to enable this feature? 
      [no] 
      
      
      Before you can compile modules, you need to have the following installed... 
      
      make
      gcc
      kernel headers of the running kernel
      
      
      Searching for GCC...
      Detected GCC binary at "/usr/bin/gcc".
      The path "/usr/bin/gcc" appears to be a valid path to the gcc binary.
      Would you like to change it? [no] 
      
      Searching for a valid kernel header path...
      Detected the kernel headers at 
      "/lib/modules/3.2.0-36-generic-pae/build/include".
      The path "/lib/modules/3.2.0-36-generic-pae/build/include" appears to be a 
      valid path to the 3.2.0-36-generic-pae kernel headers.
      Would you like to change it? [no] 
      
      Using 2.6.x kernel build system.
      make: ディレクトリ `/tmp/vmware-root/modules/vmci-only' に入ります
      make -C /lib/modules/3.2.0-36-generic-pae/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= modules
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' に入ります
        CC [M]  /tmp/vmware-root/modules/vmci-only/linux/driver.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/linux/vmciKernelIf.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciContext.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDoorbell.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDatagram.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDriver.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciEvent.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciHashtable.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciQPair.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciQueuePair.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciResource.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciRoute.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/driverLog.o
        LD [M]  /tmp/vmware-root/modules/vmci-only/vmci.o
        Building modules, stage 2.
        MODPOST 1 modules
        CC      /tmp/vmware-root/modules/vmci-only/vmci.mod.o
        LD [M]  /tmp/vmware-root/modules/vmci-only/vmci.ko
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' から出ます
      make -C $PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= postbuild
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmci-only' に入ります
      make[1]: `postbuild' は更新済みです
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmci-only' から出ます
      cp -f vmci.ko ./../vmci.o
      make: ディレクトリ `/tmp/vmware-root/modules/vmci-only' から出ます
      
      Using 2.6.x kernel build system.
      make: ディレクトリ `/tmp/vmware-root/modules/vmci-only' に入ります
      make -C /lib/modules/3.2.0-36-generic-pae/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= modules
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' に入ります
        CC [M]  /tmp/vmware-root/modules/vmci-only/linux/driver.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/linux/vmciKernelIf.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciContext.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDatagram.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDoorbell.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDriver.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciEvent.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciHashtable.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciQPair.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciQueuePair.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciResource.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciRoute.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/driverLog.o
        LD [M]  /tmp/vmware-root/modules/vmci-only/vmci.o
        Building modules, stage 2.
        MODPOST 1 modules
        CC      /tmp/vmware-root/modules/vmci-only/vmci.mod.o
        LD [M]  /tmp/vmware-root/modules/vmci-only/vmci.ko
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' から出ます
      make -C $PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= postbuild
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmci-only' に入ります
      make[1]: `postbuild' は更新済みです
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmci-only' から出ます
      cp -f vmci.ko ./../vmci.o
      make: ディレクトリ `/tmp/vmware-root/modules/vmci-only' から出ます
      Using 2.6.x kernel build system.
      make: ディレクトリ `/tmp/vmware-root/modules/vsock-only' に入ります
      make -C /lib/modules/3.2.0-36-generic-pae/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= modules
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' に入ります
        CC [M]  /tmp/vmware-root/modules/vsock-only/linux/notify.o
        CC [M]  /tmp/vmware-root/modules/vsock-only/linux/notifyQState.o
        CC [M]  /tmp/vmware-root/modules/vsock-only/linux/af_vsock.o
        CC [M]  /tmp/vmware-root/modules/vsock-only/linux/stats.o
        CC [M]  /tmp/vmware-root/modules/vsock-only/linux/util.o
        CC [M]  /tmp/vmware-root/modules/vsock-only/linux/vsockAddr.o
        CC [M]  /tmp/vmware-root/modules/vsock-only/driverLog.o
        LD [M]  /tmp/vmware-root/modules/vsock-only/vsock.o
        Building modules, stage 2.
        MODPOST 1 modules
        CC      /tmp/vmware-root/modules/vsock-only/vsock.mod.o
        LD [M]  /tmp/vmware-root/modules/vsock-only/vsock.ko
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' から出ます
      make -C $PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= postbuild
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vsock-only' に入ります
      make[1]: `postbuild' は更新済みです
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vsock-only' から出ます
      cp -f vsock.ko ./../vsock.o
      make: ディレクトリ `/tmp/vmware-root/modules/vsock-only' から出ます
      
      The module vmxnet3 has already been installed on this system by another 
      installer or package and will not be modified by this installer.  Use the flag 
      --clobber-kernel-modules=vmxnet3 to override.
      
      The module pvscsi has already been installed on this system by another 
      installer or package and will not be modified by this installer.  Use the flag 
      --clobber-kernel-modules=pvscsi to override.
      
      The module vmmemctl has already been installed on this system by another 
      installer or package and will not be modified by this installer.  Use the flag 
      --clobber-kernel-modules=vmmemctl to override.
      
      The VMware Host-Guest Filesystem allows for shared folders between the host OS 
      and the guest OS in a Fusion or Workstation virtual environment.  Do you wish 
      to enable this feature? [yes] 
      
      Using 2.6.x kernel build system.
      make: ディレクトリ `/tmp/vmware-root/modules/vmci-only' に入ります
      make -C /lib/modules/3.2.0-36-generic-pae/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= modules
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' に入ります
        CC [M]  /tmp/vmware-root/modules/vmci-only/linux/driver.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/linux/vmciKernelIf.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciContext.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDatagram.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDoorbell.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDriver.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciEvent.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciHashtable.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciQPair.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciQueuePair.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciResource.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciRoute.o
        CC [M]  /tmp/vmware-root/modules/vmci-only/driverLog.o
        LD [M]  /tmp/vmware-root/modules/vmci-only/vmci.o
        Building modules, stage 2.
        MODPOST 1 modules
        CC      /tmp/vmware-root/modules/vmci-only/vmci.mod.o
        LD [M]  /tmp/vmware-root/modules/vmci-only/vmci.ko
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' から出ます
      make -C $PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= postbuild
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmci-only' に入ります
      make[1]: `postbuild' は更新済みです
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmci-only' から出ます
      cp -f vmci.ko ./../vmci.o
      make: ディレクトリ `/tmp/vmware-root/modules/vmci-only' から出ます
      Using 2.6.x kernel build system.
      make: ディレクトリ `/tmp/vmware-root/modules/vmhgfs-only' に入ります
      make -C /lib/modules/3.2.0-36-generic-pae/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= modules
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' に入ります
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/backdoorGcc32.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/bdhandler.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/backdoor.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpName.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpNameLinux.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/dentry.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpNameLite.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/dir.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/file.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/fsutil.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/filesystem.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsBd.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsEscape.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsUtil.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/inode.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/link.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/message.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/module.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/page.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/request.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/rpcout.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/super.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/tcp.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/stubs.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/transport.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/vmci.o
        CC [M]  /tmp/vmware-root/modules/vmhgfs-only/kernelStubsLinux.o
      /tmp/vmware-root/modules/vmhgfs-only/file.c:128:4: 警告: 互換性のないポインタ型からの初期化です [デフォルトで有効]
      /tmp/vmware-root/modules/vmhgfs-only/file.c:128:4: 警告: (‘HgfsFileFileOperations.fsync’ 用の初期化付近) [デフォルトで有効]
        LD [M]  /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.o
        Building modules, stage 2.
        MODPOST 1 modules
        CC      /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.mod.o
        LD [M]  /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.ko
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' から出ます
      make -C $PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= postbuild
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmhgfs-only' に入ります
      make[1]: `postbuild' は更新済みです
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmhgfs-only' から出ます
      cp -f vmhgfs.ko ./../vmhgfs.o
      make: ディレクトリ `/tmp/vmware-root/modules/vmhgfs-only' から出ます
      
      Using 2.6.x kernel build system.
      make: ディレクトリ `/tmp/vmware-root/modules/vmxnet-only' に入ります
      make -C /lib/modules/3.2.0-36-generic-pae/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= modules
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' に入ります
        CC [M]  /tmp/vmware-root/modules/vmxnet-only/vmxnet.o
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: 関数 ‘vmxnet_probe_device’ 内:
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:1008:7: エラー: 初期化子内で不明なフィールド ‘ndo_set_multicast_list’ が指定されています
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:1008:7: 警告: 互換性のないポインタ型からの初期化です [デフォルトで有効]
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:1008:7: 警告: (‘vmxnet_netdev_ops.ndo_vlan_rx_add_vid’ 用の初期化付近) [デフォルトで有効]
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: 関数 ‘vmxnet_map_pkt’ 内:
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2085:32: エラー: 2 番目の ‘pci_map_page’ の引数用の互換性がない型です
      include/asm-generic/pci-dma-compat.h:43:1: 備考: expected ‘struct page *’ but argument is of type ‘struct <無名>’
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2104:26: エラー: 2 番目の ‘pci_map_page’ の引数用の互換性がない型です
      include/asm-generic/pci-dma-compat.h:43:1: 備考: expected ‘struct page *’ but argument is of type ‘struct <無名>’
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: 関数 ‘vmxnet_rx_frags’ 内:
      /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2599:48: エラー: 型 ‘struct <無名>’ への型 ‘struct page *’ からの代入時に互換性のない型です
      make[2]: *** [/tmp/vmware-root/modules/vmxnet-only/vmxnet.o] エラー 1
      make[1]: *** [_module_/tmp/vmware-root/modules/vmxnet-only] エラー 2
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' から出ます
      make: *** [vmxnet.ko] エラー 2
      make: ディレクトリ `/tmp/vmware-root/modules/vmxnet-only' から出ます
      
      The fast network device driver (vmxnet module) is used only for our fast 
      networking interface. The rest of the software provided by VMware Tools is 
      designed to work independently of this feature.
      If you wish to have the fast network driver enabled, you can install the driver
      by running vmware-config-tools.pl again after making sure that gcc, binutils, 
      make and the kernel sources for your running kernel are installed on your 
      machine. These packages are available on your distribution's installation CD.
      [ Press Enter key to continue ] 
      
      Using 2.6.x kernel build system.
      make: ディレクトリ `/tmp/vmware-root/modules/vmblock-only' に入ります
      make -C /lib/modules/3.2.0-36-generic-pae/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= modules
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' に入ります
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/control.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/dbllnklst.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/block.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/dentry.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/file.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/filesystem.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/inode.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/module.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/stubs.o
        CC [M]  /tmp/vmware-root/modules/vmblock-only/linux/super.o
        LD [M]  /tmp/vmware-root/modules/vmblock-only/vmblock.o
        Building modules, stage 2.
        MODPOST 1 modules
        CC      /tmp/vmware-root/modules/vmblock-only/vmblock.mod.o
        LD [M]  /tmp/vmware-root/modules/vmblock-only/vmblock.ko
      make[1]: ディレクトリ `/usr/src/linux-headers-3.2.0-36-generic-pae' から出ます
      make -C $PWD SRCROOT=$PWD/. \
         MODULEBUILDDIR= postbuild
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmblock-only' に入ります
      make[1]: `postbuild' は更新済みです
      make[1]: ディレクトリ `/tmp/vmware-root/modules/vmblock-only' から出ます
      cp -f vmblock.ko ./../vmblock.o
      make: ディレクトリ `/tmp/vmware-root/modules/vmblock-only' から出ます
      
      !!! [EXPERIMENTAL] !!!
      VMware automatic kernel modules enables automatic building and installation of
      VMware kernel modules at boot they are not already present.  By selecting yes,
      you will be enabling this experimental feature.  You can always disable this
      feature by re-running vmware-config-tools.pl.
      
      Would you like to enable VMware automatic kernel modules?
      [no] 
      
      
      Disabling timer-based audio scheduling in pulseaudio.
      
      
      
      Detected X server version 1.11.3
      
      
      
      Distribution provided drivers for Xorg X server are used.
      
      Skipping X configuration because X drivers are not included.
      
      Creating a new initrd boot image for the kernel.
      update-initramfs: Generating /boot/initrd.img-3.2.0-36-generic-pae
      vmware-tools start/running
      The configuration of VMware Tools 8.8.4 build-730257 for Linux for this running
      kernel completed successfully.
      
      You must restart your X session before any mouse or graphics changes take 
      effect.
      
      You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
      command line or by invoking "/usr/bin/vmware-toolbox" from the command line 
      during an X server session.
      
      To enable advanced X features (e.g., guest resolution fit, drag and drop, and 
      file and text copy/paste), you will need to do one (or more) of the following:
      1. Manually start /usr/bin/vmware-user
      2. Log out and log back into your desktop session; and,
      3. Restart your X session.
      
      Enjoy,
      
      --the VMware team
      
      Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting device 
      /dev/sr0 ...
      /tmp/vmware-tools-distrib# 
      これで再度ログインすればOKです。
      全画面表示もできるし、クリップボードが共有できる
    ホームディレクトリを英語表記に
    $ LANG=C xdg-user-dirs-gtk-update
    
    Ctrl+spaceで入力切り換えしないようにする
    1. . 上段パネルのキーボードアイコンをクリックして「設定」→「一般」タブを開いて「キーボードショートカット」の「切り替え」の右側の「...」をクリック
    2. . 「キーボードショートカット」で「Ctrl+space」を選択して削除
    CompizConfig 設定マネージャのインストール
    $ sudo apt-get install compizconfig-settings-manager

    Chromiumのインストール
    $ sudo apt-get install chromium-browser

    zshのインストール
    $ sudo apt-get install zsh zsh-dev
    $ chsh -s /bin/zsh

    tmuxのインストール
    $ sudo apt-get install tmux

    StarDictをインストール
    $ sudo apt-get install stardict stardict-tools

    Mozcのインストール
    インストール
    $ sudo apt-get install ibus-mozc

    ibus-mozcMozcを有効化
    1. . ibusを再起動(上段パネルのキーボードアイコンをクリック→再起動)
    2. . 上段パネルのキーボードアイコンをクリックして「設定」→インプットメソッド→「インプットメソッドの選択」でMozcを選択して追加し、「上へ」で順序を上にする
    3. . ibusを再起動

    Emacsのインストールと設定
      $ sudo apt-get install emacs
      $ sudo apt-get install ibus-el
      C/Migemoのインストール
      1. . SubversionとNKFをインストール
        subversion
        $ sudo apt-get install subversion

        NFK
        $ sudo apt-get install nkf
      2. . 普通にMigemoをインストール
        EmacsからMigemoを使うにはmigemo.elが必要なので、とりあえずインストール
        $ sudo apt-get install migemo

      3. . svnでC/Migemoのソースを取ってくる
        ソースコードは下記URLからダウンロードできるようになっています。(svnはいらなくなりました)
        http://code.google.com/p/cmigemo/downloads/list

      4. . ソースの修正
        そのままだとmakeしたときに
        src/wordbuf.c:118: error: ‘INT_MAX’ undeclared (first use in this function)
        src/wordbuf.c:118: error: (Each undeclared identifier is reported only once
        src/wordbuf.c:118: error: for each function it appears in.)

        っていうエラーが出るので、src/wordbuf.cの12行目あたりに
        #include 

        を追加
        編集後のwordbuf.cはこんな感じ
        /* vim:set ts=8 sts=4 sw=4 tw=0: */
        /*
         * wordbuf.h -
         *
         * Written By:  MURAOKA Taro 
         * Last Change: 20-Sep-2009.
         */
        
        #include 
        #include 
        #include 
        #include  /* これを追加 */
        #include "wordbuf.h"
        
        #define WORDLEN_DEF 64
        ・
        ・
        ・
        
        

      5. . コンパイルしてインストール
        $ cd trunk
        $ ./configure
        $ make gcc
        $ cd dict
        $ make utf-8
        $ cd ..
        $ sudo make gcc-install
        

      6. . .emacsに以下を追加
        インサイドフラッギング: Migemo(C/Migemo)のインストールで紹介されているのをそのまま使用
        (setq migemo-command "cmigemo")
        (setq migemo-options '("-q" "--emacs"))
        (setq migemo-dictionary "/usr/local/share/migemo/utf-8/migemo-dict")
        (setq migemo-user-dictionary nil)
        (setq migemo-regex-dictionary nil)
        (setq migemo-coding-system 'utf-8-unix)
        (load-library "migemo")
        (migemo-init)

        これでC-sしたときにMigemoが有効になるはず。

      Emacs利用時にXIMを無効化
      ホームディレクトリの.Xresourcesファイル(なかったら作成)に
      Emacs*useXIM: false

      という行を追加して
      $ xrdb ~/.Xresources
      を実行(またはログアウトしてXサーバを再起動)します。


    VirtualBoxのインストール
    1. . /etc/apt/sources.list に下記を追記
      deb http://download.virtualbox.org/virtualbox/debian oneiric contrib
    2. . リポジトリの追加
      $ wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

    3. . インストール
      $ sudo apt-get update
      $ sudo apt-get install virtualbox-4.1

    4. . VirtualBox Extension Packのインストール

    5. Download VirtualBoxからVirtualBox Extension Packをダウンロード

    6. VirtualBoxを起動し、ダウンロードしたファイルをドラッグ&ドロップしてインストール

    rlwrapのインストール
    $ sudo apt-get install rlwrap
    xselのインストール
    $ sudo apt-get install xsel

    Dropboxのインストール(下記URLから)
      https://www.dropbox.com/install?os=lnx

    vimのインストール
    $ sudo apt-get install vim

    ご覧いただき、ありがとうございました。

    参考サイト様

    TO-DO

    随時追加していく