Vagrant1.4を初めてインストールしてみました

ダウンロード

昔はgemでインストールという形だったようです。 結構検索するとその手順が出ていますが、いまはこちらからのインストールを推奨とのことです。 http://www.vagrantup.com/downloads.html 1.4.0が最新版のようです。

Vagrant-1.4.0.dmgからインストール

/Applications/Vagrantというディレクトリつくられるようです。

$ vagrant -v
Vagrant 1.4.0

BOXの取得

http://www.vagrantbox.esでURLを探そう。

まずubuntu

$ vagrant box add precise32 http://files.vagrantup.com/precise32.box
Downloading box from URL: http://files.vagrantup.com/precise32.box
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/lib/vagrant/util/which.rb:32: warning: Insecure world writable dir /Users/teru1 in PATH, mode 040777
Extracting box...ate: 769k/s, Estimated time remaining: --:--:--)
Successfully added box 'precise32' with provider 'virtualbox'!

次にcentos64

$ vagrant box add centos64 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box
Downloading box from URL: http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/lib/vagrant/util/which.rb:32: warning: Insecure world writable dir /Users/teru1 in PATH, mode 040777
Extracting box...ate: 237k/s, Estimated time remaining: --:--:--)
Successfully added box 'centos64' with provider 'virtualbox'!

基本的にBOXをダウンロードして、それをテンプレートにして、仮想環境を構築するというイメージですかね。


確認だ

$ vagrant box list
centos64  (virtualbox)
precise32 (virtualbox)


実際の場所だ

$ pwd
/Users/teru1/.vagrant.d/boxes
$ ls
total 0
drwxr-xr-x  4 teru1  staff  136 12 12 20:24 ./
drwxr-xr-x  9 teru1  staff  306 12 11 23:15 ../
drwxr-xr-x  3 teru1  staff  102 12 12 20:24 centos64/
drwxr-xr-x  3 teru1  staff  102 12 11 23:25 precise32/


仮想マシンのディレクトリ作成&初期化

$ pwd
/Users/teru1/Documents/VagrantVM
$ mkdir centOS64VM
$ ls
total 0
drwxr-xr-x   4 teru1  staff  136 12 13 20:53 ./
drwx------+ 13 teru1  staff  442 12 13 00:35 ../
drwxr-xr-x   4 teru1  staff  136 12 13 18:24 baseVM/
drwxr-xr-x   2 teru1  staff   68 12 13 20:53 centOS64VM/
$ cd centOS64VM/
$ vagrant init centos64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.


VagrantFileのある場所で起動

$ vagrant up
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/lib/vagrant/util/which.rb:32: warning: Insecure world writable dir /Users/teru1 in PATH, mode 040777
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'centos64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
GuestAdditions versions on your host (4.3.4) and guest (4.2.16) do not match.
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: ftp.tsukuba.wide.ad.jp
 * extras: ftp.tsukuba.wide.ad.jp
 * updates: centosx4.centos.org
