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
| import telegram | |
| import subprocess | |
| bot = telegram.Bot(token='YOUR_BOT_TOKEN') | |
| chat_id = 'YOUR_CHAT_ID' | |
| def check_docker_health(container_name): | |
| try: | |
| output = subprocess.check_output(["docker", "inspect", "-f", "{{json .State.Health.Status}}", container_name]) | |
| if "healthy" in output: |
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 | |
| # Check if the Docker container is running | |
| if [ "$(docker inspect -f '{{.State.Running}}' container_name)" = "true" ]; then | |
| echo "Docker container is running." | |
| else | |
| echo "Docker container is not running." | |
| exit 1 | |
| 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
| #cloud-config | |
| packages: | |
| - certbot | |
| package_update: true | |
| package_upgrade: true | |
| runcmd: | |
| - mkdir xui && cd xui && wget https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh | |
| - certbot certonly --standalone -d change-this-domain.com --register-unsafely-without-email --non-interactive --agree-tos | |
| - cp -r /etc/letsencrypt/live/ ~/certs/ | |
| - echo "(!)Reboot server" |
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 -x | |
| backup_dir="/mnt/storage/backups/serverdb" | |
| db_backup="/mnt/storage/backups/serverdb/dumps-$(date -I)" | |
| db_user="root" | |
| hostname=$(hostname) | |
| mkdir -p "$db_backup" |
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 | |
| # | |
| # Key things to remember, no spaces in pathnames, and try to use full paths (beginning with / ) | |
| # | |
| # now fill in these few variables for me | |
| # change to use | |
| # FTP username and Pass |
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 | |
| # You may want to change this | |
| # Or make a secret variable | |
| TELEGRAM_BOT_TOKEN="" | |
| TELEGRAM_CHAT_ID="" | |
| TIME="10" | |
| URL="https://api.telegram.org/bot$${TELEGRAM_BOT_TOKEN}/sendMessage" | |
| GITLAB_USER_NAME=$(echo $GITLAB_USER_NAME | sed 's/ /%20/g') |
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 | |
| TIME="10" | |
| TEXT="Deploy status: $${1}\nProject: $CI_PROJECT_NAME\nURL: $CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID/\nBranch: $CI_COMMIT_REF_SLUG\nUser: $${GITLAB_USER_NAME}" | |
| curl -s -X POST --max-time $${TIME} \ | |
| -H "X-Auth-Token: Token" \ | |
| -H "X-User-Id: Id" \ | |
| -H "Content-type:application/json" \ | |
| https://example.org/api/v1/chat.postMessage \ |
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
| services: | |
| traefik: | |
| image: traefik:v2.10.4 | |
| restart: unless-stopped | |
| command: | |
| - "--serverstransport.insecureskipverify=true" | |
| - "--log.level=ERROR" | |
| - "--accesslog=true" |
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
| services: | |
| web: | |
| labels: | |
| - "traefik.http.routers.proj.rule=Host(`proj.traefik.me`)" | |
| - "traefik.http.services.proj.loadbalancer.server.port=8000" | |
| - "traefik.docker.network=traefik" | |
| networks: | |
| - default | |
| - traefik |
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
| services: | |
| sshesame: | |
| image: ghcr.io/jaksi/sshesame | |
| ports: | |
| - "0.0.0.0:22:2022" | |
| logging: | |
| driver: "json-file" | |
| options: | |
| max-size: "10m" | |
| max-file: "5" |