Skip to content

Instantly share code, notes, and snippets.

View Paraphraser's full-sized avatar

Phill Paraphraser

  • Cootamundra NSW Australia
View GitHub Profile
@Paraphraser
Paraphraser / Removing bad data from InfluxDB.md
Last active February 16, 2024 22:30
IOTstack tutorial: removing bad data from InfluxDB

IOTstack tutorial: removing bad data from InfluxDB

A fairly common question from IOTstack users running InfluxDB is how to remove "bad data" from a database?

This gist focuses on InfluxDB 1.8 and the InfluxQL commands needed to operate upon an InfluxDB 1.8 database. You are entirely on your own if you are using InfluxDB 2.x.

prevention is better than cure

The best advice I can give you is to avoid the problem by ensuring that "bad data" never gets into your database in the first place. For example:

@Paraphraser
Paraphraser / custom-os-builds.md
Created December 21, 2023 01:51
Installing IOTstack on custom OS builds

Installing IOTstack on custom OS builds

The following question appeared on the IOTstack Discord channel. It's the second part of a thread but I'll come back to the first part later:

I'm still struggling with this error. So the instruction says don't assign a password for root during the Debian installation. HOWEVER, the OS image that I'm using already comes with a default root password and I have to enter the default password to continue at the first step. Is there any way to remove this default password? Otherwise, it seems there is no way to continue the installations on this OS...

I don't want to over-sell this but the general thrust of the Unix industry over the last 20-odd years has been to avoid enabling the root account. In more recent times, security gurus, legislatures and best practice have been leading us to a world where there are no default accounts for anything.

Thus, while the general principle mu

@Paraphraser
Paraphraser / IOTstack tutorial - adding a container.md
Last active April 1, 2024 23:06
IOTstack tutorial - adding a container

IOTstack tutorial - adding a container

This gist is a response to a Discord question asking:

is it possible to add my own container to IOTStack? for example: couchdb

The answer is "yes" and CouchDB is quite a good example to use for a tutorial.

contents

@Paraphraser
Paraphraser / IOTstack tutorial - two instances of Node-RED.md
Created July 24, 2023 11:32
IOTstack tutorial: running two instances of Node-RED on the same host

IOTstack tutorial: running two instances of Node-RED on the same host

Suppose you have a Node-RED container running but you want to create a test version where you can experiment safely without disturbing the original.

Running multiple instances of a container is something Docker excels at! This tutorial explains how to set it up. It will also help you to understand the differences between containers running in host mode and non-host mode.

Assumptions

  1. Your existing Node-RED service definition looks similar to this:
@Paraphraser
Paraphraser / ZeroTier-macOS-menu-bar.md
Created June 16, 2023 06:12
ZeroTier GUI controls in the macOS (Ventura) menu bar

On ZeroTier, macOS and the menu bar

Over at the ZeroTier forum is a thread:

The thread covers two distinct problems:

  1. The ZeroTier One.pkg package downloaded from ZeroTier.com won't install on macOS Ventura.
  2. The package installs but the associated app won't start and the menu bar item is not present.
@Paraphraser
Paraphraser / Compiling GoSungrow.md
Last active April 20, 2024 09:48
Compiling GoSungrow

Updating GoSungrow

This gist is intended to help you deal with the following error messages:

  • Error: appkey is incorrect 'er_invalid_appkey
  • Error: unknown error 'Request is not encrypted'

This gist has four parts. The instructions you should follow depend on what you want to do:

| Part | Explains how to |

@Paraphraser
Paraphraser / IOTstack-NodeRED-pigpiod.md
Last active February 15, 2023 04:13
IOTstack + Node-RED + pigpiod

IOTstack + Node-RED + pigpiod

Problem Statement

The following problem was reported on the IOTstack Discord channel:

Today I rebuild my IOTstack from scratch using the Pibuild process and after restoring my nodered flows I noticed that my serials and GPIO are not connecting anymore.

I don't use node-red-node-pi-gpiod myself but I have been able to reproduce the problem.

@Paraphraser
Paraphraser / IOTstack tutorial - local reversion.md
Created December 12, 2022 23:42
IOTstack tutorial : local image reversion

IOTstack tutorial : local image reversion

One of the main advantages of running services in Docker containers is the relative ease of reverting to the last-known-good container.

One of the biggest problems with reverting to the last-known-good container arises if you don't already know the tag of the image you want to revert to. Sometimes it can be a bit tricky to figure it out. You usually need to go to the container's "tags" page on DockerHub, sort through the update history for your architecture, pick the appropriate tag, edit your compose file to specify that tag, and then, in the words of the old Knight in the third Indiana Jones movie, hope that you have "chosen wisely".

Your chances of choosing wisely are inversely proportional to the amount of panic you're feeling after you realise a key container isn't working and reverting is your best strategy. Panic is the enemy of clear thinking and reasoning.

There is, however, another way. The method described here means you retain the last-known-

@Paraphraser
Paraphraser / InfluxDB-data-merging.md
Created November 29, 2022 05:36
IOTstack tutorial: InfluxDB data merging

IOTstack tutorial: InfluxDB data merging

Scenario

A question on Discord described a situation where a new (empty) database had been created. That database contained data acquired since the rebuild but had no historical data prior to the rebuild. However, the person did have a "portable" backup of the older data and wanted to know if it was possible to merge the backup with the live data?

The answer is "yes". Merging measurements will solve this particular problem.

My test environment

@Paraphraser
Paraphraser / ComposeProfiles.md
Created October 18, 2022 05:00
Understanding compose profiles

IOTstack: Understanding compose profiles

You are probably familiar with running a command like:

$ docker-compose up -d

You probably expect that command to bring up a container for every service definition mentioned in your docker-compose.yml. That's its default behaviour.