Setting up Install Process
Package 1:make-3.81-20.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-3.el6 will be updated
--> Processing Dependency: gcc = 4.4.7-3.el6 for package: gcc-c++-4.4.7-3.el6.x86_64
---> Package gcc.x86_64 0:4.4.7-4.el6 will be an update
--> Processing Dependency: libgomp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: cpp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: libgcc >= 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64
---> Package perl.x86_64 4:5.10.1-131.el6_4 will be updated
--> Processing Dependency: perl = 4:5.10.1-131.el6_4 for package: 3:perl-version-0.77-131.el6_4.x86_64
--> Processing Dependency: perl = 4:5.10.1-131.el6_4 for package: 1:perl-Pod-Simple-3.13-131.el6_4.x86_64
--> Processing Dependency: perl = 4:5.10.1-131.el6_4 for package: 1:perl-Module-Pluggable-3.90-131.el6_4.x86_64
--> Processing Dependency: perl = 4:5.10.1-131.el6_4 for package: 4:perl-libs-5.10.1-131.el6_4.x86_64
--> Processing Dependency: perl = 4:5.10.1-131.el6_4 for package: 1:perl-Pod-Escapes-1.04-131.el6_4.x86_64
---> Package perl.x86_64 4:5.10.1-136.el6 will be an update
--> Running transaction check
---> Package cpp.x86_64 0:4.4.7-3.el6 will be updated
---> Package cpp.x86_64 0:4.4.7-4.el6 will be an update
---> Package gcc-c++.x86_64 0:4.4.7-3.el6 will be updated
---> Package gcc-c++.x86_64 0:4.4.7-4.el6 will be an update
--> Processing Dependency: libstdc++-devel = 4.4.7-4.el6 for package: gcc-c++-4.4.7-4.el6.x86_64
--> Processing Dependency: libstdc++ = 4.4.7-4.el6 for package: gcc-c++-4.4.7-4.el6.x86_64
---> Package libgcc.x86_64 0:4.4.7-3.el6 will be updated
---> Package libgcc.x86_64 0:4.4.7-4.el6 will be an update
---> Package libgomp.x86_64 0:4.4.7-3.el6 will be updated
---> Package libgomp.x86_64 0:4.4.7-4.el6 will be an update
---> Package perl-Module-Pluggable.x86_64 1:3.90-131.el6_4 will be updated
---> Package perl-Module-Pluggable.x86_64 1:3.90-136.el6 will be an update
---> Package perl-Pod-Escapes.x86_64 1:1.04-131.el6_4 will be updated
---> Package perl-Pod-Escapes.x86_64 1:1.04-136.el6 will be an update
---> Package perl-Pod-Simple.x86_64 1:3.13-131.el6_4 will be updated
---> Package perl-Pod-Simple.x86_64 1:3.13-136.el6 will be an update
---> Package perl-libs.x86_64 4:5.10.1-131.el6_4 will be updated
---> Package perl-libs.x86_64 4:5.10.1-136.el6 will be an update
---> Package perl-version.x86_64 3:0.77-131.el6_4 will be updated
---> Package perl-version.x86_64 3:0.77-136.el6 will be an update
--> Running transaction check
---> Package libstdc++.x86_64 0:4.4.7-3.el6 will be updated
---> Package libstdc++.x86_64 0:4.4.7-4.el6 will be an update
---> Package libstdc++-devel.x86_64 0:4.4.7-3.el6 will be updated
---> Package libstdc++-devel.x86_64 0:4.4.7-4.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                    Arch        Version                 Repository
                                                                           Size
================================================================================
Updating:
 gcc                        x86_64      4.4.7-4.el6             base       10 M
 perl                       x86_64      4:5.10.1-136.el6        base       10 M
Updating for dependencies:
 cpp                        x86_64      4.4.7-4.el6             base      3.7 M
 gcc-c++                    x86_64      4.4.7-4.el6             base      4.7 M
 libgcc                     x86_64      4.4.7-4.el6             base      101 k
 libgomp                    x86_64      4.4.7-4.el6             base      118 k
 libstdc++                  x86_64      4.4.7-4.el6             base      293 k
 libstdc++-devel            x86_64      4.4.7-4.el6             base      1.6 M
 perl-Module-Pluggable      x86_64      1:3.90-136.el6          base       40 k
 perl-Pod-Escapes           x86_64      1:1.04-136.el6          base       32 k
 perl-Pod-Simple            x86_64      1:3.13-136.el6          base      212 k
 perl-libs                  x86_64      4:5.10.1-136.el6        base      578 k
 perl-version               x86_64      3:0.77-136.el6          base       51 k

Transaction Summary
================================================================================
Upgrade      13 Package(s)

