This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /home/pi | |
sudo apt-get update | |
sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key | |
sudo apt-key add mosquitto-repo.gpg.key | |
cd /etc/apt/sources.list.d/ | |
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list | |
cd | |
sudo apt-get update | |
sudo apt-get install mosquitto mosquitto-clients -y | |
sudo apt-get remove nodejs nodejs-legacy -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MQTT Setup | |
var mqtt = require('mqtt'); | |
console.log("Connecting to MQTT broker..."); | |
var mqtt = require('mqtt'); | |
var options = { | |
port: 1883, | |
host: '127.0.0.1', | |
clientId: 'ANDRII' | |
}; | |
var client = mqtt.connect(options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266mDNS.h> | |
#include <WiFiUdp.h> //Documents/Arduino/Libraries | |
#include <PubSubClient.h> //https://goo.gl/mxQwfG | |
#include <Adafruit_NeoPixel.h> //https://goo.gl/2eHMGB | |
#define PIN 4 //D2 или GPIO4 за WeMOS D1 Mini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear | |
echo "Starting Motioneye Installation" | |
sleep 1 | |
clear | |
cd /home/pi | |
sudo wget https://github.com/ccrisan/motioneye/wiki/precompiled/ffmpeg_3.1.1-1_armhf.deb | |
sudo dpkg -i ffmpeg_3.1.1-1_armhf.deb | |
sudo rm -rf ffmpeg_3.1.1-1_armhf.deb | |
sudo apt-get remove libavcodec-extra-56 libavformat56 libavresample2 libavutil54 | |
sudo apt-get install libavutil54 libavformat56 libswscale3 -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /home/pi/HAP-NodeJS/accessories | |
sudo wget https://gist.githubusercontent.com/andriiburka/f2352f659d6db7a622e61f08e8592166/raw/a238a3da5ff2aa2a1999e6a962f7d4da1cf08a4c/SonoffTemperature_accessory.js -O SonoffHumidity_accessory.js | |
sudo wget https://gist.githubusercontent.com/andriiburka/ca13beb86eeb1c931395c703a6029487/raw/ba1c5df7fc8490529c2e78496e75507b6f880c7c/SonoffHumidity_accessory.js -O SonoffTemperature_accessory.js | |
clear |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Accessory = require('../').Accessory; | |
var Service = require('../').Service; | |
var Characteristic = require('../').Characteristic; | |
var uuid = require('../').uuid; | |
var mqtt = require('mqtt'); | |
var mqttMSG = 0; | |
var name = "Sonoff Humidity Sensor"; //accessory name | |
var sonoffUUID = "hap-nodejs:accessories:sonoff:Humidity:" + name; //change this to your preferences |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Accessory = require('../').Accessory; | |
var Service = require('../').Service; | |
var Characteristic = require('../').Characteristic; | |
var uuid = require('../').uuid; | |
var mqtt = require('mqtt'); | |
var mqttMSG = 0; | |
var name = "Sonoff Temperature Sensor"; //accessory name | |
var sonoffUUID = "hap-nodejs:accessories:sonoff:temperature:" + name; //change this to your preferences |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear | |
echo "Starting Motioneye Installation" | |
sleep 1 | |
clear | |
cd /home/pi | |
sudo wget http://goo.gl/DVJZn8 -O motioneye | |
sudo sh motioneye | |
clear | |
echo "Starting HomeKit camera Installation" | |
sleep 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 | |
air_ticket_price_going = float(input()) | |
air_ticket_price_return = float(input()) | |
ticket_game_price = float(input()) | |
num_games = int(input()) | |
percent_of_discount = int(input()) | |
people = 1 + 5 # :D | |
sum_air_tickets = people * (air_ticket_price_going + air_ticket_price_return) | |
discounted_air_tickets = sum_air_tickets - sum_air_tickets * (percent_of_discount/100) | |
total_sum_game_tickets = people * num_games * ticket_game_price |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# n1 = int(input()) | |
# n2 = int(input()) | |
# n3 = int(input()) | |
unsorted_list = [3, 3, 4] | |
# unsorted_list.append(n1) | |
# unsorted_list.append(n2) | |
# unsorted_list.append(n3) |
OlderNewer