Skip to content

Instantly share code, notes, and snippets.

View mtbdeano's full-sized avatar

Dean McRobie (he/him) mtbdeano

View GitHub Profile
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@mtbdeano
mtbdeano / ApplySyntax.sublime-settings
Last active August 29, 2015 14:27
Sublime Text - Apply Syntax - Rules for flask Jinja2 templates and Elastic Beanstalk Extensions
{
// If you want exceptions reraised so you can see them in the console, change this to true.
"reraise_exceptions": false,
// If you want to have a syntax applied when new files are created, set new_file_syntax to the name of the syntax to use.
// The format is exactly the same as "syntax" in the rules below. For example, if you want to have a new file use
// JavaScript syntax, set new_file_syntax to 'JavaScript'.
"new_file_syntax": false,
@mtbdeano
mtbdeano / Preferences.sublime-settings
Last active August 29, 2015 14:25
Dean's Python Sublime Settings
{
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/User/SublimeLinter/Solarized (Dark) (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
@mtbdeano
mtbdeano / split_horizonator.py
Created June 29, 2015 21:10
Simple python script to keep Amazon Route 53 public/private split horizon DNS domains in sync
import boto.route53
import boto.ec2
import pprint as pp
def match_domain(domain, region="us-east-1"):
''' iterate through the public EIPs and make sure that if there is a `domain.com` entry for that EIP, it's private IP is also mapped in the private `domain.com`
'''
r53 = boto.route53.connect_to_region(region)
ec2 = boto.ec2.connect_to_region(region)
@mtbdeano
mtbdeano / ipython.conf
Created January 28, 2015 14:39
ubuntu 14.04 IPython upstart script
description "IPython server, after installing ipython and dependencies into /home/ubuntu/.ipython, setup a system daemon to run"
pre-start script
export HOME=/home/ubuntu
end script
script
exec sudo /usr/local/bin/ipython notebook --ipython-dir=/home/ubuntu/.ipython --profile=notebook --pylab=inline --no-browser
end script