Skip to content

Instantly share code, notes, and snippets.

View awinabi's full-sized avatar
🎯
Focusing

Awin Abi awinabi

🎯
Focusing
View GitHub Profile
@awinabi
awinabi / install-comodo-ssl-cert-for-nginx.rst
Created May 24, 2016 12:41 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@awinabi
awinabi / ssl_puma.sh
Last active October 21, 2016 14:13 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
# 3) Generate the csr (Certificate signing request) (Details are important!)
@awinabi
awinabi / gist:559990d856993619b33f7ec115bb8f57
Created March 8, 2019 10:07 — forked from victorlhlam/gist:7019359
Rails 3.1+ force_ssl & HSTS problem

Rails 3.1 introduced force_ssl. You can add config.force_ssl = true in application.rb.

By enabling force_ssl, Rails send a HSTS (HTTP Strict Transport Security) header which will expired in a year.

So if you enabled force_ssl once, even you change the config value to false later, the browser you used to open you app before will still remember this website (using domain to identify) require to use HTTPS, and redirect you to HTTPS connection automatically. You may use chrome://net-internals/#hsts to check the domain list in Google Chrome.

@awinabi
awinabi / Capybara.md
Created March 25, 2019 18:32 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above