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 / docker-compose.mosquitto-init.yml
Created October 23, 2023 20:22
Forwards Compatibililty for Eclipse Mosquitto MQTT Broker with Docker Init Containers and Docker Compose v2 include
# Docker Init Container
# Alpine Container that changes the File Permissions and Ownership
# of the mounted configuration files
# NOTE: WILL ALWAYS BE EXECUTED BEFORE THE MAIN MOSQUITTO CONTAINER
# NOTE: WILL ALSO PERMANENTLY CHANGE THE FILE PERMISSIONS/OWNERSHIP ON HOST
services:
mosquitto_init:
image: docker.io/alpine:3.18
container_name: mosquitto_init
command: sh -c "chmod 0400 -R /config/ && chown -R 1883:1883 /config/"
@shantanoo-desai
shantanoo-desai / main.go
Last active October 13, 2023 17:29
AoC-2015-Day4
package main
import (
"crypto/md5"
"fmt"
"math"
"sort"
"strconv"
"sync"
"time"
@shantanoo-desai
shantanoo-desai / test_upload_flow.yml
Last active August 2, 2023 14:43
Custom ansible Plugin to update nodered flow
---
- hosts: localhost
gather_facts: false
tasks:
- name: test upload flow to nodered
nodered_flow:
nodered_url: http://localhost/nodered
nodered_user: admin
nodered_password: testnodered
path: "{{ playbook_dir}}/flows_test.json"
@shantanoo-desai
shantanoo-desai / .env
Created July 20, 2023 12:07
INIT_ADMIN_TOKEN with and without _FILE suffix env var problem for InfluxDBv2
INFLUXDBV2_ADMIN_USERNAME=admin
INFLUXDBV2_ADMIN_PASSWORD=testInfluxDB
INFLUXDBV2_ADMIN_TOKEN=testtoken
DOCKER_INFLUXDB_INIT_ORG=komponistorg
DOCKER_INFLUXDB_INIT_BUCKET=komponistdb
DOCKER_INFLUXDB_INIT_RETENTION=7d
TELEGRAF_MQTT_USERNAME=admin
TELEGRAF_MQTT_PASSWORD=test
include: '.gitlab-ci-config.yml'
stages:
- single_test
{% for testcase in tests %}
test_{{ testcase.number }}:
extends:
- .test
script:
@shantanoo-desai
shantanoo-desai / README.md
Last active March 14, 2023 11:33
trial with secretstore plugin JOSE from Telegraf

Trials with Secretstores JOSE in Telegraf using Docker

generate secret

docker run -u 1000  \
          -v $(pwd)/telegraf.toml:/etc/telegraf/telegraf.conf:ro \
          -v $(pwd):/etc/telegraf \
          telegraf:latest telegraf secrets set jose_test opcua_password testpassword
@shantanoo-desai
shantanoo-desai / .env
Created March 13, 2023 13:38
Telegraf SecretStore to connect to an OPCUA Server
OPCUA_USER=user1
OPCUA_PASSWORD=supersecretstuff
- hosts: all
gather_facts: false
vars_files:
- defaults/main.yml
- vault.yml
tasks:
- name: Do Not Execute Playbook if No Flows File extra variable is mentioned
fail:
msg: >
---
- hosts: 127.0.0.1
connection: local
roles:
- appstack
@shantanoo-desai
shantanoo-desai / README.md
Last active September 15, 2022 15:24
Creating a Root Filesystem for Ubuntu 20.04 ARM64 using Hashicorp Packer + Docker

From Docker Container to Bootable Disk Images but with Packer

Source based on Blog Post @iximiuz (Ivan Velichko)

Putting it together

  1. Create the Filesystem Tarball with Kernel and SystemD