Skip to content

Instantly share code, notes, and snippets.

View andrew-blake's full-sized avatar

Andrew Blake andrew-blake

View GitHub Profile
@lordneon
lordneon / steps.md
Last active April 26, 2024 09:58
UK Light Wiring with Shelly 1

Intro

This is a simple guide on how to automate UK lights with a Shelly 1 by installing the shelly 1 relay into the ceiling pendant which has both permanent live, neutral and a switched live back from the wall switch.

These steps are from my own experience making my lighting "smart" but also user friendly (it works via a wall switch!). This simple guide will go through replacing an a normal ceiling pendant with one with room for a Shelly 1. If you have a ceiling light with a bigger base it's even easier.

Warning Electrical regulations must be followed by law. If you are not a competent person under the regulations do not attempt electrical work. https://www.diydoctor.org.uk/projects/electrical_safety.htm

Wiring Diagram

This diagram has been taken from here and modified to include the Shelly 1. Wiring Diagram

@yougg
yougg / proxy.md
Last active July 17, 2024 09:23
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@dice89
dice89 / PyDataRangeQueries.ipynb
Created September 20, 2017 08:40
The Code for my Talk at PyData in Berlin September 2017
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active July 22, 2024 10:23 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@steveodom
steveodom / athena_cheatsheet.md
Last active April 11, 2022 14:21
AWS Athena / Hive / Presto Cheatsheet

Useful Links / Sources

Housekeeping

change column type

ALTER TABLE logs.trades CHANGE recentprice price int;
@hervenicol
hervenicol / run.tpl
Last active May 12, 2023 14:20 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name={{.Name}} \
{{range $e := .Config.Env}}--env={{printf "%q" $e}} \
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}{{with $conf}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \
{{end}}{{end}}{{range $n, $conf := .NetworkSettings.Networks}}{{with $conf}}--network {{printf "%q" $n}} \
{{range $conf.Aliases}}--network-alias {{printf "%q" .}} {{end}} \
{{end}}{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from={{printf "%q" .}} \
{{end}}{{range $v := .HostConfig.Binds}}--volume={{printf "%q" .}} \
{{end}}{{range $l, $v := .Config.Labels}}--label {{printf "%q" $l}}={{printf "%q" $v}} \
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{printf "%q" .}} \
@esquireofoz
esquireofoz / cloudfront_pop_locations.psv
Created September 29, 2016 12:41
AWS CloudFront POPs by City and Region
AMS1 | Amsterdam, The Netherlands | Europe
AMS50 | Amsterdam, The Netherlands | Europe
ARN1 | Stockholm, Sweden | Europe
ATL50 | Atlanta, Georgia | United States
ATL52 | Atlanta, Georgia | United States
BOM2 | Mumbai, India | India
BOM51 | Mumbai, India | India
CDG3 | Paris, France | Europe
CDG50 | Paris, France | Europe
DEL51 | Paris, France | Europe
create table mydata_real (id serial, date date, value text);
create table mydata_real_y2015 (check (date >= '2015-01-01' and date < '2016-01-01')) inherits (mydata_real);
create table mydata_real_y2016 (check (date >= '2016-01-01' and date < '2017-01-01')) inherits (mydata_real);
create function mydata_nope() returns trigger language plpgsql
as $f$ begin raise exception 'insert on wrong table'; return NULL; end; $f$;
create trigger mydata_nope before insert on mydata_real execute procedure mydata_nope();
create view mydata as select * from mydata_real;
@johnboiles
johnboiles / enable-charles-proxy.sh
Last active January 28, 2021 07:48
Add this as a "Run Script" build phase in Xcode to enable Charles Proxy on iOS 9
#!/bin/sh
# enable-charles-proxy.sh
#
# Created by John Boiles on 9/21/15.
#
# This script sets :NSAppTransportSecurity:NSAllowsArbitraryLoads to true in the Info.plist file if building the Debug configuration.
# This enables debugging from https proxies such as Charles.
INFO_PLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"