Skip to content

Instantly share code, notes, and snippets.

View reubenmiller's full-sized avatar

Reuben Miller reubenmiller

  • Hamburg, Germany
View GitHub Profile
@reubenmiller
reubenmiller / thin-edge.io-custom-topic-schema.md
Created November 3, 2023 14:47
thin-edge.io custom topic schema example

Using custom topic schema with thin-edge.io (>= 0.13.0)

This is a short informal overview of how to use thin-edge.io and a custom topic schema to model different IoT use-cases.

This documentation is provided to help people understand thin-edge.io and to provide some early feedback before adding it to the official docs.

Building management system

This example explores the building management system use-case where thin-edge.io provides the communication from the cloud to a local piece of software which translates the thin-edge.io MQTT API to the required building management system API calls.

@reubenmiller
reubenmiller / simulate.py
Last active October 9, 2023 01:36
thin-edge.io benchmarking script
"""thin-edge.io data simulator"""
import argparse
import time
import random
import json
from multiprocessing import Pool
import datetime
import logging
import paho.mqtt.client as mqtt
@reubenmiller
reubenmiller / debug.sh
Last active March 15, 2025 09:18
thin-edge.io debug info
#!/bin/sh
MODEL=$(cat /proc/cpuinfo | grep Model | cut -d: -f2- | xargs)
OS_NAME=$(cat /etc/os-release | grep PRETTY_NAME | cut -d= -f2- | tr -d '"')
printf '\n'
printf 'Debug information: (copy/paste to the ticket)\n'
printf '\n'
printf '|Property|Value|\n'
printf '|--------|-----|\n'
printf '|OS [incl. version]|`%s`|\n' "${OS_NAME:-unknown}"
@reubenmiller
reubenmiller / INSTALL_GO_C8Y_CLI_MANUALLY.md
Last active September 7, 2023 03:22
Manually install go-c8y-cli just using the binary

Manually download and install the binary

  1. Download the binary

    Linux / MacOS / WSL

    Make sure you choose the appropriate cpu architecture for your machine! Check out the options in the assets section of the latest release.

    mkdir -p "$HOME/bin"
@reubenmiller
reubenmiller / tedge-debug.sh
Created August 15, 2023 16:25
thin-edge.io debug script
#!/bin/sh
# -----------------------------------------------------------------------------------------------
# thin-edge.io debugging
# -----------------------------------------------------------------------------------------------
# Collect debug information to access the health of the installation
# -----------------------------------------------------------------------------------------------
set -e
LOG_FILE=/tmp/tedge-debug.log
@reubenmiller
reubenmiller / README.md
Last active August 17, 2023 07:29
Download and build a ca-certificate store file using openssl

How to use

Option 1: Configure ca bundle (and download one if necessary) - No openssl required!

  1. Download the configure-ca-bundle.sh script (or either copy paste the contents and write to a file called ./configure-ca-bundle.sh)

  2. Make the script executable

chmod +x ./configure-ca-bundle.sh

@reubenmiller
reubenmiller / check-sysvinit-status.sh
Created August 8, 2023 05:43
Check a sysv init system to gather information about if tedge-agent can be run or not
#!/bin/sh
echo "------------ System info ------------"
uname -a
echo "sysvinit version: $(/sbin/init --version)"
echo
echo "----------- Checking setup -----------"
command -V service || echo "FAIL: service does not exist"
command -V start-stop-daemon || echo "WARN: start-stop-daemon does not exist, this is used by the service definitions currently"
@reubenmiller
reubenmiller / EDIT_MOSQUITTO_SYSTEMD_SERVICE.md
Last active July 17, 2023 13:56
How to edit mosquitto systemd service restart interval to fix dns resolution error on startup

Option 1: Override mosquitto systemd service

This solution relies on using systemd override functionality require allows additional settings to be applied to existing systemd configuration files without having to redefined the entire systemd service definition.

Editing the mosquitto systemd definition

  1. Edit the mosquitto service definition
@reubenmiller
reubenmiller / deploy.sh
Last active June 26, 2023 06:13
example refactored deploy.sh script
#!/bin/bash
set -e
info () { echo "INFO $*" >&2; }
error () { echo "ERROR $*" >&2; }
print_usage() {
echo "
Deploy a Cumulocity IoT microservice from a github release url
@reubenmiller
reubenmiller / example.sh
Created June 14, 2023 09:11
go-c8y-cli examples
c8y util repeat 3 | c8y devices create --template "{name: 'device_%04d' % input.index, uuid: _.Hex(24)}" --dry
c8y devices list --query "has(uuid)" | c8y identity create --template "{externalId: input.value.uuid, type: 'mytype'}" --dry