『とびだせ どうぶつの森』はじめました

出遅れ?

夜中にオーロラ見ました。

f:id:kiyotune:20121211230931j:plain

電子レンジをゲットしてバーチャルでもぼっち飯。

f:id:kiyotune:20121211215829j:plain

ムスメ1号にバレてしまったので村に招待して穴堀ったりガラクタ埋めたりして遊びました。とても楽しかったです。文字入力がおぼつかないと日記調になりますね。アデュー。

カオスなムスメ1号の部屋。

f:id:kiyotune:20121211230659j:plain

Jenkins インストールログ

Jenkins

http://jenkins-ci.org/sites/default/files/jenkins_logo.png

Homebrewでインストールできるらしい。あら簡単。

$ brew install jenkins

==> Downloading http://mirrors.jenkins-ci.org/war/1.486/jenkins.war
######################################################################## 100.0%
==> Caveats
If this is your first install, automatically load on login with:
mkdir -p ~/Library/LaunchAgents
ln -nfs /usr/local/Cellar/jenkins/1.486/homebrew.mxcl.jenkins.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

If this is an upgrade and you already have the homebrew.mxcl.jenkins.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

Or start it manually:
java -jar /usr/local/Cellar/jenkins/1.486/libexec/jenkins.war
==> Summary
/usr/local/Cellar/jenkins/1.486: 3 files, 47M, built in 2.6 minutes

起動

$ java -jar /usr/local/Cellar/jenkins/1.486/libexec/jenkins.war

Running from: /usr/local/Cellar/jenkins/1.486/libexec/jenkins.war
webroot: $user.home/.jenkins
2012/10/28 17:19:28 winstone.Logger logInternal
???: Beginning extraction from war file
Jenkins home directory: /Users/kiyotune/.jenkins found at: $user.home/.jenkins
2012/10/28 17:19:33 winstone.Logger logInternal
???: HTTP Listener started: port=8080
2012/10/28 17:19:33 winstone.Logger logInternal
???: AJP13 Listener started: port=8009
2012/10/28 17:19:33 winstone.Logger logInternal
???: Winstone Servlet Engine v0.9.10 running: controlPort=disabled
2012/10/28 17:19:34 jenkins.InitReactorRunner$1 onAttained
???: Started initialization
2012/10/28 17:19:36 jenkins.InitReactorRunner$1 onAttained
???: Listed all plugins
2012/10/28 17:19:36 jenkins.InitReactorRunner$1 onAttained
???: Prepared all plugins
2012/10/28 17:19:36 jenkins.InitReactorRunner$1 onAttained
???: Started all plugins
2012/10/28 17:19:36 jenkins.InitReactorRunner$1 onAttained
???: Augmented all extensions
2012/10/28 17:19:36 jenkins.InitReactorRunner$1 onAttained
???: Loaded all jobs
2012/10/28 17:19:40 org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration run
???: Trying to register BouncyCastle as a JCE provider
2012/10/28 17:19:41 org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration run
???: Registration succeeded
2012/10/28 17:19:41 org.jenkinsci.main.modules.sshd.SSHD start
???: Started SSHD at port 64242
2012/10/28 17:19:41 jenkins.InitReactorRunner$1 onAttained
???: Completed initialization
2012/10/28 17:19:41 hudson.TcpSlaveAgentListener <init>
???: JNLP slave agent listener started on TCP port 64243
2012/10/28 17:19:41 hudson.WebAppMain$2 run
???: Jenkins is fully up and running

http:://localhost:8080 でブラウザで見てみる。

f:id:kiyotune:20121028172312p:plain

終了。 Ctrl+c でコマンドを中断して終了。

PHPUnitインストールログ

失敗。

PEARのチャンネルを追加。

$ pear channel-discover pear.phpunit.de
Adding Channel "pear.phpunit.de" succeeded
Discovery of channel "pear.phpunit.de" succeeded
$ pear channel-discover pear.symfony-project.com
Adding Channel "pear.symfony-project.com" succeeded
Discovery of channel "pear.symfony-project.com" succeeded

symfony/YAMLをインストール【NG】

よくWeb上に転がっているコマンド。

