Skip to content

Instantly share code, notes, and snippets.

@Roman-Sky
Roman-Sky / install-docker.sh
Last active September 29, 2018 09:15
Check Docker Compose version before installing
#! /bin/bash
set -x
set -e
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
@Roman-Sky
Roman-Sky / certbot.sh
Last active March 11, 2024 04:10
Get Let's Encrypt Wildcard-certificate by performing DNS Challenge using Reg.ru API
# 1. Allow access from server's IP to reg.ru API: https://www.reg.ru/user/prefs/security
# 2. Set your username and password to reg.ru account in reg_ru_add.sh and reg_ru_delete.sh
apt-get install -y jq
certbot certonly --server "https://acme-v02.api.letsencrypt.org/directory" \
-n --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns --manual \
-d "example.com" -d "*.example.com" -d "*.abc.example.com" \
--manual-auth-hook /root/reg_ru/reg_ru_add.sh \
--manual-cleanup-hook /root/reg_ru/reg_ru_delete.sh \
--deploy-hook "service nginx reload"