Skip to content

Instantly share code, notes, and snippets.

@xxmatyuk
xxmatyuk / rpi_fans_app.py
Last active January 1, 2021 13:16
The first draft of a small Flask app running on Raspberry Pi to read DH-22 sensors temperature and to operate Noctua fans (A6 and A12) via GPIO PWM.
import board
import atexit
import json
import adafruit_dht
import RPi.GPIO as GPIO
from flask import Flask
# Fans
FANS_PIN = 21
package main
import (
"net/http"
"github.com/gorilla/mux"
"google.golang.org/appengine"
service "github.com/xxmatyuk/example-gae-go111/example_app"
package exampleservice
import (
"net/http"
)
type Service struct{}
func NewService() *Service {
return &Service{}
@xxmatyuk
xxmatyuk / post_boot.sh
Last active September 7, 2019 17:07
Pi post boot script
#!/bin/bash
# Parse args
ssid="$1"
password="$2"
# Create Wi-Fi config
cat > wpa_supplicant.conf <<EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1