- Il volto pubblico del nostro prodotto di punta: Opencity Italia
- Quello che cerchiamo/offriamo a un Senior Developer
- Il codice
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
| 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 | |
| # | |
| # 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
| #!/bin/bash | |
| set -ex | |
| if docker plugin inspect loki > /dev/null; then | |
| echo "Loki plugin already installed" | |
| else | |
| docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions | |
| fi |
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
| docker logs -f traefik | \ | |
| goaccess \ | |
| --log-format "%h %^ %e [%d:%t %^] \"%r\" %s %b \"%R\" \"%u\" %^ \"%v\" \"%^\" %Lms" \ | |
| --date-format "%d/%b/%Y" --time-format "%H:%M:%S" |
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 | |
| # vim: autoindent tabstop=2 shiftwidth=2 expandtab softtabstop=2 fileencoding=utf-8 | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
| DEPLOY_CONTEXT= |
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 -e | |
| [[ $DEBUG ]] && set -x | |
| conf=/etc/apt/apt.conf.d/50unattended-upgrades | |
| if [[ ! -f $conf ]]; then | |
| echo "Cannot fine /etc/apt/apt.conf.d/50unattended-upgrades, is this an Ubuntu host?" | |
| exit 1 |
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
| wget $(curl -s https://api.github.com/repos/$USER/$REPO/releases/latest | jq -r '.assets[] | select(.name|match("Linux_x86_64.tar.gz$")) | .browser_download_url') && tar xzvf *.tar.gz kaf |
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
| if ! which byobu >/dev/null; then | |
| echo "Byobu not installed, skip configuration" | |
| exit 1 | |
| fi | |
| [[ ! -f /var/lock/.byobu-shell-fixed ]] && \ | |
| echo "fixes byobu problem with UMASK, now byobu-shell is a login shell" && \ | |
| sed -i -e 's/exec "$SHELL"/exec "$SHELL" --login/' /usr/bin/byobu-shell && \ | |
| touch /var/lock/.byobu-shell-fixed |