- Host multiple sites on a single server
- Use Let's Encrypt and force SSL on all subdomains
- Create an area for Let's Encrypt's ACME verification, but restrict this to specific host headers
- This is so we can auto-renew certs but prevent my server from responding to someone else's bogus enrollment request if they point DNS at my server and it responds to the validation
- Create an https
default_server
fallback, so my sites are isolated if tou type the ipv6only - Top security practices, with an A+ rating on SSLLabs.com scan
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
rm -rf /etc/letsencrypt/live/${DOMAIN} | |
rm /etc/letsencrypt/renewal/${DOMAIN}.conf |
There are two modes when you don't want Certbot to edit your configuration:
- Standalone: replaces the webserver to respond to ACME challenges
- Webroot: needs your webserver to serve challenges from a known folder.
Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.
In the following, we're setting up mydomain.com
to be served from /var/www/mydomain
, and challenges will be served from /var/www/letsencrypt
.
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
cat /dev/null > ~/.bash_history && history -c && exit |
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
#In this example, we're adding C:\bin. I hard coded the path to make it a powershell one liner | |
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\bin", [EnvironmentVariableTarget]::User) |
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
<# | |
.SYNOPSIS | |
Powershell Script that will loop through a folder and run SQL scripts against a database | |
.Description | |
This script was developed to be used with VSTS. It must accept parameters, since VSTS variables cannot be used within scripts. Developers can specify a different SQL folder with each build | |
.NOTES | |
Version: 1.0.1 | |
Author: jcefoli |
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 | |
if [ "$(whoami)" != "root" ]; then | |
echo -e "Sorry, you are not running as root.\nPlease run this script as root.\n\nExiting..."; | |
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
powershell.exe -ExecutionPolicy Bypass -Command "& {C:\YourScript.ps1 -Parameter 'Value'}" |
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 will install Ruby using rbenv on the Windows 10 Ubuntu Subsystem | |
## The travis gem did not compile correctly when I installed via 'apt-get install ruby' but worked using this method | |
sudo apt-get -y install build-essential libreadline-dev zlib1g-dev | |
cd ~ | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc |