Skip to content

Instantly share code, notes, and snippets.

@hpdubs14
hpdubs14 / how-to-set-up-stress-free-ssl-on-os-x.md
Created October 25, 2017 17:16 — 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

@hpdubs14
hpdubs14 / gist:5545157
Created May 9, 2013 02:26
Error log from linode
[Mon May 06 16:59:15 2013] [error] [client 72.8.56.234] Premature end of script headers:
[ pid=26819 thr=3034565440 file=ext/apache2/Hooks.cpp:841 time=2013-05-06 16:59:15.106 ]: The backend application (process 27175) did not send a valid HTTP response; instead, it sent nothing at all. It is possible that it has crashed; please check whether there are crashing bugs in this application.
[ pid=27175 thr=68150260 file=utils.rb:176 time=2013-05-06 16:59:15.106 ]: *** Exception LoadError in application (Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)) (process 27175, thread #<Thread:0x81fc7e8>):
from /home/deploy/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.2/lib/bundler/rubygems_integration.rb:214:in `block in replace_gem'
from /var/www/mccustom/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite3_adapter.rb:3:in `<top (required)>'
from /var/www/mccustom/s
@hpdubs14
hpdubs14 / nagios_log_parser
Created May 2, 2011 04:17
nagios_log_parser
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
require 'CSV'
require 'time'
#Parsing regex patterns
nagios_log = /\w*:(\w+\s\d+)(\s\d+:\d+:\d+)\s+cm-logging-01 nagios:\s+(service alert|service notification|current service state):(\s+cm-pconsole-[0-9]{2}[a-z]);(.*);(\w+);(\w+);(\w+);(\w*):(.*) /i