Total download size: 32 M
Downloading Packages:
--------------------------------------------------------------------------------
Total                                           429 kB/s |  32 MB     01:15
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : libgcc-4.4.7-4.el6.x86_64                                   1/26
  Updating   : libstdc++-4.4.7-4.el6.x86_64                                2/26
  Updating   : libstdc++-devel-4.4.7-4.el6.x86_64                          3/26
  Updating   : 1:perl-Pod-Escapes-1.04-136.el6.x86_64                      4/26
  Updating   : 4:perl-libs-5.10.1-136.el6.x86_64                           5/26
  Updating   : 3:perl-version-0.77-136.el6.x86_64                          6/26
  Updating   : 1:perl-Pod-Simple-3.13-136.el6.x86_64                       7/26
  Updating   : 1:perl-Module-Pluggable-3.90-136.el6.x86_64                 8/26
  Updating   : 4:perl-5.10.1-136.el6.x86_64                                9/26
  Updating   : libgomp-4.4.7-4.el6.x86_64                                 10/26
  Updating   : cpp-4.4.7-4.el6.x86_64                                     11/26
  Updating   : gcc-4.4.7-4.el6.x86_64                                     12/26
  Updating   : gcc-c++-4.4.7-4.el6.x86_64                                 13/26
  Cleanup    : gcc-c++-4.4.7-3.el6.x86_64                                 14/26
  Cleanup    : libstdc++-devel-4.4.7-3.el6.x86_64                         15/26
  Cleanup    : 1:perl-Pod-Escapes-1.04-131.el6_4.x86_64                   16/26
  Cleanup    : 1:perl-Pod-Simple-3.13-131.el6_4.x86_64                    17/26
  Cleanup    : 3:perl-version-0.77-131.el6_4.x86_64                       18/26
  Cleanup    : 4:perl-libs-5.10.1-131.el6_4.x86_64                        19/26
  Cleanup    : 4:perl-5.10.1-131.el6_4.x86_64                             20/26
  Cleanup    : 1:perl-Module-Pluggable-3.90-131.el6_4.x86_64              21/26
  Cleanup    : gcc-4.4.7-3.el6.x86_64                                     22/26
  Cleanup    : libstdc++-4.4.7-3.el6.x86_64                               23/26
  Cleanup    : libgcc-4.4.7-3.el6.x86_64                                  24/26
  Cleanup    : cpp-4.4.7-3.el6.x86_64                                     25/26
  Cleanup    : libgomp-4.4.7-3.el6.x86_64                                 26/26
  Verifying  : 1:perl-Module-Pluggable-3.90-136.el6.x86_64                 1/26
  Verifying  : 4:perl-5.10.1-136.el6.x86_64                                2/26
  Verifying  : 4:perl-libs-5.10.1-136.el6.x86_64                           3/26
  Verifying  : libstdc++-4.4.7-4.el6.x86_64                                4/26
  Verifying  : libstdc++-devel-4.4.7-4.el6.x86_64                          5/26
  Verifying  : cpp-4.4.7-4.el6.x86_64                                      6/26
  Verifying  : 1:perl-Pod-Simple-3.13-136.el6.x86_64                       7/26
  Verifying  : gcc-c++-4.4.7-4.el6.x86_64                                  8/26
  Verifying  : libgomp-4.4.7-4.el6.x86_64                                  9/26
  Verifying  : gcc-4.4.7-4.el6.x86_64                                     10/26
  Verifying  : 3:perl-version-0.77-136.el6.x86_64                         11/26
  Verifying  : 1:perl-Pod-Escapes-1.04-136.el6.x86_64                     12/26
  Verifying  : libgcc-4.4.7-4.el6.x86_64                                  13/26
  Verifying  : gcc-c++-4.4.7-3.el6.x86_64                                 14/26
  Verifying  : 4:perl-5.10.1-131.el6_4.x86_64                             15/26
  Verifying  : cpp-4.4.7-3.el6.x86_64                                     16/26
  Verifying  : libstdc++-4.4.7-3.el6.x86_64                               17/26
  Verifying  : 4:perl-libs-5.10.1-131.el6_4.x86_64                        18/26
  Verifying  : 1:perl-Module-Pluggable-3.90-131.el6_4.x86_64              19/26
  Verifying  : libgcc-4.4.7-3.el6.x86_64                                  20/26
  Verifying  : 3:perl-version-0.77-131.el6_4.x86_64                       21/26
  Verifying  : libstdc++-devel-4.4.7-3.el6.x86_64                         22/26
  Verifying  : gcc-4.4.7-3.el6.x86_64                                     23/26
  Verifying  : 1:perl-Pod-Escapes-1.04-131.el6_4.x86_64                   24/26
  Verifying  : 1:perl-Pod-Simple-3.13-131.el6_4.x86_64                    25/26
  Verifying  : libgomp-4.4.7-3.el6.x86_64                                 26/26