$ pear install symfony/YAML 
downloading YAML-1.0.6.tgz ...
Starting to download YAML-1.0.6.tgz (10,010 bytes)
.....done: 10,010 bytes
install ok: channel://pear.symfony-project.com/YAML-1.0.6

symfony/YAMLをインストール【OK】

上のコマンドだとYamlのバージョン(Yaml-2.1.0以上)が古くてPHPUnitのインストールが失敗するので、以下のコマンドを使用する。

$ pear install pear.symfony.com/Yaml
downloading Yaml-2.1.2.tgz ...
Starting to download Yaml-2.1.2.tgz (38,429 bytes)
..........done: 38,429 bytes
install ok: channel://pear.symfony.com/Yaml-2.1.2

PHPUnitをインストール(成功)

$ pear install phpunit/PHPUnit
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.1.0)
downloading PHPUnit-3.7.8.tgz ...
Starting to download PHPUnit-3.7.8.tgz (115,978 bytes)
.........................done: 115,978 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.7.8

PHP_Invokerがどうとか言っているのでついでにインストールする。

$ pear install phpunit/PHP_Invoker
downloading PHP_Invoker-1.1.2.tgz ...
Starting to download PHP_Invoker-1.1.2.tgz (3,705 bytes)
....done: 3,705 bytes
install ok: channel://pear.phpunit.de/PHP_Invoker-1.1.2

YAMLのバージョンが古くて失敗したときのPHPUnitインストールログ。

$ pear install phpunit/PHPUnit
Unknown remote channel: pear.symfony.com
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit requires package "channel://pear.symfony.com/Yaml" (version >= 2.1.0)
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.1.0)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
phpunit/PHPUnit_MockObject can optionally use PHP extension "soap"
downloading File_Iterator-1.3.3.tgz ...
Starting to download File_Iterator-1.3.3.tgz (5,152 bytes)
.....done: 5,152 bytes
downloading Text_Template-1.1.3.tgz ...
Starting to download Text_Template-1.1.3.tgz (3,594 bytes)
...done: 3,594 bytes
downloading PHP_CodeCoverage-1.2.6.tgz ...
Starting to download PHP_CodeCoverage-1.2.6.tgz (155,960 bytes)
...done: 155,960 bytes
downloading PHP_Timer-1.0.4.tgz ...
Starting to download PHP_Timer-1.0.4.tgz (3,694 bytes)
...done: 3,694 bytes
downloading PHPUnit_MockObject-1.2.1.tgz ...
Starting to download PHPUnit_MockObject-1.2.1.tgz (20,417 bytes)
...done: 20,417 bytes
downloading PHP_TokenStream-1.1.5.tgz ...
Starting to download PHP_TokenStream-1.1.5.tgz (9,859 bytes)
...done: 9,859 bytes
install ok: channel://pear.phpunit.de/File_Iterator-1.3.3
install ok: channel://pear.phpunit.de/Text_Template-1.1.3
install ok: channel://pear.phpunit.de/PHP_Timer-1.0.4
install ok: channel://pear.phpunit.de/PHP_TokenStream-1.1.5
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.2.6
install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.2.1

brew install php53-xdebug ログ

$ brew install php53-xdebug

==> Installing php53-xdebug dependency: php53
==> Downloading http://www.php.net/get/php-5.3.17.tar.bz2/from/this/mirror
######################################################################## 100.0%
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
         of homebrew-php, or you are using a non-standard
         pear.conf location, installation may fail.
==> ./configure --prefix=/usr/local/Cellar/php53/5.3.17 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.3 --with-config-file-path=/usr/local/et
==> make
==> make install
==> /usr/local/Cellar/php53/5.3.17/bin/pear config-set php_ini /usr/local/etc/php/5.3/php.ini
==> Caveats
For 10.5 and Apache:
    Apache needs to run in 32-bit mode. You can either force Apache to start
    in 32-bit mode or you can thin the Apache executable.

To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php5_module    /usr/local/Cellar/php53/5.3.17/libexec/apache2/libphp5.so

The php.ini file can be found in:
    /usr/local/etc/php/5.3/php.ini

✩✩✩✩ PEAR ✩✩✩✩

