Skip to content

Instantly share code, notes, and snippets.

View andriiburka's full-sized avatar
☑️
Nope

Andrii Burka andriiburka

☑️
Nope
View GitHub Profile
@andriiburka
andriiburka / HAP-NodeJS_Installer_Edited_Specially_For_Me
Last active September 8, 2017 10:23
HAP-NodeJS_Installer_Edited_Specially_For_Me
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
@andriiburka
andriiburka / OfficeLight_accessory.js
Created September 8, 2017 13:19
PHILIPS Hue ~Clone Based On Neopixels WS8212b (Ring)
// 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);
@andriiburka
andriiburka / OfficeLight_accessory.ino
Last active August 24, 2018 07:51
Depends: Adafruit_NeoPixel-master & pubsubclient-master Arduino IDE Libraries
#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
@andriiburka
andriiburka / SecurityCameraPS3
Created September 8, 2017 14:40
MotionEye Security Camera for Apple HomeKit RPI3 USB
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
@andriiburka
andriiburka / Wget_Temp+Humid_accessories
Last active September 8, 2017 15:52
Инсталира 2 аксесоара. Единият е за температура а другия за влажност на въздуха.
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
@andriiburka
andriiburka / SonoffHumidity_accessory.js
Last active September 8, 2017 15:51
HAP-NodeJS humidity sensor DHT11
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
@andriiburka
andriiburka / SonoffTemperature_accessory.js
Last active September 8, 2017 15:50
HAP-NodeJS temperature sensor DHT11
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
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
# 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
@andriiburka
andriiburka / problem_1.py
Created January 29, 2020 12:54
softuniada_1_2019
# 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)