Skip to content

Instantly share code, notes, and snippets.

View sapozhnikovay's full-sized avatar
🏠
Working from home

Aleksei Sapozhnikov sapozhnikovay

🏠
Working from home
  • @ Bright security ex. JAVAD GNSS
  • Asturias, Spain
View GitHub Profile
@sapozhnikovay
sapozhnikovay / docker-api-port.md
Created December 4, 2020 11:47 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@sapozhnikovay
sapozhnikovay / ypyt_sensor_parse.py
Created April 5, 2020 20:29 — forked from zerog2k/ypyt_sensor_parse.py
reads and parses sensor data of JQ-200 / JQ-300 from ypyt cloud for given device token
#!/usr/bin/env python3
""" reads and parses sensor data from ypyt cloud for given device token """
# see https://github.com/xoseperez/espurna/issues/1644 for more context
import json
import os
import sys
import paho.mqtt.client as mqtt
import time as t
const grid = [
[0, 2, 4, 0, 3, 7, 0, 0, 0],
[0, 0, 9, 0, 2, 6, 3, 0, 0],
[0, 0, 0, 0, 5, 0, 2, 0, 0],
[0, 0, 3, 0, 0, 2, 0, 7, 1],
[0, 6, 1, 0, 4, 0, 0, 0, 0],
[2, 5, 7, 0, 0, 8, 0, 9, 0],
[7, 0, 2, 0, 1, 0, 5, 0, 0],
[0, 0, 0, 0, 0, 4, 1, 0, 9],