Skip to content

Instantly share code, notes, and snippets.

View shantanoo-desai's full-sized avatar

Shan Desai shantanoo-desai

View GitHub Profile
@shantanoo-desai
shantanoo-desai / README.md
Last active September 12, 2022 13:24
Create `admin` user in cloud-init

Creating a user called admin using cloud-init

Cloud-Init may not create a user literally called admin even though the configuration might be valid.

Debugging

Log files are available:

cat /var/log/cloud/cloud-init.log
cat /var/log/cloud/cloud-init-output.log
version: "3"
services:
chronograf:
image: chronograf:{{ services.chronograf.version }}
container_name: chronograf
{% if 'influxdb' in services %}
depends_on:
- influxdb
{% endif %}
environment:
@shantanoo-desai
shantanoo-desai / .env.node-red
Last active July 15, 2022 15:56
Exploring the marshland of Docker Compose Versions with single quotes, special characters and environment variables using Vagrant and Ansible
# Encrypting plain-text password with value `password` with bcyrpt
NODERED_ADMIN_PASSWORD=$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.
@shantanoo-desai
shantanoo-desai / registry-docker.sh
Created July 1, 2022 08:57
Bash Script to add a Private Image Registry to your Local Machine with Docker
#!/bin/env bash
# Bash script to insert a private registry as "insecure-registries" for Docker Daemon
# as well as configure the Docker Config File to store the credentials locally
# Version: 0.1.0
# Authors: Shan Desai <[email protected]>
set -e
JQ=`which jq`
DOCKER=`which docker`
SPONGE=`which sponge`
@shantanoo-desai
shantanoo-desai / docker-compose.yml
Created June 9, 2022 21:04
Securing node-RED Container with `htpasswd`
# Usage: docker compose up -d
# docker compose logs
# docker compose down
services:
node-red:
image: nodered/node-red:2.2.2-12-minimal
container_name: secure_nodered
env_file:
- ./node-red.env
@shantanoo-desai
shantanoo-desai / manifest.json
Last active June 2, 2022 15:08
Cockpit SSH tunnel Spawning
{
"version": 0,
"tools": {
"opcuaPF": {
"label": "OPC-UA Port Forwarding",
"path": "opcuaPF.html"
}
}
}
@shantanoo-desai
shantanoo-desai / README.md
Created April 6, 2022 16:10
InfluxDBv2 with telegraf behind a Traefik Reverse-Proxy

InfluxDBv2 UI behind Traefik Reverse-Proxy

Render your InfluxDB v2 UI behind a Traefik Reverse-Proxy

InfluxDBv2 does not provide any configuration flags / environment variables that can help render the UI as paths e.g. /influxdb. However, there is a potential way to circumvent this problem but using Host in Traefik.

NOTE: PLEASE DO NOT DEPLOY THIS STACK IN PRODUCTION.

@shantanoo-desai
shantanoo-desai / .env
Last active July 19, 2023 20:29
Out-of-the-Box InfluxDBv2 + Telegraf with env variables (not best-practice) with docker-compose
DOCKER_INFLUXDB_INIT_MODE=setup
DOCKER_INFLUXDB_INIT_ORG=Edgy
DOCKER_INFLUXDB_INIT_BUCKET=data
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=edgestack
DOCKER_INFLUXDB_INIT_USERNAME=admin
DOCKER_INFLUXDB_INIT_PASSWORD=edgestack
@shantanoo-desai
shantanoo-desai / docker-compose.yml
Created March 8, 2022 16:24
Using Docker Secret as a file without using Docker Swarm for Portainer
version: '3.7'
services:
portainer:
image: portainer/portainer-ce:latest
container_name: sys_portainer
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command:
- '--admin-password-file=/run/secrets/portainer_admin_password'
@shantanoo-desai
shantanoo-desai / mosquitto-broker.sh
Created August 3, 2021 13:43
Simple Paho MQTT Python Script to simultaneously publish/subscribe to a broker
#!/bin/bash
/usr/bin/docker run --name=mosquitto-broker -p 1883:1883 \
-v $(pwd)/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf \
eclipse-mosquitto:2.0
exit 0