Skip to content

Instantly share code, notes, and snippets.

View caputomarcos's full-sized avatar
👽
ping!

Marcos Caputo caputomarcos

👽
ping!
View GitHub Profile
@caputomarcos
caputomarcos / start_rssh_tunnel.sh
Created March 17, 2022 20:00 — forked from volkstrader/start_rssh_tunnel.sh
Start reverse ssh tunnel for cron job
#!/bin/bash
SSH_REDIR_PORT=12345
SSH_D="cloud_sshd"
COMMAND="ssh -R $SSH_REDIR_PORT:localhost:22 $SSH_D -N -f"
pgrep -f "ssh -R $SSH_REDIR_PORT:localhost:22" > /dev/null 2>&1 || (eval $COMMAND && echo $COMMAND)
@Paraphraser
Paraphraser / MQTT_Node-Red_Influx.md
Last active February 19, 2025 11:37
Efficient recipe for getting MQTT data into an InfluxDB database using Node-Red

Recipe: from MQTT to InfluxDB via Node-RED

  • 2024-05-16 adds case study explaining how to extract values from topic strings, and how to specify the measurement name in the message payload provided to the "influxdb out" node.
  • 2023-12-02 revise graphics to correspond with "influxdb out" node, and explain the pros and cons of InfluxDB 1.8 vs InfluxDB 2.

Introduction

Getting data produced by IoT sensors into a database is practically a mandatory step before effective visualisation (eg dashboards).

This recipe shows you how to get an MQTT payload into an InfluxDB database using three Node-RED nodes. It makes the following assumptions:

@lsauer
lsauer / Docker: save_load_compressed_container.bash
Created March 25, 2019 11:37
Docker: save/load container using tgz file (tar.gz)
#for an image ("not running container") use save:
docker save <dockernameortag> | gzip > mycontainer.tgz
#for running or paused docker, use export:
docker export <dockernameortag> | gzip > mycontainer.tgz
#load
gunzip -c mycontainer.tgz | docker load
@webstory
webstory / ps1.py
Created June 16, 2017 03:54
Python and Nodejs with subprocess
#-*- coding: utf-8 -*-
import subprocess
if __name__ == '__main__':
ps = subprocess.Popen(['nodejs','ps2.js'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
out = ps.communicate(input='http://www.daum.net'.encode())[0]
print(out.decode('utf-8'))
@fguisso
fguisso / funny.md
Last active June 6, 2024 03:26
Funny initial commit messages

Funny initial commit messages

This is where it all begins...
Commit committed
Version control is awful
COMMIT ALL THE FILES!
The same thing we do every night, Pinky - try to take over the world!
Lock S-foils in attack position
This commit is a lie
I'll explain when you're older!