tailieunhanh - Apress - Smart Home Automation with Linux (2010)- P41

Apress - Smart Home Automation with Linux (2010)- P41:Linux users can now control their homes remotely! Are you a Linux user who has ever wanted to turn on the lights in your house, or open and close the curtains, while away on holiday? Want to be able to play the same music in every room, controlled from your laptop or mobile phone? Do you want to do these things without an expensive off-the-shelf kit | CHAPTER 5 COMMUNICATION Post Array sender 012345678 content Null Wow this might work you know inNumber 447786202240 submit Submit network UNKNOWN email none keyword NULL comments Wow this might work you know Both contain enough information to let you switch your lights on with a text message. The code is trivial as follows if _POST from 012345678 if _PoST text bedroom on system usr local bin heyu turn bedroom_light on else if _POST text bedroom off system usr local bin heyu turn bedroom_light off To eliminate the sending of fiddly text messages and perhaps save money you can test future permutations of this script with a simple web page. Using the simpler format you can write code such as the following form action method POST input name from value phone num input name text value your message here input name msgid value type hidden input name type value 1 type hidden input type submit value Send Fake SMS form Being on an open web server there are some security issues. You eliminate one by having the phone number verified by a piece of code on the server never validate credentials on the client . You can further limit another issue although not eliminate it by changing your simply named script to employing security through obscurity so that it is not accidentally found. Some providers will call your web page using HTTPS which is the best solution and worth the extra time in setting up a specific username and password for them. You can rebalance the concepts of security and accessibility by allowing multiple phones to access the house by creating a white list of mobile phone numbers and by adding to this list explicitly. Or you could ban any access to your page from an IP that isn t similarly approved and known to be your gateway provider. If you were likely to be communicating a lot through SMS you could automatically add new phone numbers to a pending list of preapproved devices which in turns sends a notification message to the SMS

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.