Updated:
  gcc.x86_64 0:4.4.7-4.el6             perl.x86_64 4:5.10.1-136.el6

Dependency Updated:
  cpp.x86_64 0:4.4.7-4.el6
  gcc-c++.x86_64 0:4.4.7-4.el6
  libgcc.x86_64 0:4.4.7-4.el6
  libgomp.x86_64 0:4.4.7-4.el6
  libstdc++.x86_64 0:4.4.7-4.el6
  libstdc++-devel.x86_64 0:4.4.7-4.el6
  perl-Module-Pluggable.x86_64 1:3.90-136.el6
  perl-Pod-Escapes.x86_64 1:1.04-136.el6
  perl-Pod-Simple.x86_64 1:3.13-136.el6
  perl-libs.x86_64 4:5.10.1-136.el6
  perl-version.x86_64 3:0.77-136.el6

Complete!
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Installing Virtualbox Guest Additions 4.3.4 - guest version is 4.2.16
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.4 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.2.16 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules[  OK  ]
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules[  OK  ]
Doing non-kernel setup of the Guest Additions[  OK  ]
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers[FAILED]
(Could not find the X.Org or XFree86 Window System.)
An error occurred during installation of VirtualBox Guest Additions 4.3.4. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
[default] Mounting shared folders...
[default] -- /vagrant

すごいなー
おや?なんかエラーですか?

GuestAdditions versions on your host (4.3.4) and guest (4.2.16) do not match.

とか

Installing Virtualbox Guest Additions 4.3.4 - guest version is 4.2.16

とか

↓なので、こちら参考に、VagrantFileを編集 http://blog.code-life.net/blog/2013/06/10/the-guest-additions-on-this-vm-do-not-match-the-installed-version-of-virtualbox-on-vagrant/

こちらの記事ではグローバル的なVagrantFileもなんかごニュってますが、 とりあえずよくわからんので、このcentos64VMにあるVagrantファイルを編集 以下を追加する

# set auto_update to false,  if do NOT want to check the correct additions
# version when booting this machine
config.vbguest.auto_update = true

そんで今度こそ起動

$ vagrant reload

よし、起動できたようです。


vagrantコマンドについて要約

vagrant status    状態確認
vagrant suspend     スリープ
vagrant resume  スリープ復帰
vagrant halt        終了
vagrant up      起動
vagrant reload  再起動

vagrant destroy 仮想マシン削除

仮想マシンを削除してもVagrantFileがあれば、UP起動できます。


仮想マシンへの接続

$ vagrant ssh
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/lib/vagrant/util/which.rb:32: warning: Insecure world writable dir /Users/teru1 in PATH, mode 040777
Welcome to your Vagrant-built virtual machine.
[vagrant@localhost ~]$ pwd
/home/vagrant

apacheをインストール

sudo yum -y install httpd
sudo chkconfig httpd on

apacheを起動

sudo service httpd start

iptablesは一旦停止しておく

$ sudo service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]

htmlファイルを作成

