GET /devices List device classes POST /devices/create Create a new device class GET /devices/{id} Inspect a device class POST /devices/{id}/update Update a device class DELETE /devices/{id} Delete a device class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # This script clean a docker swarm cluster from all the dead worker nodes | |
| # | |
| # docker node ls output example | |
| # ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION | |
| #y4000************e1uv5vdj * boat-manager-c240 Ready Active Reachable 19.03.11 | |
| #wlqc4************zywu7z90 boat-manager-cb78 Ready Active Reachable 19.03.8 | |
| #i9fz8************rkmn98yh boat-manager-e102 Ready Active Leader 19.03.8 | |
| #wgrj7************rj8sglzg boat-tank01-9a5b Down Active 19.03.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| createbuckets: | |
| image: minio/mc | |
| networks: | |
| - backplane | |
| depends_on: | |
| - minio | |
| entrypoint: > | |
| /bin/sh -c " | |
| while ! nc -z minio 9000; do echo 'Wait minio to startup...' && sleep 0.1; done; | |
| sleep 5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DB_LIST='sdc | |
| sdc_bugliano | |
| sdc_ala | |
| sdc_treville' | |
| for DB in $DB_LIST; do | |
| pg_dump $DB > $DB.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM php:7.2.26-fpm-stretch | |
| # Fixed version with OS Debian strech for the issue here explained | |
| # https://github.com/docker-library/php/issues/865 | |
| # Set defaults for variables used by run.sh | |
| ENV COMPOSER_HOME=/root/.composer | |
| # Create Composer directory (cache and auth files) & Get Composer | |
| RUN mkdir -p $COMPOSER_HOME \ | |
| && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM alpine | |
| RUN set -x \ | |
| && apk update && apk add ca-certificates curl \ | |
| && curl -L https://github.com/odise/go-cron/releases/download/v0.0.7/go-cron-linux.gz | zcat > /usr/local/bin/go-cron \ | |
| && chmod a+x /usr/local/bin/go-cron \ | |
| && apk del ca-certificates | |
| ENV SCHEDULE '@daily' | |
| ENV HEALTHCHECK_PORT 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| source_file="https://bazaar.launchpad.net/~run-one/run-one/trunk/download/head:/runone-20110124065624-91p2i9nu34o1aq4k-2/run-one" | |
| other_commands="keep-one-running | |
| run-one-constantly | |
| run-one-until-failure | |
| run-one-until-success | |
| run-this-one" | |
| bin_path=${INSTALL_PATH:-/usr/local/bin} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # set hostname to current name with the last 4 chars of instance id | |
| # | |
| id=$(ec2metadata --instance-id) | |
| myname=${HOSTNAME}-${id:(-4)} | |
| hostnamectl set-hostname $myname | |
| sed -i "s/${HOSTNAME}/${myname}/g" /etc/hosts | |
| echo "New hostname is $myname" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # a simple log function in bash | |
| # usage: | |
| # log "my info message" | |
| # log "my debug message" debug | |
| log_level=info | |
| # uncomment next line to rise up log level | |
| #log_level=debug | |
| log() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -ex | |
| if [[ ! -f /usr/local/bin/docker-compose ]]; then | |
| sudo apt install -y curl | |
| curl -s https://api.github.com/repos/docker/compose/releases/latest \ | |
| | grep browser_download_url \ | |
| | grep docker-compose-Linux-x86_64 \ | |
| | cut -d '"' -f 4 \ |