Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Part1 
䜏䜣䛺䛷䜹䞁䝍䞁䟿 
Eject䝝䞁䝈䜸䞁 
Eject䝁䝬䞁䝗䝴䞊䝄䞊఍ 
䛒䛳䛝䛓 
( 
id:Akkieso3 
) 
2014/9/27 
ฟᙇ䛣䛾䜉䜣䠖⊧䜹䝣䜵×Eject䝴䞊䝄䞊఍䚸 
ወ㊧䛾䝁䝷䝪䝝䞁䝈䜸䞁䟿Con...
Eject䝁䝬䞁䝗䝴䞊䝄䞊఍䛸䛿 
• CD-­‐ROM䝗䝷䜲䝤䛾䝖䝺䜲㛤㛢䜢฼⏝䛧䛶 
• 䝖䝺䜲䛻Ⰽ䜣䛺䛣䛸䜢䛥䛫䜛ᕤస䜢స䜚 
• 䝸䝰䞊䝖䜔䝍䜲䝬䞊➼䛷ᐇ⾜䛩䜛䛣䛸䛷 
• QoL䛾ྥୖ䜢ヨ䜏䜛䝴䞊䝄䞊䛾㞟䛔䛷䛩 
• ୺䛻䜸䞊䝥䞁䝋䞊...
䝴䞊䝄䞊఍䛾䜰䜽䝔䜱䝡䝔䜱 
• ⌧ᅾ⣙50ྡ(MLཧຍேᩘ) 
• Google 
Groups䜈䛾ධ఍䛚ᚅ䛱䛧䛶䛔䜎䛩 
• OSC➼䛻ᒎ♧ཧຍ䛩䜛䝯䞁䝞䞊3ே(⚾䜢ྵ䜐) 
• ௒ᚋ䛾ฟᒎணᐃ 
– OSC2014 
Tokyo/Fall...
䝖䝺䜲䛻Ⰽ䜣䛺䛣䛸䜢䛥䛫䜛ᕤస 
• 䝝䝮䝇䝍䞊䛻䜶䝃䜢䛒䛢䜛 
• 䜶䜰䝁䞁䛾㟁※䜢᧯స䛩䜛 
• AC㟁※䜢᧯స䛩䜛 
• 㝖ኪ䛾㚝䜢䛴䛟 
– ཤᖺ䜒䜔䜚䜎䛧䛯 
㻠
VPS䛷Eject䜢䛩䜛䛸䛹䛖䛺䜛䠛 
• ≀⌮ⓗ䛻䛿ఱ䜒䛚䛣䜙䛺䛔 
• VPS䛿௬᝿䝬䝅䞁䛰䛛䜙…… 
– ConoHa䛿KVM䝝䜲䝟䞊䝞䜲䝄䛷ື䛔䛶䛔䜛 
• ௬᝿䝬䝅䞁䛻䝯䝕䜱䜰䛜䝬䜴䞁䝖䛥䜜䛶䛔䛯ሙ 
ྜ䛿௬᝿ⓗ䛻Eject䠄unmo...
VPS䛛䜙Eject䛩䜛฼Ⅼ 
• ⮬Ꮿ䛷Web䝃䞊䝞䞊䜢බ㛤䛧䛺䛟䛶䜒Ⰻ䛔 
• 䝥䝻䝞䜲䝎䛛䜙ືⓗ䛻๭䜚ᙜ䛶䜙䜜䜛䜾䝻䞊 
䝞䝹IP䜰䝗䝺䝇䜢Ẽ䛻䛩䜛ᚲせ䛜䛺䛟䛺䜛 
• 䝫䞊䝖㛤ᨺ䛺䛹䛾ᡭ㛫䛜䛺䛟䛺䜛 
• 䝉䜻䝳䝸䝔䜱䝸䝇䜽䛾పῶ 
㻢
௙⤌䜏䜢⪃䛘䛶䜏䜘䛖 
• VPS䛻Web 
API䜢⏝ព 
• 䝴䞊䝄䞊䛜VPS䛾Web䛻䜰䜽䝉䝇䛧䛶䝪䝍䞁䜢 
ᢲ䛩䛸API䛜Ejectྍ䛾≧ែ䜢㏉䛩䜘䛖䛻䛺䜛 
• 㐲㝸ᆅ䛻䛔䜛䝬䝅䞁䛜ᐃᮇⓗ䛻API䛻䜰䜽䝉 
䝇䛧䛶䚸Ejectྍ䛾≧ែ...
Twier䜢ά⏝䛧䛶䜒䛷䛝䜛 
• ᑓ⏝Twier䜰䜹䜴䞁䝖䜢⏝ព 
• 䝴䞊䝄䞊䛜ᑓ⏝䜰䜹䜴䞁䝖䛻䝯䞁䝅䝵䞁䜢㏦䜛 
• 㐲㝸ᆅ䛻䛔䜛䝬䝅䞁䛜䝇䝖䝸䞊䝭䞁䜾API䛻 
䜘䛳䛶䝯䞁䝅䝵䞁䜢ཷಙ䛧䛶䚸Eject䜢ᐇ⾜ 
• 䜅䛑䜌Eject( 
...
⏝ព䛩䜛䜒䛾 
• ConoHa 
VPS 
– 䜏䛺䛥䜣CentOS 
6.5䛿⏝ព䛧䜎䛧䛯䠛䘘 
՞ਊ 
՞)䘘 
• Raspberry 
Pi 
– 䜒䛧䛟䛿ᖖ㥔䛥䛫䜙䜜䜛㐺ᙜ䛺䝬䝅䞁 
• CD-­‐ROM䝗䝷䜲䝤 
• IDE(SA...
Eject⎔ቃ䛾⏝ព 
1. ConoHa 
VPSୖ䛻Web 
API䝇䜽䝸䝥䝖䜢タ⨨ 
2. Raspberry 
Pi䛾⏝ព 
1. OS䜲䞁䝇䝖䞊䝹(タᐃ῭) 
2. eject䛸php5-­‐cli䜢䜲䞁䝇䝖䞊䝹(タᐃ῭) 
3. 䝫...
[₇⩦]ConoHa 
VPS䛾⎔ቃస䜚 
• Apache䛚䜘䜃PHP5䜢䜲䞁䝇䝖䞊䝹 
– yum 
install 
-­‐y 
hpd 
php 
• ௨ୗ䛾䝁䝬䞁䝗䜢ᐇ⾜䛧䛶䝣䜯䜲䜰䜴䜷䞊䝹タ 
ᐃ䜢⾜䛖 
# 
iptables 
...
[₇⩦]ConoHa 
VPS䛾⎔ቃస䜚 
• ௨ୗ䛾URL䛛䜙PHP䝇䜽䝸䝥䝖䜢ྲྀᚓ 
– hp://eject.kokuda.org/slides/140927handson.tgz 
• /var/www/html௨ୗ䛻䝣䜯䜲䝹䜢ᒎ㛤 
...
remouiiin.php 
䛻䛴䛔䛶 
• Web䝨䞊䝆䛷䝪䝍䞁䜢ᢲ䛩䛸䜹䜴䞁䝖䜰䝑䝥䛩 
䜛䛰䛡䛾䝇䜽䝸䝥䝖 
• GET䝟䝷䝯䞊䝍䛻䝟䝇䝽䞊䝗䜢䛴䛡䜛䛸䜹䜴䞁 
䝖䜢ྲྀᚓ䠃䝸䝉䝑䝖䛷䛝䜛 
– ᐇ㝿䛿POST䛸䛛䛾䜋䛖䛜ᮃ䜎䛧䛔䛡䛹௒ᅇ䛿...
[₇⩦]Raspberry 
Pi䛾⎔ቃస䜚(1) 
• Raspberry 
Pi䛻CD-­‐ROM䝗䝷䜲䝤䜢᥋⥆䛩䜛 
• eject䝁䝬䞁䝗䜢ᐇ⾜䛧䛶ືస䜢☜ㄆ䛩䜛 
• Raspberry 
Pi䛾㟁※䜢ධ䜜䚸SSH᥋⥆䛩䜛 
– IP...
ejepoll.php 
䈜 /boot䛿FAT䝣䜷䞊䝬䝑䝖䛾䛯䜑root䝴䞊䝄䞊ᶒ㝈䛷⦅㞟䛩䜛 
?php 
$password 
= 
md5(uiiin); 
$addr 
= 
'VPSのIP'; 
$count 
= 
file_ge...
[₇⩦]䜒䛧SSH᥋⥆䛷䛝䛺䛔᫬䛿 
• MicroSD䜹䞊䝗䜢ྲྀ䜚ฟ䛧䛶䚸ᡭඖ䛾PC䛻ᕪ䛧 
㎸䜐 
• /boot䛜䝬䜴䞁䝖䛥䜜䜛䛾䛷䚸ejepoll.php䜢䜶 
䝕䜱䝍䞊䛷㛤䛔䛶⦅㞟䛩䜛 
䠻ேேேேே䠻 
䠚䚷䝏䞊䝖䚷䠘 
䢟^Y^Y...
Raspberry 
Pi䛾⎔ቃస䜚(2) 
• crontab 
–e䜢ᐇ⾜䛧䛶䚸௨ୗ䛾䛸䛚䜚グ㏙ 
䠄10⛊䛤䛸䛻remouiiin.php䛾䜹䜴䞁䝖䜢☜ㄆ䛩 
䜛䠅 
* 
* 
* 
* 
* 
/usr/bin/php5 
/home...
[₇⩦]ືస䜢☜ㄆ䛩䜛 
• 䝤䝷䜴䝄䛛䜙VPS䛻䜰䜽䝉䝇䛧䛶䚸䛂䝸䝰䞊䝖Eject 
䜢ᐇ⾜䛃䝪䝍䞁䜢ᢲ䛩 
• 10⛊๓ᚋ䛷Eject䛥䜜䜜䜀ᡂຌ 
• Eject䛥䜜䛺䛔ሙྜ䛿௨ୗ䛾Ⅼ䜢☜ㄆ 
– 䝗䝷䜲䝤䛜ṇ䛧䛟᥋⥆䛥䜜䛶䛔䜛䛛 
䠄䝗...
䜎䛸䜑 
• VPS䛷䜒Eject䛿䛷䛝䛯 
• remouiiin䛜㏉䛩್䜢ኚ䛘䛯䜚䚸eject䝁䝬䞁䝗 
䜈䛾䜶䜲䝸䜰䝇䛻䛩䜜䜀䜒䛳䛸䛭䜜䛳䜍䛟䛷䛝 
䜛䛸ᛮ䜟䜜䜛 
• Ẽ䜢䛴䛡䜛䜉䛝䛿Eject䛿ᡭẁ䛷䛒䜚┠ⓗ䛷䛿 
䛺䛔䛣䛸 
– 䛣...
Part2 
ConoHa㐃ᦠ䛾⊧䜎䛳䛧 
䛠䜙⤥㣵Eject䝅䝇䝔䝮 
Eject䝁䝬䞁䝗䝴䞊䝄䞊఍ 
䛒䛳䛝䛓 
( 
id:Akkieso3 
) 
2014/9/27 
ฟᙇ䛣䛾䜉䜣䠖⊧䜹䝣䜵×Eject䝴䞊䝄䞊఍䚸 
ወ㊧䛾䝁䝷䝪䝝䞁...
䝖䝺䜲㛤㛢䛾㐠ື䜢ά⏝䛧䜘䛖 
• CD-­‐ROM䝗䝷䜲䝤䛿Eject䝁䝬䞁䝗䛻䜘䛳䛶䝖䝺䜲 
䛾㛤㛢㐠ື䜢ᚓ䜛䛣䛸䛜䛷䛝䜛 
– Eject䛩䜛䠙䝖䝺䜲䛷ᢲ䛩 
– Load䛩䜛䠙䝖䝺䜲䛷ᘬ䛟 
• ᇶᮏⓗ䛻䛿䝖䝺䜲䛷ᢲ䛩䛸䛝䛾ື䛝䜢౑䛖䛣...
⤥㣵䛾౛ 
• 䝝䝮䝇䝍䞊䛾⤥㣵 
– ⚾䛜㛤Ⓨ䛧䛯ึ䜑䛶䛾Eject䝁䝬䞁䝗ᕤస 
– ⌧ᅾ䜒ฟᙇ䛾᫬䛺䛹䛻౑⏝ 
• 䝖䝺䜲䛷㣵䜢ᢲ䛧䛶ୗ䛻ⴠ䛸䛩䝟䝍䞊䞁 
㻞㻞
⊧䜈䛾⤥㣵 
• ᾏእ䛻஦౛䛒䜚(2006ᖺ䟿) 
– hp://www.leeholmes.com/blog/2006/08/ 
22/diy-­‐cat-­‐feeder-­‐and-­‐water-­‐dispenser/ 
• 䝺䝞䞊䜢...
⏝ព䛩䜛䜒䛾 
• 㣵䜢ධ䜜䜛⟽䠄∵ங䝟䝑䜽䛺䛹䠅 
• ㍯䝂䝮ᩘᮏ 
• ཌ⣬䛛䝎䞁䝪䞊䝹∦ 
• 䛾䜚䛛䝔䞊䝥 
• 䝝䝃䝭䞉䜹䝑䝍䞊 
• ᅵྎ䛾⟽ 
㻞㻠
⤥㣵⿦⨨䛾సᡂ 
• ⟽䛾ഃ㠃䛾ୗ䛾᪉䜢ୗ䞉ᕥ䞉ྑ䛾3᪉ྥ䛻ษ 
䜚䛣䜏䜢ධ䜜䜛 
• ୗ䛾㒊ศ䛻䝺䝞䞊䜢ྲྀ䜚௜䛡䜛 
• ษ䜚㎸䜏䛾ୖ䛛䜙1/3 
䛟䜙䛔䛾㒊ศ䛻㍯䝂䝮 
䜢ྲྀ䜚௜䛡䜛 
• ᅵྎ䜢⏝ព䛧䛶䚸䜔䜔 
ᩳ䜑䛻ྲྀ䜚௜䛡䜛 
䠄ヨస...
[₇⩦]䜔䛳䛶䜏䜘䛖ᨵⰋⅬ 
• ᮏ᪥䛿䜹䝣䜵ෆ䛷ᕤస䛜䛷䛝䛺䛔䛾䛷䚸᏶ᡂ 
ရ䜢䛔䛟䛴䛛⏝ព 
• Part1䛷స䛳䛯Eject⎔ቃ䛻タ⨨䛧䛶䚸㣵䜢䛒䛢 
䛶䜏䜘䛖 
• ᾏእ䛾౛䛾䜘䛖䛻䚸ẁ䝪䞊䝹䛷䜹䝞䞊䜢䛩䜛 
䛸䚸䜘䜚䛭䜜䜙䛧䛔ぢ䛯┠䛻...
䜰䞁䜿䞊䝖䛻䛤༠ຊ䛟䛰䛥䛔 
• ฟᙇ䛣䛾䜉䜣䠖⊧䜹䝣䜵×Eject䝴䞊䝄䞊఍䚸ወ 
㊧䛾䝁䝷䝪䝝䞁䝈䜸䞁䟿䜰䞁䜿䞊䝖䝣䜷䞊䝮 
• hps://www.conoha.jp/survey/3495.html 
㻞㻣
Upcoming SlideShare
Loading in …5
×

みんなでカンタン!Ejectハンズオン/ConoHa連携の猫まっしぐら給餌Ejectシステム

2,765 views

Published on

「出張このべん:猫カフェ×Ejectユーザー会、奇跡のコラボハンズオン!ConoHa byGMO」にて発表
http://conoha.doorkeeper.jp/events/14471

Published in: Engineering
  • Be the first to comment

みんなでカンタン!Ejectハンズオン/ConoHa連携の猫まっしぐら給餌Ejectシステム

  1. 1. Part1 䜏䜣䛺䛷䜹䞁䝍䞁䟿 Eject䝝䞁䝈䜸䞁 Eject䝁䝬䞁䝗䝴䞊䝄䞊఍ 䛒䛳䛝䛓 ( id:Akkieso3 ) 2014/9/27 ฟᙇ䛣䛾䜉䜣䠖⊧䜹䝣䜵×Eject䝴䞊䝄䞊఍䚸 ወ㊧䛾䝁䝷䝪䝝䞁䝈䜸䞁䟿ConoHa by GMO 㻝
  2. 2. Eject䝁䝬䞁䝗䝴䞊䝄䞊఍䛸䛿 • CD-­‐ROM䝗䝷䜲䝤䛾䝖䝺䜲㛤㛢䜢฼⏝䛧䛶 • 䝖䝺䜲䛻Ⰽ䜣䛺䛣䛸䜢䛥䛫䜛ᕤస䜢స䜚 • 䝸䝰䞊䝖䜔䝍䜲䝬䞊➼䛷ᐇ⾜䛩䜛䛣䛸䛷 • QoL䛾ྥୖ䜢ヨ䜏䜛䝴䞊䝄䞊䛾㞟䛔䛷䛩 • ୺䛻䜸䞊䝥䞁䝋䞊䝇䜹䞁䝣䜯䝺䞁䝇䛷άື • [Eject䚷䚷䚷䚷] [᳨⣴] 㻞
  3. 3. 䝴䞊䝄䞊఍䛾䜰䜽䝔䜱䝡䝔䜱 • ⌧ᅾ⣙50ྡ(MLཧຍேᩘ) • Google Groups䜈䛾ධ఍䛚ᚅ䛱䛧䛶䛔䜎䛩 • OSC➼䛻ᒎ♧ཧຍ䛩䜛䝯䞁䝞䞊3ே(⚾䜢ྵ䜐) • ௒ᚋ䛾ฟᒎணᐃ – OSC2014 Tokyo/Fall(10/18-­‐19) • OSCึ45ศ䝉䝭䝘䞊 㻟
  4. 4. 䝖䝺䜲䛻Ⰽ䜣䛺䛣䛸䜢䛥䛫䜛ᕤస • 䝝䝮䝇䝍䞊䛻䜶䝃䜢䛒䛢䜛 • 䜶䜰䝁䞁䛾㟁※䜢᧯స䛩䜛 • AC㟁※䜢᧯స䛩䜛 • 㝖ኪ䛾㚝䜢䛴䛟 – ཤᖺ䜒䜔䜚䜎䛧䛯 㻠
  5. 5. VPS䛷Eject䜢䛩䜛䛸䛹䛖䛺䜛䠛 • ≀⌮ⓗ䛻䛿ఱ䜒䛚䛣䜙䛺䛔 • VPS䛿௬᝿䝬䝅䞁䛰䛛䜙…… – ConoHa䛿KVM䝝䜲䝟䞊䝞䜲䝄䛷ື䛔䛶䛔䜛 • ௬᝿䝬䝅䞁䛻䝯䝕䜱䜰䛜䝬䜴䞁䝖䛥䜜䛶䛔䛯ሙ ྜ䛿௬᝿ⓗ䛻Eject䠄unmount䠅䛥䜜䜛 • ௒᪥䛾䝝䞁䝈䜸䞁䛷䛿䚸VPS䛛䜙ᡭඖ䛾CD-­‐ ROM䝗䝷䜲䝤䜢Eject䛩䜛 㻡
  6. 6. VPS䛛䜙Eject䛩䜛฼Ⅼ • ⮬Ꮿ䛷Web䝃䞊䝞䞊䜢බ㛤䛧䛺䛟䛶䜒Ⰻ䛔 • 䝥䝻䝞䜲䝎䛛䜙ືⓗ䛻๭䜚ᙜ䛶䜙䜜䜛䜾䝻䞊 䝞䝹IP䜰䝗䝺䝇䜢Ẽ䛻䛩䜛ᚲせ䛜䛺䛟䛺䜛 • 䝫䞊䝖㛤ᨺ䛺䛹䛾ᡭ㛫䛜䛺䛟䛺䜛 • 䝉䜻䝳䝸䝔䜱䝸䝇䜽䛾పῶ 㻢
  7. 7. ௙⤌䜏䜢⪃䛘䛶䜏䜘䛖 • VPS䛻Web API䜢⏝ព • 䝴䞊䝄䞊䛜VPS䛾Web䛻䜰䜽䝉䝇䛧䛶䝪䝍䞁䜢 ᢲ䛩䛸API䛜Ejectྍ䛾≧ែ䜢㏉䛩䜘䛖䛻䛺䜛 • 㐲㝸ᆅ䛻䛔䜛䝬䝅䞁䛜ᐃᮇⓗ䛻API䛻䜰䜽䝉 䝇䛧䛶䚸Ejectྍ䛾≧ែ䛰䛳䛯䜙Eject䜢ᐇ⾜ ConoHa VPS (1)Web⏬㠃䛛䜙 䚷䚷Ejectᐇ⾜ (2)Eject䝣䝷䜾䜢ྲྀᚓ 䚷䚷(䝫䞊䝸䞁䜾) (3)Eject 㻣
  8. 8. Twier䜢ά⏝䛧䛶䜒䛷䛝䜛 • ᑓ⏝Twier䜰䜹䜴䞁䝖䜢⏝ព • 䝴䞊䝄䞊䛜ᑓ⏝䜰䜹䜴䞁䝖䛻䝯䞁䝅䝵䞁䜢㏦䜛 • 㐲㝸ᆅ䛻䛔䜛䝬䝅䞁䛜䝇䝖䝸䞊䝭䞁䜾API䛻 䜘䛳䛶䝯䞁䝅䝵䞁䜢ཷಙ䛧䛶䚸Eject䜢ᐇ⾜ • 䜅䛑䜌Eject( hp://j.mp/faveject )䜢ཧ↷ Twier (1)Eject⏝Twitter 䚷䜰䜹䜴䞁䝖䛻䝯䞁䝅䝵䞁 (2)䝇䝖䝸䞊䝭䞁䜾API䛷 䚷䚷䝯䞁䝅䝵䞁䜢ཷಙ (3)Eject 㻤
  9. 9. ⏝ព䛩䜛䜒䛾 • ConoHa VPS – 䜏䛺䛥䜣CentOS 6.5䛿⏝ព䛧䜎䛧䛯䠛䘘 ՞ਊ ՞)䘘 • Raspberry Pi – 䜒䛧䛟䛿ᖖ㥔䛥䛫䜙䜜䜛㐺ᙜ䛺䝬䝅䞁 • CD-­‐ROM䝗䝷䜲䝤 • IDE(SATA)-­‐USBኚ᥮䜿䞊䝤䝹 • Web API䛾௙⤌䜏 㻥
  10. 10. Eject⎔ቃ䛾⏝ព 1. ConoHa VPSୖ䛻Web API䝇䜽䝸䝥䝖䜢タ⨨ 2. Raspberry Pi䛾⏝ព 1. OS䜲䞁䝇䝖䞊䝹(タᐃ῭) 2. eject䛸php5-­‐cli䜢䜲䞁䝇䝖䞊䝹(タᐃ῭) 3. 䝫䞊䝸䞁䜾⏝PHP䝇䜽䝸䝥䝖䜢タ⨨䛧䛶ConoHa VPS䛾IP䜰䝗䝺䝇䜢タᐃ 4. crontab䛾グ㏙ 3. Eject䛾䝔䝇䝖 㻝㻜
  11. 11. [₇⩦]ConoHa VPS䛾⎔ቃస䜚 • Apache䛚䜘䜃PHP5䜢䜲䞁䝇䝖䞊䝹 – yum install -­‐y hpd php • ௨ୗ䛾䝁䝬䞁䝗䜢ᐇ⾜䛧䛶䝣䜯䜲䜰䜴䜷䞊䝹タ ᐃ䜢⾜䛖 # iptables –I INPUT –p tcp –dport 80 –j ACCEPT # service iptables save # service iptables restart 㻝㻝
  12. 12. [₇⩦]ConoHa VPS䛾⎔ቃస䜚 • ௨ୗ䛾URL䛛䜙PHP䝇䜽䝸䝥䝖䜢ྲྀᚓ – hp://eject.kokuda.org/slides/140927handson.tgz • /var/www/html௨ୗ䛻䝣䜯䜲䝹䜢ᒎ㛤 • remouiiin.php䜢㛤䛔䛶䝟䝇䝽䞊䝗䜢タᐃ 䠄௵ព䠅 • hp://VPS䛾IP/remouiiin.php 䜢㛤䛟 㻝㻞
  13. 13. remouiiin.php 䛻䛴䛔䛶 • Web䝨䞊䝆䛷䝪䝍䞁䜢ᢲ䛩䛸䜹䜴䞁䝖䜰䝑䝥䛩 䜛䛰䛡䛾䝇䜽䝸䝥䝖 • GET䝟䝷䝯䞊䝍䛻䝟䝇䝽䞊䝗䜢䛴䛡䜛䛸䜹䜴䞁 䝖䜢ྲྀᚓ䠃䝸䝉䝑䝖䛷䛝䜛 – ᐇ㝿䛿POST䛸䛛䛾䜋䛖䛜ᮃ䜎䛧䛔䛡䛹௒ᅇ䛿䝔 䝇䝖⏝䛺䛾䛷␎ • 䝋䞊䝇䝁䞊䝗䛿ู⣬ཧ↷ 㻝㻟
  14. 14. [₇⩦]Raspberry Pi䛾⎔ቃస䜚(1) • Raspberry Pi䛻CD-­‐ROM䝗䝷䜲䝤䜢᥋⥆䛩䜛 • eject䝁䝬䞁䝗䜢ᐇ⾜䛧䛶ືస䜢☜ㄆ䛩䜛 • Raspberry Pi䛾㟁※䜢ධ䜜䚸SSH᥋⥆䛩䜛 – IP䜰䝗䝺䝇: 10.0.10.(䜅䛫䜣䛾␒ྕ) – 䝴䞊䝄䞊ྡ: pi – 䝟䝇䝽䞊䝗: ejectuiiin • /boot/ejepoll.php䜢㛤䛝௨ୗ䛾್䜢タᐃ – ConoHa VPS䛾IP䜰䝗䝺䝇 – 䝟䝇䝽䞊䝗䠄௵ព䠅 㻝㻠
  15. 15. ejepoll.php 䈜 /boot䛿FAT䝣䜷䞊䝬䝑䝖䛾䛯䜑root䝴䞊䝄䞊ᶒ㝈䛷⦅㞟䛩䜛 ?php $password = md5(uiiin); $addr = 'VPSのIP'; $count = file_get_contents( 'http://'.$addr.'/remouiiin.php?remoget='. $password ); if (intval($count) 0) { exec('/usr/bin/eject -­‐T'); } ? 㻝㻡
  16. 16. [₇⩦]䜒䛧SSH᥋⥆䛷䛝䛺䛔᫬䛿 • MicroSD䜹䞊䝗䜢ྲྀ䜚ฟ䛧䛶䚸ᡭඖ䛾PC䛻ᕪ䛧 ㎸䜐 • /boot䛜䝬䜴䞁䝖䛥䜜䜛䛾䛷䚸ejepoll.php䜢䜶 䝕䜱䝍䞊䛷㛤䛔䛶⦅㞟䛩䜛 䠻ேேேேே䠻 䠚䚷䝏䞊䝖䚷䠘 䢟^Y^Y^Y^Y^䢟 㻝㻢
  17. 17. Raspberry Pi䛾⎔ቃస䜚(2) • crontab –e䜢ᐇ⾜䛧䛶䚸௨ୗ䛾䛸䛚䜚グ㏙ 䠄10⛊䛤䛸䛻remouiiin.php䛾䜹䜴䞁䝖䜢☜ㄆ䛩 䜛䠅 * * * * * /usr/bin/php5 /home/pi/ejepoll.php * * * * * sleep 10 ; /usr/bin/php5 /home/pi/ejepoll.php * * * * * sleep 20 ; /usr/bin/php5 /home/pi/ejepoll.php * * * * * sleep 30 ; /usr/bin/php5 /home/pi/ejepoll.php * * * * * sleep 40 ; /usr/bin/php5 /home/pi/ejepoll.php • ௒᪥䛿タᐃ῭䜏䠄☜ㄆ䛧䛶䜏䛶䛟䛰䛥䛔䠅 㻝㻣
  18. 18. [₇⩦]ືస䜢☜ㄆ䛩䜛 • 䝤䝷䜴䝄䛛䜙VPS䛻䜰䜽䝉䝇䛧䛶䚸䛂䝸䝰䞊䝖Eject 䜢ᐇ⾜䛃䝪䝍䞁䜢ᢲ䛩 • 10⛊๓ᚋ䛷Eject䛥䜜䜜䜀ᡂຌ • Eject䛥䜜䛺䛔ሙྜ䛿௨ୗ䛾Ⅼ䜢☜ㄆ – 䝗䝷䜲䝤䛜ṇ䛧䛟᥋⥆䛥䜜䛶䛔䜛䛛 䠄䝗䝷䜲䝤䛾㟁※ON→䝗䝷䜲䝤ഃ䜿䞊䝤䝹→RPiഃ䜿䞊 䝤䝹䛾㡰䛻⾜䛖䠅 – 䝗䝷䜲䝤䛜ㄆ㆑䛥䜜䛶䛔䜛䛛 䠄ls –l /dev/sr* 䜔㻌lsusb㻌䛺䛹䠅 – 䝇䜽䝸䝥䝖䛾グ㏙䝭䝇䛜䛺䛔䛛 㻝㻤
  19. 19. 䜎䛸䜑 • VPS䛷䜒Eject䛿䛷䛝䛯 • remouiiin䛜㏉䛩್䜢ኚ䛘䛯䜚䚸eject䝁䝬䞁䝗 䜈䛾䜶䜲䝸䜰䝇䛻䛩䜜䜀䜒䛳䛸䛭䜜䛳䜍䛟䛷䛝 䜛䛸ᛮ䜟䜜䜛 • Ẽ䜢䛴䛡䜛䜉䛝䛿Eject䛿ᡭẁ䛷䛒䜚┠ⓗ䛷䛿 䛺䛔䛣䛸 – 䛣䛾⤖ᯝ䜢ぢ䛶䛂䛯䛾䛧䛔䟿䟿䛃䛷⤊䜟䜛䛰䛡䛷 䛿䛰䜑 – Eject䛷ᚓ䜙䜜䜛䝖䝺䜲㛤㛢䛾㐠ື䜢ά⏝䛩䜉䛧 㻝㻥
  20. 20. Part2 ConoHa㐃ᦠ䛾⊧䜎䛳䛧 䛠䜙⤥㣵Eject䝅䝇䝔䝮 Eject䝁䝬䞁䝗䝴䞊䝄䞊఍ 䛒䛳䛝䛓 ( id:Akkieso3 ) 2014/9/27 ฟᙇ䛣䛾䜉䜣䠖⊧䜹䝣䜵×Eject䝴䞊䝄䞊఍䚸 ወ㊧䛾䝁䝷䝪䝝䞁䝈䜸䞁䟿ConoHa by GMO 㻞㻜
  21. 21. 䝖䝺䜲㛤㛢䛾㐠ື䜢ά⏝䛧䜘䛖 • CD-­‐ROM䝗䝷䜲䝤䛿Eject䝁䝬䞁䝗䛻䜘䛳䛶䝖䝺䜲 䛾㛤㛢㐠ື䜢ᚓ䜛䛣䛸䛜䛷䛝䜛 – Eject䛩䜛䠙䝖䝺䜲䛷ᢲ䛩 – Load䛩䜛䠙䝖䝺䜲䛷ᘬ䛟 • ᇶᮏⓗ䛻䛿䝖䝺䜲䛷ᢲ䛩䛸䛝䛾ື䛝䜢౑䛖䛣䛸 䛜ከ䛔 – 䝪䝍䞁䜢ᢲ䛩 – 䛚䜒䜚䜢✺䛝ⴠ䛸䛩 㻞㻝
  22. 22. ⤥㣵䛾౛ • 䝝䝮䝇䝍䞊䛾⤥㣵 – ⚾䛜㛤Ⓨ䛧䛯ึ䜑䛶䛾Eject䝁䝬䞁䝗ᕤస – ⌧ᅾ䜒ฟᙇ䛾᫬䛺䛹䛻౑⏝ • 䝖䝺䜲䛷㣵䜢ᢲ䛧䛶ୗ䛻ⴠ䛸䛩䝟䝍䞊䞁 㻞㻞
  23. 23. ⊧䜈䛾⤥㣵 • ᾏእ䛻஦౛䛒䜚(2006ᖺ䟿) – hp://www.leeholmes.com/blog/2006/08/ 22/diy-­‐cat-­‐feeder-­‐and-­‐water-­‐dispenser/ • 䝺䝞䞊䜢ᢲ䛧䛶䛔䜛㛫㣵䛜ฟ䛶䛟䜛䠙ᢲ䛩䞉ᘬ 䛟୧᪉౑䛖䝍䜲䝥 ←CD-ROM䝗䝷䜲䝤 ⤥㣵⿦⨨→ 㻞㻟
  24. 24. ⏝ព䛩䜛䜒䛾 • 㣵䜢ධ䜜䜛⟽䠄∵ங䝟䝑䜽䛺䛹䠅 • ㍯䝂䝮ᩘᮏ • ཌ⣬䛛䝎䞁䝪䞊䝹∦ • 䛾䜚䛛䝔䞊䝥 • 䝝䝃䝭䞉䜹䝑䝍䞊 • ᅵྎ䛾⟽ 㻞㻠
  25. 25. ⤥㣵⿦⨨䛾సᡂ • ⟽䛾ഃ㠃䛾ୗ䛾᪉䜢ୗ䞉ᕥ䞉ྑ䛾3᪉ྥ䛻ษ 䜚䛣䜏䜢ධ䜜䜛 • ୗ䛾㒊ศ䛻䝺䝞䞊䜢ྲྀ䜚௜䛡䜛 • ษ䜚㎸䜏䛾ୖ䛛䜙1/3 䛟䜙䛔䛾㒊ศ䛻㍯䝂䝮 䜢ྲྀ䜚௜䛡䜛 • ᅵྎ䜢⏝ព䛧䛶䚸䜔䜔 ᩳ䜑䛻ྲྀ䜚௜䛡䜛 䠄ヨసရ䠅 㻞㻡
  26. 26. [₇⩦]䜔䛳䛶䜏䜘䛖ᨵⰋⅬ • ᮏ᪥䛿䜹䝣䜵ෆ䛷ᕤస䛜䛷䛝䛺䛔䛾䛷䚸᏶ᡂ ရ䜢䛔䛟䛴䛛⏝ព • Part1䛷స䛳䛯Eject⎔ቃ䛻タ⨨䛧䛶䚸㣵䜢䛒䛢 䛶䜏䜘䛖 • ᾏእ䛾౛䛾䜘䛖䛻䚸ẁ䝪䞊䝹䛷䜹䝞䞊䜢䛩䜛 䛸䚸䜘䜚䛭䜜䜙䛧䛔ぢ䛯┠䛻䛺䜛䚸䛿䛪 㻞㻢
  27. 27. 䜰䞁䜿䞊䝖䛻䛤༠ຊ䛟䛰䛥䛔 • ฟᙇ䛣䛾䜉䜣䠖⊧䜹䝣䜵×Eject䝴䞊䝄䞊఍䚸ወ ㊧䛾䝁䝷䝪䝝䞁䝈䜸䞁䟿䜰䞁䜿䞊䝖䝣䜷䞊䝮 • hps://www.conoha.jp/survey/3495.html 㻞㻣

×