/var/www/htmlにファイルを作成

private_networkを設定

Mac環境に戻って、VagrantFileを編集 以下部分をコメントはずして

config.vm.network :private_network, ip: "192.168.33.10"

VagrantFileを編集したら再起動だそうなので

vagrant reload

だが、

エラーが出る

↓ので http://d.hatena.ne.jp/akishin999/20131213/1386929611

その通り、全く同じ現象。5,6時間迷った。ありがとうございます!
これで、起動した。

Macでブラウザから192.168.33.10にアクセス。
OK!


読んだ

ユーザ中心ウェブビジネス戦略

ユーザ中心ウェブビジネス戦略

  • 作者: 武井由紀子,三木順哉,株式会社ビービット
  • 出版社/メーカー: ソフトバンククリエイティブ
  • 発売日: 2013/05/01
  • メディア: 単行本
  • この商品を含むブログを見る

ここで重要なのはユーザをターゲティングするという考え方だ。 ウェブサイトはともすると全員を狙いたくなるメディアである。実際にサイトの運営者にターゲットユーザを尋ねると「アクセスしてきた人全 員」と回答するケースがある。すべてのお客さまを大切にしなくてはユーザ思考ではないという反論も聞かれる。もちろん、全員を相手にし、全 員に価値を提供して満足してもらうことは理想ではあるが、複雑化した社会においてのユーザ、お客様を満足させることは現実的に難しい。 ターゲットが増えれば、増えるほど、ニーズはばらつき、それら全てに対応しようとすると、結局は誰にとっても無用の総花的なウェブサイトが できあがってしまう。

よく言われますね。わかってます。なかなかね。

mavenのローカルリポジトリにmysqlのjdbcドライバを登録する

前にもやったんだけど、やっぱり忘れてたんで、メモっとく。
サイトからJDBCダウンロード

そして解凍

tar xvf /Users/teru/Downloads/mysql-connector-java-5.1.22.tar.gz

/Users/teru/Downloads/はダウンロード先のディレクトリ


できたら解凍してできたjarのあるディレクトリに移動し、以下のコマンド実行

mvn install:install-file -Dfile=mysql-connector-java-5.1.22-bin.jar -DgroupId=jp.co.suda.mysql -DartifactId=mysql -Dversion=5.1 -Dpackaging=jar
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [install:install-file] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [install:install-file {execution: default-cli}]
[INFO] Installing /Users/teru/Downloads/mysql-connector-java-5.1.22-bin.jar to /Users/teru/.m2/repository/jp/co/suda/mysql/mysql/5.1/mysql-5.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Nov 29 21:49:51 JST 2012
[INFO] Final Memory: 4M/81M
[INFO] ------------------------------------------------------------------------

これでローカルリポジトリにインストールされたので、pom.xmlに依存先として登録すれば、自動的にパスに通るわけ。


だからmysqlドライバを使用したいプロジェクトのpom.xmlタグの中のどこかに以下を追加

<dependency>
         <groupId>jp.co.suda.mysql</groupId>
         <artifactId>mysql</artifactId>
         <version>5.1</version>
</dependency>


そんで

mvn compile
mvn eclipse:eclipse

やってください。未来の自分へ。またね。

macにhomebrewでmysqlインストールメモ

ちょっとmysqlでアプリ作ってて、面倒なんでwordpress用にインストールしていたMAMPに内包されたmysqlを使ってたのですが、ちょっと設定ファイルとかの場所がよくわからないので単独でhomebrewからインストールしたんでメモっときます。自分のために。

インストール

sudo brew install mysql


インストールされたのは

/usr/local

の配下になります。


サーバスタート

mysql.server start


.bash_profileでMAMPのmysqlコマンドへのパスをコメントアウトし/usr/local/binにパスを通してこちらのmysqlを使用する。

export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH
#PATH export PATH=/Applications/MAMP/Library/bin:$PATH
export PATH="/usr/local/bin:$PATH"


