Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Open Beer Server - theory and the implementation
Search
moznion
December 03, 2016
Technology
5
7.9k
Open Beer Server - theory and the implementation
Slide of builderscon Tokyo 2016
moznion
December 03, 2016
Tweet
Share
More Decks by moznion
See All by moznion
Develop to Survive - YAPC::Hakodate 2024 Keynote
moznion
9
14k
これはPerl? それともRuby? クイズ〜〜〜〜〜!!!- Perl or Ruby Quiz
moznion
3
2.3k
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
1
900
RuboCopのカスタムCopを書いてContributionしてみる - Contributing a Custom Cop to RuboCop: A Hands-on Experience
moznion
0
60
AWS上に構築する メンテ容易なElasticsearch System / Maintainable Elasticsearch system on AWS
moznion
2
3.9k
PROXY Protocol aware Proxy Server on Node.js
moznion
2
2.4k
Perl meets AWS Lambda
moznion
0
4.7k
ソフトウェア開発における 「設計」と「パフォーマンス」の相互作用 / Interaction Between Design and Performance on Software Development
moznion
12
6.9k
Javaカードの世界 / The world of Java Card
moznion
9
13k
Other Decks in Technology
See All in Technology
プロダクト活用度で見えた真実 ホリゾンタルSaaSでの顧客解像度の高め方
tadaken3
0
200
複雑なState管理からの脱却
sansantech
PRO
1
160
強いチームと開発生産性
onk
PRO
35
11k
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
130
日経電子版のStoreKit2フルリニューアル
shimastripe
1
150
AGIについてChatGPTに聞いてみた
blueb
0
130
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
260
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
390
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
330
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
130
Featured
See All Featured
Building Applications with DynamoDB
mza
90
6.1k
A better future with KSS
kneath
238
17k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
What's in a price? How to price your products and services
michaelherold
243
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
110
Docker and Python
trallard
40
3.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
It's Worth the Effort
3n
183
27k
Automating Front-end Workflow
addyosmani
1366
200k
How STYLIGHT went responsive
nonsquared
95
5.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Transcript
Open Beer Server theory and the implementation @moznion
@moznion
None
օ͞ΜϏʔϧ ͖Ͱ͔͢ʂʂ
օ͞ΜੜϏʔϧ ͖Ͱ͔͢ʂʂ
ͦ͏Ͱͳ͍ਓ ͜ͷൃදඍົͰ͢
ΤϯδχΞ Ͱ͔͢ʂʂ
ͦ͏Ͱͳ͍ਓ ྑ͍ػձͰ͢
αʔόΤϯδχΞ ʹͳΕΔʂʂ
Ϗʔϧαʔόʔ ͷͳ͠
Ϗʔϧαʔόʔ ͱ……ੈքͱ……
https://www.flickr.com/photos/50507715@N00/2892136399
Έɼ ཧʹ͍ͭͯ……
Έ is easy
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ PDS (Presentation
Domain Separation) Έ͍ͨͳΜʂʂ
Θ͔Γ·͔ͨ͠ʁ
͍
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ ։์
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ ։์ ѹʹΑͬͯӷ͕ग़Δ
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ Happy!!
Θ͔Γ·ͨ͠Ͷʁ
؆୯Ͱʁ
ͱ͍͏Θ͚Ͱ ͭ͘Γ·͢ (ͭ͘Γ͓͖Ͱ͢)
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
ੜḺ
None
ੜḺ -ञʹཔΉͱങ͑·͢ -ඇίϛϡͷਓΧΫϠε ͱ͔ͰཔΈ·͠ΐ͏
ੜḺϚδَ (ͦ͏Ͱͳ͍)
None
None
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
ϔου
None
ϔου -ੜḺͱͷΠϯλʔϑΣʔε -ΨεͱͷΠϯλʔϑΣʔε Ͱ͋Δ -ѹΛ༩͑ͭͭӷΛग़͢ਓ
ϔουϚδَ (ͦ͏Ͱͳ͍)
ΩϦϯḺͱ ΞαώḺ͕͋Δ
ϔουͷҧ͍ -ΩϦϯḺ༻ͷϔουͱ ΞαώḺ༻ͷϔου͕͋Δ -ޱۚͷܗঢ়͕ҧ͏ -ޓੑ͕ *ແ͍*
ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου
ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου
ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου ͳͥͳͷͩ……
߹ͬͨϔουΛ ༻ҙ͠·͠ΐ͏
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
Ψε
None
Ψε -ϔουͱଓͯ͠ΨεΛ ૹΔਓ -ΨεͱͷΠϯλϑΣʔε ٴͼѹྗௐث
ΨεϚδَ (ͦ͏Ͱͳ͍)
ͷϘϯϕ ࣮ෆཁ
None
ίϯύΫτΨε ͕͑Δ
None
STOP!!!!!!
ίϯύΫτΨεΛ ͏ͨΊʹ ઐ༻ͷΞλονϝϯτ ͕ඞཁ
None
͜Ε͕ແ͍ͱ࿙Ε·͢
STOP!!!!!!!!!!!!!!!!!!!!!!
खͰదʹΞλονϝ ϯτకΊΔͱ࿙Ε·͢
ϞϯΩʔϨϯνͰ కΊ·͠ΐ͏ (Ψε1ຊϩετ͠·ͨ͠)
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
ྫྷ͢෦
None
ྫྷ͢෦ -ಔͷύΠϓΛྫྷ͢ -ϏʔϧΛྫྷ͑ͨಔͷύΠϓ ʹ௨͢ -ྫྷ͑Δʂʂʂʂ -ͱ͍͏Έ
None
ྫྷ͢෦ -ද໘ੵ͕ଟ͚Εଟ͍΄ Ͳྑ͍ͷͰίΠϧঢ়ʹۂ ͛Δ
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
λοϓ
None
λοϓ -Ϗʔϧग़͢ޱͷ෦Ͱ͢ -Ҏ্
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
νϡʔϒ
νϡʔϒ -֤ίϯϙʔωϯτΛଓ ͢Δ܅ -Micro servicesʹ͓͚ΔHTTP Έ͍ͨͳΜͰ͢
νϡʔϒ -ͳΔ͘ݻ͍ͷΛ͍ ·͠ΐ͏ -ݻ͘ͳ͍ͱϫϯλονܧ खͰ͑ͳ͍
νϡʔϒ -ࠔͬͨΒϗʔϜηϯλʔͰ ങ͍·͠ΐ͏
None
ܨ͗߹Θͤͯ ͍͖·͠ΐ͏
None
None
None
None
None
MEMO: ͜͜Ͱݱ͕ ग़·͢
Ͱ͖ͨͰ͖ͨ
͔͜͠͠ΕͰ ͨͩͷϏ ʔϧαʔόʔ
ͬͱศརʹ ͠·͠ΐ͏
ͱ͍͏Θ͚Ͱ HTTPͷ෦
લఏ
Perl 5Ͱॻ͍ͯ·͢
Why?
None
That's all
Թཧ
Թཧ Ϛδॏཁ
ొਓ -Raspberry Pi -DS18B20 (Թηϯα) -Mackerel
None
ొਓ -Raspberry Pi -DS18B20 (Թηϯα) -Mackerel
ొਓ -Raspberry Pi -DS18B20 (Թηϯα) -Mackerel ͜ΕΛαʔόʔʹೖΕ͓ͯ͘
֓؍ Beer Server DS18B20 3.3V Temperature Custom Metrics (Temperature)
None
None
-άϥϑग़͢
None
None
MackerelͰ ͋ΒΏΔαʔόʔͷ ࢹ͕Ͱ͖Δʂ
None
࣏҆ҡ࣋ػೳ
ະऀ͕ञΛ ҿΉͱേͤΒΕ·͢
ະऀ͕ ञΛҿΊΔঢ়گΛ ࡞Βͳ͚Εྑ͍
ະऀ͕ ञΛҿΊΔঢ়گΛ ࡞Βͳ͚Εྑ͍ ઃఆΑΓن (Convention over Configuration)
ྸ͕20ࡀʹຬͪ ͍ͯͳ͍ਓ 403͠·͠ΐ͏
۩ମతʹ => ະऀͱࢥ͖͠ ਓؒʹ ϏʔϧΛग़͞ͳ͍
ొਓ -Raspberry Pi -C270 (Web camera) -Microsoft Azure -ιϨϊΠυόϧϒ
ྸਪఆ
Azure Face API
None
Azure Face API -إը૾Λ͛Δͱͦͷը ૾ͷϝλใΈ͍ͨͳ ͷ͕औΕΔ -ࠓճྸΛ͏ -ΣϒΧϜͰࡱͬͨը૾ Λ༻
None
͜ΕͰإʹΑͬͯ ྸใ͕Θ͔Δ
࣮ࡍʹαʔόࢭΊΔ ͷͲ͏͢Δʁ
ιϨϊΠυόϧϒ
ιϨϊΠυόϧϒ - ి࣓ੴʢιϨϊΠυʣͷ࣓ྗΛ༻͍ͯϓ ϥϯδϟͱݺΕΔమยΛಈ͔͢͜ͱͰ หʢόϧϒʣΛ։ด͢ΔΈΛ࣋ͭ ͷͰɺྲྀମʢ༉ѹɺۭѹɺਫѹͳͲʣΛ ௨͢ͰͷྲྀΕͷ։ด੍ޚʹ༻͍ΒΕΔ (https://ja.wikipedia.org/wiki/ %E9%9B%BB%E7%A3%81%E5%BC%81)
ιϨϊΠυόϧϒ https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Solenoid_Valve.svg/300px-Solenoid_Valve.svg.png
֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control
C270 Photo Face API
֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control
C270 Photo Face API
֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control
C270 Photo Face API ͜ͷ෦ σϑΥͩͱಈ͖·ͤΜ
ιϨϊΠυόϧϒͱϥζύΠ - ιϨϊΠυόϧϒ͍͍ͩͨ12Vۦಈ - ϥζύΠͷग़ྗ5V/3.3V - Γͳ͍ʂʂ
ঢѹ
None
ͦΕͰແཧ
ιϨϊΠυόϧϒͱϥζύΠ ͱঢѹث - ঢѹث5Vۦಈ - ҙͰON/OFFͰ͖ΔϥζύΠͷGPIO 3.3V - Γͳ͍ʂʂʂ
ιϨϊΠυόϧϒͱϥζύΠ ͱঢѹث - ৗʹONͷ5VͷPINΛ͍͚͑Δ - ͔ͦ͠͠ΕͰεΠονग़དྷͳ͍ - ͏ͩΊͳͷ͔
NPNτϥϯδελ
None
!!!!!!!
- Base͕HighʹͳΔͱ - Collectorͷిྲྀ͕ - ૿෯͞Εͯ - EmitterʹྲྀΕΔ
- BaseʹGPIOܨ͍Ͱ - CollectorΛGNDʹܨ͙ͱ - GPIO͕Highͷ࣌Emitter͕ GNDʹམͪΔ
֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control
C270 Photo Face API
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V High
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V High
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V High
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V High
ղܾʂ
ૢ࡞͜Ε͚ͩͰՄೳ
σϞ
ࠓޙ
ࠓޙ - ྔࢹ͕Ͱ͖ͳ͔ͬͨͷͰ ͳΜΒ͔ͷํ๏ͰΓ͍ͨ - ϒϨουϘʔυΊ͍ͨ - ιϨϊΠυόϧϒ͑ HTTPӽ͠ʹϦϞʔτͰϏʔϧͷ ڙڅ͕ग़དྷͦ͏ͳͷͰΔ
·ͱΊ
·ͱΊ - Ϗʔϧαʔό࡞ΕΔ
·ͱΊ - ࠓճͷ૯ίετ: 89,343JPY
͚ͨͯ͘͢Ε
Q?