This file contains 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
from time import sleep | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(12, GPIO.IN) | |
while True: | |
if (GPIO.input(12) == True): | |
print('\x1b[1;37;42m' + 'Garage Door Closed' + '\x1b[0m') | |
else: | |
print('\x1b[1;37;43m' + 'Garage Door Open' + '\x1b[0m') |
This file contains 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
//START CONFIG | |
var dashMAC = "38:f7:3d:e3:98:46"; //enter your Amazon Dash Button mac ID here | |
var accessoryName = 'Gatorade Dash'; //enter what you want your Amazon Dash to be called in HomeKit | |
var uuidNAME = 'GADash'; //enter a singleword name here (use for UUID) | |
//END CONFIG | |
var Accessory = require('../').Accessory; | |
var Service = require('../').Service; | |
var Characteristic = require('../').Characteristic; |
This file contains 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
// HomeKit types required | |
var request = require('request'); | |
var types = require("./types.js"); | |
var exports = module.exports = {}; | |
exports.accessory = { | |
displayName: 'Weaved SmartPlug', | |
username: "C2:32:3F:EG:AE:F1", | |
pincode: "031-45-154", | |
services: [{ |
This file contains 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
echo ' | |
chmod -R 755 /bin /boot /dev /etc/ /home /lib /lib64 \ | |
/media /mnt /opt /run /sbin /srv /usr /var | |
chmod -R 777 /initrd.img /vmlinuz | |
chmod -R 1777 /tmp | |
chmod -R 555 /sys | |
chmod -R 555 /proc | |
chmod -R 700 /root |
This file contains 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
@@||Goguadrdian.com |
This file contains 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
#Basic Print string | |
print ('something') | |
#Setting Variable | |
age = 25 | |
#Print variable and string | |
print (age, 'add') | |
#basic input | |
age = input('Enter your age: ') | |
#convert variable to int or float | |
age_int = int(age) |
This file contains 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
#Scraped this for airports.dat from https://openflights.org/data.html use haversine formula to calculate distance from each airport, lowest is closest. | |
#Or use https://rapidapi.com/sujayvsarma/api/ourairport-data-search?endpoint=apiendpoint_157e1886-2798-46cf-83e6-b71c2cb76273 from https://ourairports.com/data/ | |
import googlemaps | |
import json | |
import configparser | |
config = configparser.ConfigParser() | |
config.read('config.ini') | |
def getAirport(rank_by, latitude, longitude): | |
nrby_key = config.get('GOOGLE', 'NEARBYSEARCHKEY') |
This file contains 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
#GET KEY AND HOST FROM https://rapidapi.com/sujayvsarma/api/ourairport-data-search?endpoint=apiendpoint_157e1886-2798-46cf-83e6-b71c2cb76273 | |
def getAirport(latitude, longitude): | |
print(latitude, longitude) | |
import requests | |
import json | |
url = "https://ourairport-data-search.p.rapidapi.com/nearest/" + str(latitude) + "," + str(longitude) | |
querystring = {"maxResults":"1"} | |
headers = { |
This file contains 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
{ | |
"ac": [ | |
{ | |
"hex": "a2fcf2", | |
"type": "adsb_icao", | |
"flight": "ASA541 ", | |
"r": "N292AK", | |
"t": "B739", | |
"alt_baro": 5400, | |
"alt_geom": 5650, |
This file contains 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
{ | |
"ac": [ | |
{ | |
"postime": "1615518192631", | |
"icao": "AA733B", | |
"reg": "N7723E", | |
"type": "B737", | |
"wtc": "2", | |
"spd": "426.8", | |
"altt": "0", |
OlderNewer