If pear complains about permissions, 'Fix' the default PEAR permissions and config:
    chmod -R ug+w /usr/local/Cellar/php53/5.3.17/lib/php
    pear config-set php_ini /usr/local/etc/php/5.3/php.ini

✩✩✩✩ Extensions ✩✩✩✩

If you are having issues with custom extension compiling, ensure that this php is
in your PATH:
    PATH="$(brew --prefix josegonzalez/php/php53)/bin:$PATH"

PHP53 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.

✩✩✩✩ FPM ✩✩✩✩

If you have installed the formula with --with-fpm, to launch php-fpm on startup:
    * If this is your first install:
        mkdir -p ~/Library/LaunchAgents
        cp /usr/local/Cellar/php53/5.3.17/homebrew-php.josegonzalez.php53.plist ~/Library/LaunchAgents/
        launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php53.plist

    * If this is an upgrade and you already have the homebrew-php.josegonzalez.php53.plist loaded:
        launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php53.plist
        cp /usr/local/Cellar/php53/5.3.17/homebrew-php.josegonzalez.php53.plist ~/Library/LaunchAgents/
        launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php53.plist

Mountain Lion comes with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:

  PATH="/usr/local/sbin:$PATH"

You may also need to edit the plist to use the correct "UserName".

Please note that the plist was called 'org.php-fpm.plist' in old versions
of this formula.
Warning: Could not link php53. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link php53'
==> Summary
/usr/local/Cellar/php53/5.3.17: 459 files, 27M, built in 11.4 minutes
==> Installing php53-xdebug
==> Downloading http://xdebug.org/files/xdebug-2.2.1.tgz
######################################################################## 100.0%
==> /usr/local/Cellar/php53/5.3.17/bin/phpize
==> ./configure --prefix=/usr/local/Cellar/php53-xdebug/2.2.1 --with-php-config=/usr/local/Cellar/php53/5.3.17/bin/php-config --enable-xdebug
==> make
==> Caveats
To finish installing xdebug for PHP 5.3:
  * /usr/local/etc/php/5.3/conf.d/ext-xdebug.ini was created,
    do not forget to remove it upon extension removal.
  * Restart your webserver.
  * Write a PHP page that calls "phpinfo();"
  * Load it in a browser and look for the info on the xdebug module.
  * If you see it, you have been successful!
==> Summary
/usr/local/Cellar/php53-xdebug/2.2.1: 4 files, 372K, built in 32 seconds

brew install php54-debug ログ

$ brew install php54-xdebug

==> Installing php54-xdebug dependency: curl
==> Downloading http://curl.haxx.se/download/curl-7.28.0.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/curl/7.28.0
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

The libcurl provided by Leopard is too old for CouchDB to use.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/curl/lib
    CPPFLAGS: -I/usr/local/opt/curl/include

==> Summary
/usr/local/Cellar/curl/7.28.0: 75 files, 1.9M, built in 3.1 minutes
==> Installing php54-xdebug dependency: mcrypt
==> Downloading http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/mcrypt/2.5.8 --mandir=/usr/local/Cellar/mcrypt/2.5.8/share/man
==> make install
/usr/local/Cellar/mcrypt/2.5.8: 10 files, 328K, built in 60 seconds
==> Installing php54-xdebug dependency: zlib
==> Downloading http://zlib.net/zlib-1.2.7.tar.gz
######################################################################## 100.0%
==> Patching
patching file configure
==> ./configure --prefix=/usr/local/Cellar/zlib/1.2.7
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/zlib/lib
    CPPFLAGS: -I/usr/local/opt/zlib/include

==> Summary
/usr/local/Cellar/zlib/1.2.7: 9 files, 384K, built in 13 seconds
==> Installing php54-xdebug dependency: php54
==> Downloading http://www.php.net/get/php-5.4.7.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php54-5.4.7
==> ./configure --prefix=/usr/local/Cellar/php54/5.4.7 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.4 --with-config-file-path=/usr/local/etc
==> make
==> make install
==> /usr/local/Cellar/php54/5.4.7/bin/pear config-set php_ini /usr/local/etc/php/5.4/php.ini
==> Caveats
For 10.5 and Apache:
    Apache needs to run in 32-bit mode. You can either force Apache to start
    in 32-bit mode or you can thin the Apache executable.