mysqlコマンドを叩く

terubookAir:~ teru$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.5.27 Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 


サーバストップ

mysql.server stop 


O.K ! ねる!

読んだ

大きく、しぶとく、考え抜く。―原田泳幸の実践経営論

大きく、しぶとく、考え抜く。―原田泳幸の実践経営論

上司が部下を評価するだけで終わってしまいがちな今の仕組みも、若い社員をコーチングして育てることを最優先にした中身に変えたいと思っています。大事なことは若い世代の創造力を高めることです。過去の成功体験を基準とした視点からは新しいものは生み出せない。極端に言うと、社内の常識ではやってはいけないことが、社外では通用して、ビジネスとして成功することもあります。

評価するだけでおわってしまいがちですか、評価すらないよりはマシだけれど、もっともですね。コーチングできないとか情けない事態にだけはなったらいけない。

あなたが何を勉強してきたか、何をやってきたかは関係ない。今後何ができるかが問題で、その鍵はあなた自身のラーニングスキルにある。入社して何かこれまでの経験を活かしてお役に立ちたいなどと絶対に思わないでほしい。お役に立ちたいと思った瞬間、迷惑だ。今までと同じことをやられるとうちの企業の強さはなくなるから、うちの企業の強さを学ぶまでは一切役に立とうなどと思わないでほしい

即戦力大歓迎とか他者依存にも程がある。そんな会社が多い中。この発言です。

とにかくスピードを優先しました。戦略も組織もどれが正しくて、どれが間違いというのはありません。どれを信じて選択するかという話でしょう。野球と同じように、どんな素晴らしいピッチャーでも流れが変わったら交代しなければいけません。会社の改革では、まずリーダーシップを持って、会社の空気を変える意志や情熱を示すことが重要です。

スピードという言葉が嫌いな経営者の方って多いのではないでしょうか? でも、本当にナッテカラじゃ間に合わないと思いますよ。リーダーシップない場合はリーダーやっちゃいけないと思うんですよね。マネージャーはリーダーでもなければダメでしょう?


最近マクドナルドの業績が少し悪くなったくらいで、方程式が崩れたとかやってますが、そんなこといってる人に限って方程式自体が存在しなかったりするのだからこまってしまいますね。

結城さんがJava本が当たる個人イベントをやってらっしゃるようなので応募してみようと思う

http://d.hatena.ne.jp/hyuki/20121109/jb

はじめてJavaで、というかプログラミング言語で「HelloWorld」とかやった時の机の上にあったのがこの本の初版でした。僕の手元には今はないので、応募してみようと思います。結城さんのこのシリーズはPerlデザパタリファクタリングも持ってます。あーなつかしいなーという感じ。当たったりして!

結構素晴らしい本だ

カンフーマック ―猛獣を飼いならす310の技

カンフーマック ―猛獣を飼いならす310の技


たとえば、クイックルックでPDFとかテキストを含むファイルを開いた時にそのテキストをコピーすることができる技、とか書いてあるんです。知ってました? 私は知りませんでした。


以下のコマンド叩いたあとで、クイックルックでなんらかのテキストを含むファイルを開いてみてください。文章がコピペできます。

defaults write com.apple.finder QLEnableTextSelection -bool TRUE; killall Finder

元にもどすには以下

defaults delete com.apple.finder QLEnableTextSelection; killall Finder


MacOS関連の本とかって結構いろいろ出ますけれども、「そんなのだれでも知ってるでしょう」みたいなことばかりが書かれている本が大多数である中、さすがオライリーといった感じの素晴らしい書籍です。日本語版では翻訳者の武舎広幸さんの配慮により10.8での対応状況もきちんとものせられていて、さらに「この機能は10.9でもおそらく有効ではないかな?」という予想まで乗っけてくれてます。ありがたいですね。そしてオライリーはいい本出しますね。さすがですね。