Skip to content

Instantly share code, notes, and snippets.

View genothomas's full-sized avatar
🎯
Focusing

Geno Thomas genothomas

🎯
Focusing
View GitHub Profile
@genothomas
genothomas / slack_nagios.sh
Last active October 31, 2018 20:49 — forked from matt448/slack_nagios.sh
Script to post Nagios notifications into a Slack channel
#!/bin/bash
# This script is used by Nagios to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Nagios configuration.
#
# All variables that start with NAGIOS_ are provided by Nagios as
# environment variables when an notification is generated.
# A list of the env variables is available here:
@genothomas
genothomas / README.md
Created March 18, 2019 10:55 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@genothomas
genothomas / doin.php
Created November 17, 2019 13:52 — forked from erikaheidi/doin.php
Dynamically generates an Ansible inventory based on your DigitalOcean droplets
<?php
####################################
# Dynamic Inventory Build Script
# usage: php doin.php > inventory
####################################
$DO_API_TOKEN = 'YOUR_DIGITALOCEAN_API_TOKEN';
$GROUP_NAME = 'servers';
$endpoint = "https://api.digitalocean.com/v2/droplets";
@genothomas
genothomas / nginx-userdata-centos.sh
Created November 17, 2019 14:07 — forked from erikaheidi/nginx-userdata-centos.sh
Simple shell script to install Nginx on CentOS using DigitalOcean's metadata/userdata
#!/bin/bash
yum install epel-release -y
yum install nginx -y
export HOSTNAME=$(curl -s http://169.254.169.254/metadata/v1/hostname)
export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address)
echo Droplet: $HOSTNAME, IP Address: $PUBLIC_IPV4 > /usr/share/nginx/html/index.html
systemctl enable nginx
systemctl start nginx
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Apache on CentOS
# @author Erika Heidi<erika@do.co>
# Usage: ./le-renew.sh [base-domain-name]
# More info: http://do.co/1SHe4eL
#================================================================
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
@genothomas
genothomas / le-renew-apache.sh
Last active November 17, 2019 14:23 — forked from erikaheidi/le-renew.sh
Auto renewal for Let's Encrypt Apache
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Apache on Ubuntu/Debian
# @author Erika Heidi<erika@do.co>
# Usage: ./le-renew-apache.sh [base-domain-name]
# More info: http://do.co/1mbVihI
#================================================================
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
@genothomas
genothomas / le-renew-nginx.sh
Last active November 17, 2019 14:19
Auto renewal for Let's Encrypt Nginx
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Nginx on CentOS
# @author Geno Thomas<me@genothomas.com>
# Usage: ./le-renew-nginx.sh [base-domain-name]
#================================================================
webpath='/usr/share/nginx/html/'
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
@genothomas
genothomas / 2019-https-localhost.md
Created November 17, 2019 14:25 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@genothomas
genothomas / letsencrypt_2019.md
Created November 17, 2019 14:26 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

Keybase proof

I hereby claim:

  • I am genothomas on github.
  • I am genothomas (https://keybase.io/genothomas) on keybase.
  • I have a public key whose fingerprint is FA6A 9EAB 0EE7 4555 8B28 40D8 916B EF80 978B 801D

To claim this, I am signing this object: