Skip to content

Instantly share code, notes, and snippets.

import network
import socket
import time
import struct
from machine import Pin
NTP_DELTA = 2208988800
host = "pool.ntp.org"
@greenbrian
greenbrian / approle.sh
Created April 5, 2019 13:25
Vault CLI testing AppRole
#!/bin/bash
# start vault
VAULT_UI=true vault server -dev -dev-root-token-id=root -dev-listen-address=127.0.0.1:8200
# login as root - DO NOT DO THIS IN PRODUCTION
vault login root
# write some secrets
vault kv put secret/test color=blue number=eleventeen
@lxe
lxe / goes16-rtlsdr.md
Last active September 18, 2025 04:30
Receive GOES-16 and GOES-17 Images with a Raspberry Pi and RTL-SDR dongle
@lihan
lihan / gist:c0d7eeef9a0b375a8f1dd6365f45cb20
Last active July 13, 2021 13:53
Postman Pre-request script to add signatures to work with django-rest-framework-httpsignature
/**
* How to use
*
* 1. Place below script in "Pre-request Script" tab in Postman, change "apiKey" and "apiSecret" variable.
* 2. In the "Headers" tab, reference the value as "{{authorisation}}" as per your predefined header name,
* typically "authorization"
* 3. Depending on your server side setup, add header "x-api-key" to your KEY.
*
* Tested with Postman Version 6.0.9
*
@slardiere
slardiere / openssh.ps1
Last active February 7, 2022 22:31
Install OpenSSH on Windows
Add-Type -AssemblyName System.IO.Compression.FileSystem
function Unzip
{
param([string]$zipfile, [string]$outpath)
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
$url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/latest/'
$request = [System.Net.WebRequest]::Create($url)
@albulescu
albulescu / YamahaProtocol.md
Last active December 5, 2023 09:48
Yamaha Protocol

API

Requests

POST - /YamahaRemoteControl/ctrl

CURL

curl -X POST "http://192.168.0.100/YamahaRemoteControl/ctrl" \
@ladyada
ladyada / adafruitlightpaint4pi.py
Created August 10, 2012 00:26
Adafruit Light Painting with Pi
#!/usr/bin/python
# Light painting / POV demo for Raspberry Pi using
# Adafruit Digital Addressable RGB LED flex strip.
# ----> http://adafruit.com/products/306
import RPi.GPIO as GPIO, Image, time
# Configurable values
filename = "hello.png"
@jstangroome
jstangroome / gist:3087453
Created July 11, 2012 01:58
Change your own Active Directory password from PowerShell without any special permissions
([adsi]'WinNT://domain/username,user').ChangePassword('oldpassword','newpassword')