Skip to content

Instantly share code, notes, and snippets.

@thomkaufmann
thomkaufmann / lock.py
Last active May 19, 2020 08:29 — forked from pschmitt/lock.py
Home Assistant: Proposal for merged class for Nuki Locks and Openers
"""Nuki.io lock platform."""
from abc import ABC, abstractmethod
from datetime import timedelta
import logging
from pynuki import NukiBridge, NukiLock, NukiOpener
from requests.exceptions import RequestException
import voluptuous as vol
from homeassistant.components.lock import (
-- 1. Create a new generic password entry in Keychain Access called "WHATEVER_AnyConnect_VPN" (the name in Keychain access must match that in line 39 below) with your password for the Cisco AnyConnect VPN server.
-- 2. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility.
-- 4. Enable the above .app so it can access Accessibility
-- 5. Copy and paste a nice icon on the generic Applescript icon (I used a copy of the default AnyConnect one)
-- 6. Add the new .app to /Users/[yourshortname]/Applications with a shortcut to your Dock
-- 7. Enjoy the fast connection with no need to enter password and increased security of not having a sensitive password stored as plain text
-- 8. Run script again to close connection
-- AnyConnect now refered to as targetApp
@thomkaufmann
thomkaufmann / make-mega-adblock-hostsfile.sh
Last active December 7, 2015 17:55 — forked from OnlyInAmerica/make-mega-adblock-hostsfile.sh
Create Mega Adblock Hostsfile for use with Dnsmasq (Modified from Pi-hole)
#!/bin/bash
# Modified Pi-hole script to generate a generic hosts file
# for use with dnsmasq's addn-hosts configuration
# original : https://github.com/jacobsalmela/pi-hole/blob/master/gravity-adv.sh
# The Pi-hole now blocks over 120,000 ad domains
# Address to send ads to (the RPi)
piholeIP="0.0.0.0"
outlist='./final_blocklist.txt'