Skip to content

Instantly share code, notes, and snippets.

@andrewlkho
andrewlkho / gist:7373190
Last active January 15, 2025 08:43
How to use authentication subkeys in gpg for SSH public key authentication

GPG subkeys marked with the "authenticate" capability can be used for public key authentication with SSH. This is done using gpg-agent which, using the --enable-ssh-support option, can implement the agent protocol used by SSH.

Requirements

A working gpg2 setup is required. It may be possible to use gpg 1.4 but with gpg-agent compiled from gpg2. If you are using OS X 10.9 (Mavericks) then you may find the instructions [here][1] useful.

@lordneon
lordneon / steps.md
Last active May 15, 2025 08:21
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

@schl3ck
schl3ck / BetterRequest.js
Last active August 8, 2023 14:41
A wrapper for the Request API of Scriptable, automatically handling common mime types.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-green; icon-glyph: cloud-upload-alt;
/*******************************************
* *
* ____ _ _ *
* | _ \ | | | | *
* | |_) | ___| |_| |_ ___ _ __ *
* | _ < / _ \ __| __/ _ \ '__| *
* _____| |_) | __/ |_| || __/ | _ *
# *.home.mydomain.name is configured as a catchall CNAME in my DNS provider to point to the Caddy box.
# That way, everything needed to add a new subdomain/service is adding it in this file and reloading Caddy.
...
project-1.home.mydomain.name {
respond "This will be provided as a static HTTP response"
}
project-2.home.mydomain.name {
# HTTP basic authentication. Static hosted content served directly by Caddy.