Skip to content

Instantly share code, notes, and snippets.

Noah Kantrowitz coderanger

Block or report user

Report or block coderanger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@coderanger
coderanger / talk.md
Last active Dec 28, 2015
PyCon 2016 Submission
View talk.md

Behind Closed Doors: Managing Passwords in a Dangerous World

Description

A modern application has a lot of passwords and keys floating around. Encryptions keys, database passwords, and API credentials; often typed in to text files and forgotten. Fortunately a new wave of tools are emerging to help manage, update, and audit these secrets. Come learn how to avoid being the next TechCrunch headline.

Abstract

Secrets come in many forms, passwords, keys, tokens. All crucial for the operation of an application, but each dangerous in its own way. In the past, many of us have pasted those secrets in to a text file and moved on, but in a world of config automation and ephemeral microservices these patterns are leaving our data at greater risk than ever before.

@coderanger
coderanger / django.rb
Created Aug 7, 2015
Rails vs. Django deployment
View django.rb
application '/srv/myapp' do
git 'https://github.com/example/myapp.git'
virtualenv
pip_requirements
django do
database 'sqlite:///test_django.db'
secret_key 'd78fe08df56c9'
migrate true
end
gunicorn do
@coderanger
coderanger / editor.rb
Last active Oct 14, 2015 — forked from Sauraus/editor.rb
Unity cookbook
View editor.rb
require 'chef/resource'
require 'chef/provider'
module Unity
module Resources
module UnityEditor
# A 'unity_editor' resource to install and uninstall Unity Editor.
class Resource < Chef::Resource::LWRPBase
self.resource_name = :unity_editor
@coderanger
coderanger / next.rb
Last active Aug 29, 2015
What properties could look like.
View next.rb
#
# Copyright 2015, Noah Kantrowitz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@coderanger
coderanger / glim_farming.py
Created Jun 6, 2015
Monte carlo simulation for Glim Farming in with Lyme.
View glim_farming.py
import math
import random
import statistics
def run_Take_on_a_Clay_Pupil(state):
state['cp'] = 1
def run_Reading_and_writing(state):
"""Requires Pygmalion 1."""
state['glim'] += 105
@coderanger
coderanger / gmos.md
Created Apr 23, 2015
GMOs: Not That Dangerous
View gmos.md

Okay, so lets rewind a bit. Roundup is a brand name used by Monsanto for a type of herbicide called "glyphosphate" While it was under patent protection for 20 years, those patents all expired back in 2000 so now many companies market similar herbicides. These products are used by farmers to kill off smaller plants like grasses and bacteria that spread in the wild and would use nutrients in the soil that the farmer would rather be absorbed by their crops. It does this by blocking the creation of a few key proteins needed by all cells. This doesn't affect insects for the most part as animals don't make these proteins ourselves, we have to eat them ("essential amino acids"). But in plants, it kills them by denying them these required proteins.

Enter "Roundup Ready Soybeans" (and others, soybeans were the first though). They took genes from a few sources (a specific bacterium, a virus that infects cauliflowers, and a petunia flower) and combined to create a new method to synthesize those essential proteins, spec

@coderanger
coderanger / my_resource.rb
Created Mar 17, 2015
Example blank Halite resource
View my_resource.rb
#
# Copyright 2015, Noah Kantrowitz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@coderanger
coderanger / travis.rb
Last active Jan 20, 2016
WIP knife travis plugin.
View travis.rb
require 'chef/knife'
module Poise
class Travis < Chef::Knife
include Chef::Mixin::ShellOut
deps do
require 'yaml'
require 'kitchen'
end
@coderanger
coderanger / gen_travis.rb
Created Nov 14, 2014
Travis harness generators
View gen_travis.rb
#!/usr/bin/env ruby
require 'yaml'
# Make sure we never commit this stuff accidentally
IO.write('.gitignore', ".docker.*\n", mode: 'a') unless IO.read('.gitignore').include?('.docker.*')
# Generate a new client key
unless File.exists?('.docker.crt')
CA_BASE = File.expand_path('~/src/docker-ca')
View berks-api-lite.rb
#!/usr/bin/env ruby
require 'json'
require 'openssl'
require 'tempfile'
require 'fog'
BUCKET = 'something'
ROOT = File.expand_path('..', __FILE__)
UNIVERSE = {}
You can’t perform that action at this time.