Skip to content

Instantly share code, notes, and snippets.

View kitsguru's full-sized avatar

Jeff Shields kitsguru

View GitHub Profile
@kitsguru
kitsguru / how-to-set-up-stress-free-ssl-on-os-x.md
Last active December 7, 2019 16:05 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@kitsguru
kitsguru / ssl_setup_example.sh
Created May 5, 2018 01:45 — forked from mlawrie/ssl_setup_example.sh
Create an SSL Certificate Signing Request on OSX with wildcard and alternate names
# First, generate the key. You will be prompted to enter a password, but we will strip it out in the next step:
openssl genrsa -des3 -out server.orig.key 2048
# Then, stip out the password:
openssl rsa -in server.orig.key -out server.key
# Edit the OSX openssl config file to include your alternate names.
# Edit the 'subjectAltName' field. E.g.:
@kitsguru
kitsguru / ssl_setup_example.sh
Created May 5, 2018 01:45 — forked from mlawrie/ssl_setup_example.sh
Create an SSL Certificate Signing Request on OSX with wildcard and alternate names
# First, generate the key. You will be prompted to enter a password, but we will strip it out in the next step:
openssl genrsa -des3 -out server.orig.key 2048
# Then, stip out the password:
openssl rsa -in server.orig.key -out server.key
# Edit the OSX openssl config file to include your alternate names.
# Edit the 'subjectAltName' field. E.g.:
@kitsguru
kitsguru / aliases
Created January 6, 2017 19:59
aliases for bash
### Aliases
## ssh to dev server
alias sshj='ssh jeff@git.dev.lan'
alias sshg='ssh git@git.dev.lan'
## project scripts
alias cnp="~/bin/createproject2.sh"
alias installPackages="~/bin/installPackages.sh"
alias installbower="~/bin/installbower.sh"

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@kitsguru
kitsguru / .gitignore_global
Created January 6, 2017 18:10
git global ignore x-platform
# gitignore_global
# customized for Jeff Shields projects
# ignore these files and folders
# ignore anything beginning with ~
~*
# the grunt modules
**/node_modules/
@kitsguru
kitsguru / .gitattributes
Created January 6, 2017 18:04
gitattributes for cmsb/bootstrap projects
# Automatically normalize line endings for all text-based files
# https://git-scm.com/docs/gitattributes#_end_of_line_conversion
* text=auto
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For the following file types, normalize line endings to LF on
# checkin and prevent conversion to CRLF when they are checked out
# (this is required in order to prevent newline related issues like,
@kitsguru
kitsguru / gist:8150393
Created December 27, 2013 17:56
LEGAL: server info
NAME:
COMPANY:
ADDRESS:
PHONE:
EMAIL:
DOMAINS:
REGISTRAR:
userid:
@kitsguru
kitsguru / master.shtml
Created December 26, 2013 18:18
HTML: master template
<!--#include virtual="/inc/l-doctype.inc" -->
<!--#include virtual="/inc/l-meta.inc" -->
<title>{1}</title>
<meta name="description" content="{2}">
<!-- this is a test -->
</head>
<body class="p-template">