To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php5_module    /usr/local/Cellar/php54/5.4.7/libexec/apache2/libphp5.so

The php.ini file can be found in:
    /usr/local/etc/php/5.4/php.ini

✩✩✩✩ PEAR ✩✩✩✩

If pear complains about permissions, 'Fix' the default PEAR permissions and config:
    chmod -R ug+w /usr/local/Cellar/php54/5.4.7/lib/php
    pear config-set php_ini /usr/local/etc/php/5.4/php.ini

✩✩✩✩ Extensions ✩✩✩✩

If you are having issues with custom extension compiling, ensure that this php is
in your PATH:
    PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH"

PHP54 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.

✩✩✩✩ FPM ✩✩✩✩

If you have installed the formula with --with-fpm, to launch php-fpm on startup:
    * If this is your first install:
        mkdir -p ~/Library/LaunchAgents
        cp /usr/local/Cellar/php54/5.4.7/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/
        launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist

    * If this is an upgrade and you already have the homebrew-php.josegonzalez.php54.plist loaded:
        launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
        cp /usr/local/Cellar/php54/5.4.7/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/
        launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist

Mountain Lion comes with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:

  PATH="/usr/local/sbin:$PATH"

You may also need to edit the plist to use the correct "UserName".

Please note that the plist was called 'org.php-fpm.plist' in old versions
of this formula.
==> Summary
/usr/local/Cellar/php54/5.4.7: 462 files, 35M, built in 9.0 minutes
==> Installing php54-xdebug
==> Downloading http://xdebug.org/files/xdebug-2.2.1.tgz
######################################################################## 100.0%
==> /usr/local/Cellar/php54/5.4.7/bin/phpize
==> ./configure --prefix=/usr/local/Cellar/php54-xdebug/2.2.1 --with-php-config=/usr/local/Cellar/php54/5.4.7/bin/php-config --enable-xdebug
==> make
==> Caveats
To finish installing xdebug for PHP 5.4:
  * /usr/local/etc/php/5.4/conf.d/ext-xdebug.ini was created,
    do not forget to remove it upon extension removal.
  * Restart your webserver.
  * Write a PHP page that calls "phpinfo();"
  * Load it in a browser and look for the info on the xdebug module.
  * If you see it, you have been successful!
==> Summary
/usr/local/Cellar/php54-xdebug/2.2.1: 4 files, 372K, built in 29 seconds

GPLライセンスのプログラムで実行されるスクリプトのライセンスについて

以下は自身のGPLライセンスの認識の整理の為に書かれた記述で、不確実な事項を含んでいます。間違っているところがあればご指摘ください。

GNU 一般公衆利用許諾契約書 - GNU プロジェクト - フリーソフトウェア財団 (FSF)


このようなライセンス構成のアプリケーションがあると仮定します。

  • 【A】GPLライセンスのプログラム。バイナリ。
  • 【B】MITライセンスのプログラム。PHPで記述されたWebフレームワーク。
  • 【C】Webフレームワーク【B】で動作するユーザーアプリケーション(PHPで駆動)。PHPのexec関数でスクリプト【target】を実行する。|
  • 【target】【A】によって実行されるスクリプト。入力ファイルを処理して画像を出力する。

GPLライセンスのプログラムが絡んで混乱してしまったので、【C】および【target】のライセンスは何になるのか(できるのか)情報を整理してみました。

理想としては【C】も【target】もMITライセンスが適用できればいいなあ、と思っています。

プログラムの構成

【target】は以下のようにユーザーアプリケーション【C】に組み込まれています。

  • b.php(ユーザーアプリケーション【C】。Webフレームワーク【B】によって駆動。)
exec('go.sh input.cxv arg1 arg2...');
  • go.sh(共通処理用bashスクリプト)
#!/bin/bash
:
:(カレントディレクトリの制御)
:
c.m input.csv arg1 arg2...
:
:(エラー処理)
:
  • c.m(プログラム【A】によって実行されるスクリプト)
#!/usr/local/bin/octave
:
:(入力データを処理してグラフを出力)
:

FAQで関連ありそうな問答を抜粋

以下の2項目が1番近そうな問答でした

以下は単なるスクリプトとして同梱する場合とリンクして一つのバイナリにする場合の違いについて言及。

以下は【A】GPLライセンスで動作する【target】スクリプトに関する記述ではないが、プログラムをサーバー本体ごと提供する頒布形式に引っかかる問答かも。

これらの問答だけ目にすると、リンクしたバイナリではなくスクリプト(テキストファイル)として提供するならGPLにしなくてもOKっぽい。

その他プログラムもWebサービスではなく諸々のプログラムを組み込んだサーバーごと提供する方針なので*1、ソースを公開しているも同義*2なのでまあGPLでなくても大丈夫であろうと判断。

結論

ライセンス文書及びFAQを読めば読むほど迷いが生じるのですが、

  • スクリプト【target】はテキストファイルであること
  • プログラム【A】のソース本体を改変していないこと
  • プログラム【A】とリンクしてバイナリとして提供するわけではないこと

を判断基準として、GPLライセンスは適用せず、プログラム【B】と同じくMITライセンス適用することにしました。

感想

OSSって面倒くさい。ライセンス文書を読んでも『利用』と『使用』の違いがまず明確に示されていないので、スクリプト書いてプログラム(インタプリタ)に実行させて結果(画像なり数値なり)を得る行為が、OSSの『利用』なのか『使用』なのか、それがOSSライセンス条項に縛られる行為なのかそうでないのかが非常にわかりにくかったです。

特にGPLライセンスは、悪い面(ソースコード公開)ばかり強調されていると思います。OSSに馴染みのない中小企業なんかでは、触らぬ神に祟りなしで『利用』も『使用』も一律不可としてたりします。パッケージソフトみたいに『使用』に関するライセンス料金とごっちゃになっているんですよね。

OSSのライセンスを理解するのに必須の用語として

  • 『利用』:プログラムを再頒布すること(例:本を売ること)

  • 『使用』:プログラムを使ってデータを得ること(例:本を読んで知識を得ること)

があるのですが、日本語では両者に明確な違いがないのもあって、OSSライセンスの理解をより困難にしていると思います。

OSSの各種ライセンス条項が縛りを入れるのは『利用』に関する部分なのです。

このへんの誤解が個人および中小企業での商用”利用”(有償)のOSSの『利用』および『使用』促進への大きな障壁になっていると思います。

お上に於かれましては、製造業対象のものづくり補助金とか百害あって一利あるかないかの事業に金を投資するより、OSSとかソフト方面に投資して中小企業を教育したほうがより効果的な気がするんですけどね。

山中教授ノーベル賞

山中氏ノーベル賞:「命救うため前へ」愛弟子、冷静に喜び- 毎日jp(毎日新聞)

高橋先生の恩師へのひとこと。 記者(八田浩輔)のまとめ方がうまいんだと思うけど思わずニヤリ。

恩師に会ったらまず伝えたい。「この前渡した論文の原稿に早く目を通してください」

はてブでは茶化してしまいましたが、おめでとうございます。 高橋先生の工学(応用化学)から生化学への転身で大きな成功をおさめられた(現在進行形ですが)ことを、同じ応用化学系出身として誇りに思うとともにお祝い申し上げます。

世紀の発見だったが、論文発表までの約1年は、山中さんと2人で同僚にも秘密を貫いた。この分野の国際競争は激しく、数週間程度でまねをされて作れるほど簡単な方法だったからだ。高橋さんは「山中先生の下で研究を始めて残した実験ノートは1000ページ以上。その中で、あの時はたった1ページの出来事なんです」。

実験系の研究者ってあんまりFacebookやTwitterってやってない。自らの言葉や行動の端々から発表前の研究内容なんかが漏れるのを警戒してるんだろうか。

阪大医で准教授してる高校時代の同級生がそう。 大学のメールアドレスしか知らないから他の手段はないかと思ってぐぐってみたけど、研究成果以外の情報はどこにも出てこない。

山中教授の偽Twitterアカウント出てきたのを見て「こんなのに騙されるのいるのかなー」と思ってたら、いけだのぶヲ先生曰く、

相手にするなよ...。