Skip to content

Instantly share code, notes, and snippets.

View shweta-nerake1's full-sized avatar

Shweta Nerake shweta-nerake1

  • Infiverve Technologies Pvt Ltd.
  • Pune
View GitHub Profile
@shweta-nerake1
shweta-nerake1 / basic-mqtt-subscriber.py
Created November 6, 2015 15:10
basic-mqtt-subscriber.py
#!/usr/bin/python3
#required libraries
import sys
import ssl
import paho.mqtt.client as mqtt
#called while client tries to establish connection with the server
def on_connect(mqttc, obj, flags, rc):
if rc==0:
@shweta-nerake1
shweta-nerake1 / service_handler.sh
Last active October 27, 2015 11:36
Consul watch handler for the type service
#! /bin/bash
FLINT_HOSTNAME="flint-hostname"
FLINT_USERNAME="flint-username"
FLINT_PASSWORD="flint-password"
FLINTBIT="flintbit"
FLINTBIT_PARAMS="flintbit_params"
consul_http_protocol="http"
consul_hostname="localhost"
consul_http_port="8500"
@shweta-nerake1
shweta-nerake1 / apache2.json
Last active October 26, 2015 07:45
apache2.json
{
"service": {
"name": "apache2",
"address": "192.168.2.11",
"port": 80,
"check": {
"script": "service apache2 status",
"interval": "10s"
}
}
@shweta-nerake1
shweta-nerake1 / execute iot-mqtt-subscriber.py
Created October 15, 2015 14:04
execute iot-mqtt-subscriber.py
python3 iot-mqtt-subscriber.py
@shweta-nerake1
shweta-nerake1 / iot-mqtt-subscriber.py
Last active January 16, 2024 12:29
mqtt-iot-subscriber
#!/usr/bin/python3
#required libraries
import sys
import ssl
import paho.mqtt.client as mqtt
#called while client tries to establish connection with the server
def on_connect(mqttc, obj, flags, rc):
if rc==0: