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 / nanomq.conf
Created October 16, 2024 14:20
Example nanomq configuration
# NanoMQ Configuration 0.18.0
#============================================================
# NanoMQ Broker
#============================================================
system {
daemon = false
num_taskq_thread = 0
max_taskq_thread = 0
parallel = 0
}

README

Create a custom operation which will map the operation to a thin-edge.io workflow (operation).

Pre-requisites

The following components must be installed for the scripts to work.

  • jq
  • tedge (>= 1.3.1-88-g09c1d4c)
@reubenmiller
reubenmiller / README.md
Created October 15, 2024 19:25
Building nanomq on MacOS

Building nanomq on MacOS

Pre-requisite

Install Xcode and accept the license

Building

export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
@reubenmiller
reubenmiller / run.tpl
Created September 28, 2024 12:27 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}
@reubenmiller
reubenmiller / go-daddy-root-cert.crt
Created July 11, 2024 17:26
go daddy root cert
-----BEGIN CERTIFICATE-----
MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx
EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT
EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp
ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz
NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH
EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE
AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD
E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH
@reubenmiller
reubenmiller / c8y.crt
Last active June 19, 2024 20:01
WIP: Copy/paste
-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc
h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+
0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U
A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW
@reubenmiller
reubenmiller / README.md
Last active May 6, 2024 07:13
thin-edge.io upload file to Cumulocity IoT via the local c8y proxy

README

Summary

Upload files to Cumulocity IoT by creating an event and uploading a given file to it.

Usage

USAGE
#!/bin/bash
#
# 1. Pipe a list of ESNs from a file and create a c8y_Command (shell) operation for each device (using go-c8y-cli piping)
# A unique batch marker is used to group the operations together (to make querying for the operation easier)
# 2. Poll the created operations ()
# 3. Print out a summary of how many operations failed and how man were successful
#
# Input file:
# * esn.txt - Newline delimited file containing one ESN per line (file must have an empty line at the end, otherwise the last ESN might be skipped)
#
@reubenmiller
reubenmiller / README.md
Last active March 11, 2024 09:49
Update Cumulocity Location using thin-edge.io

Updating the location information in Cumulocity IoT should not be a problem with thin-edge.io.

For reference, I created the options by reading the following Cumulocity IoT documentation links:

In summary, updating a location of a device (in the backend) involves creating an event and then updating a fragment on the device's managed object, however you have a few different options on how to achieve this with thin-edge.io:

@reubenmiller
reubenmiller / README.md
Last active October 22, 2024 07:03
Only install specific thin-edge.io version

To install a specific version of thin-edge.io on a Debian based operating system, you will have to use APT Package Pinning, as the tedge-full package is a virtual package, and installing a specific version of the virtual package does not transfer to the package's dependencies (unfortunately).

Below shows how the exact thin-edge.io version can be installed.

  1. Create a debian package pin definition for thin-edge.io

    Create the following file:

sudo vi /etc/apt/preferences.d/tedge