Django Development and Staging

I have two boxes: dev and production. I need a very simple method for working on the dev machine and then pushing to production. Environment Use direnv to maintain environment based on directory. Use two seperate .envrc files on dev and production. […]

Postgres Tricks

Log-the-frick-in sudo -u postgres psql dbname # typical root user psql -h localhost -U user -W dbname # default host is unix-domain (not tcp to localhost) More detail here. Create read-only user Backup and restore Swap ‘phisaver’ for database name of your […]

Why the hell can’t I login to PostgreSQL?

Some possible reasons and solutions Wrong host Use the “-h” flag: psql -h localhost -U phisaver –password Wrong syntax Use -U and -W flags for user and password psql -U fred -W > prompts for password Not allowed Check your conf file/s. […]

Periodic Emails with Django

Rough notes on meeting these requirements: Using Django Send weekly / daily emails to someone Log results Be robust and simple Packages Based on stars, maintenance, simplicity in 2021 post_office for emails: it may be possible to just use django mail. django_q […]

Energy Dashboards

Currently (2021) PhiSaver has one billlion data points. It’s a bit hard to display in a single user dashboard. An efficient user dashboard should answer questions. This page charts my progress to the mythical perfect energy monitoring dashboard. Typical user 30 – […]

InfluxDB v2 (Flux) Setup for Energy and Power Data from Iotawatt

This are my notes on setting up InfluxDBv2 for storing Iotawatt power readings. Specifically I needed to: Transition a live site from InfluxDB1 to InfluxDB2 Setup InfluxDBv2 to use InfluxDBv1 api and auth, so that ‘old’ IotaWatts can continue to post data […]

Enclosures for electronics and RF

Investigations into using ABS, polycarbonate and sheet metal enclosures to house electronics with a focus on getting that radio signal (wifi, 3G/4G) out of the box Requirements Weatherproof. IP66 = no dust and no water even from jets. IP55 would be okay […]

OpenVPN for IoT

Using a AWS Linux server, and Raspberry Pi, Ubuntu or Robustel router clients Situation Lots of linux devices (and embedded devices) behind firewalls without public IP address Publicly accessible computer (AWS) Goals Connect from the server (or office PC) to these devices […]

linux commands

Test OpenVPN server on it’s standard UDP port telnet is so 2020 so use nc which does UDP too -v verbose -z test daemon -u UDP Get a list of hosts with port “X” open -oG temp: output in grepable format to […]