![Software Design (ソフトウエア デザイン) 2006年 10月号 [雑誌] Software Design (ソフトウエア デザイン) 2006年 10月号 [雑誌]](http://ecx.images-amazon.com/images/I/51QYVXZBZSL._SL160_.jpg)
Software Design (ソフトウエア デザイン) 2006年 10月号 [雑誌]
- 出版社/メーカー: 技術評論社
- 発売日: 2006/09/16
- メディア: 雑誌
- 購入: 3人 クリック: 43回
- この商品を含むブログ (17件) を見る
Software Design 10月号に載っていた「Plagger Server で作る盗難対策ソリューション」を試してみた。Plagger ServerとMacbook proの加速度センサーを利用して、
- PC本体に振動が加えられると
- モーションセンサーが反応して
- iSightが写真を撮影
- CDトレイをイジェクト
- 写真をメールに添付して送信
- スピーチ機能で音声を発する
- OSのシャットダウン
ということをやってくれる。これを防犯用機能として利用するというステキにアホらしいHack。で、雑誌のを丸ごと写した以下のレシピでやってみたんですけど、うまく動きませんでした。なんでやろ。部屋で一人、Macbook を振り回してデバッグするのはなかなか悲しかったですよ。
plugins:
- module: Server::Engine::PreFork
- module: CustomFeed::Debug
config:
title: 'Goruaaaaa'
link: 'http://localhost/'
entry:
- title: "2 pow she master"
link: 'http://localhost/1'
body: 'you got mail'
- module: Server::Protocol::PLAGGER
config:
port: 9901
- module: Server::Push::AppleMotionSensor
config:
plagger_host: 127.0.0.1
plagger_port: 9901
amstracker: /Users/hiroya/bin/AMSTracker
adjust: 10
- module: Filter::iSightEnclosure
config:
inline: 0
isightcapture: /Users/hiroya/bin/isightcapture
- module: Notify::Eject
- module: Publish::Gmail
config:
attach_enclosures: 1
mailto: my-mail-to@hogehoge.com
mailfrom: my-mail-from@hogehoge.com
mailroute:
via: smtp
host: localhost
- module: Publish::Speech
- module: Publish::Pipe
config:
command: shutdown -h now注)事前に以下のソフトウェアをダウンロードすること
- isightcapture http://www.intergalactic.de/hacks.html
- AMSTracker http://www.osxbook.com/software/sms/amstracker/
- postfixを動かしておくこと
ちなみにターミナルへの出力は
hiroya ~/wkdir/plagger $ ./plaggerd -c config-sensor.yaml Plagger [info] plugin Plagger::Plugin::Server::Engine::PreFork loaded. Plagger [info] plugin Plagger::Plugin::CustomFeed::Debug loaded. Plagger [info] plugin Plagger::Plugin::Server::Protocol::PLAGGER loaded. Plagger [info] plugin Plagger::Plugin::Server::Push::AppleMotionSensor loaded. Plagger [info] plugin Plagger::Plugin::Filter::iSightEnclosure loaded. Plagger [info] plugin Plagger::Plugin::Notify::Eject loaded. Plagger [info] plugin Plagger::Plugin::Publish::Gmail loaded. Plagger [info] plugin Plagger::Plugin::Publish::Speech loaded. Plagger [info] plugin Plagger::Plugin::Publish::Pipe loaded. Plagger::Plugin::Server::Engine::PreFork [debug] load. Plagger::Plugin::Server::Push [debug] [4627] start to pid 4628 Plagger::Plugin::Server::Engine::PreFork [debug] start. Plagger::Plugin::Server::Engine::PreFork [debug] configure_hook. Plagger::Plugin::Server::Engine::PreFork [2] 2006/09/26-22:13:01 Plagger::Plugin::Server::Engine::PreFork (type Plagger::Plugin::Server::Engine) starting! pid(4627) Plagger::Plugin::Server::Engine::PreFork [2] Binding to TCP port 9901 on host * Plagger::Plugin::Server::Engine::PreFork [2] Setting gid to "501 501 80 79 81 501" Plagger::Plugin::Server::Engine::PreFork [3] Setting up serialization via flock Plagger::Plugin::Server::Engine::PreFork [3] Beginning prefork (5 processes) Plagger::Plugin::Server::Engine::PreFork [3] Starting "5" children Plagger::Plugin::Server::Engine::PreFork [4] Child Preforked (4630) Plagger::Plugin::Server::Engine::PreFork [4] Child Preforked (4631) Plagger::Plugin::Server::Engine::PreFork [4] Child Preforked (4632) Plagger::Plugin::Server::Engine::PreFork [4] Child Preforked (4633) Plagger::Plugin::Server::Engine::PreFork [4] Child Preforked (4634) Plagger::Plugin::Server::Engine::PreFork [4] Parent ready for children. Plagger::Plugin::Server::Engine::PreFork [3] 2006/09/26-22:13:04 CONNECT TCP Peer: "127.0.0.1:61791" Local: "127.0.0.1:9901" Plagger::Plugin::Server::Engine::PreFork [debug] process_request. Plagger::Plugin::Server::Engine::PreFork [debug] output. Plagger::Plugin::Server::Engine::PreFork [3] 2006/09/26-22:13:18 CONNECT TCP Peer: "127.0.0.1:61792" Local: "127.0.0.1:9901" Plagger::Plugin::Server::Engine::PreFork [debug] process_request. Plagger::Plugin::Server::Engine::PreFork [debug] output. Plagger::Plugin::Server::Engine::PreFork [3] 2006/09/26-22:13:23 CONNECT TCP Peer: "127.0.0.1:61793" Local: "127.0.0.1:9901" 以下同じメッセージが続く
一応サーバーは待機して動いてるようですが。