Skip to content

Instantly share code, notes, and snippets.

View ekohl's full-sized avatar

Ewoud Kohl van Wijngaarden ekohl

View GitHub Profile
@ekohl
ekohl / graph.py
Last active December 27, 2018 16:18
Foreman Installer dependencies
#!/usr/bin/env python3
import argparse
import json
def normalize_name(module):
full_name = module.replace('-', '/', 1).lower()
author, name = full_name.split('/', 1)
return name if author in ('theforeman', 'katello') else full_name
#!/usr/bin/env ruby
require 'puppet_forge'
require 'semantic_puppet'
require 'yaml'
require 'uri'
FILENAME = ['.fixtures.yaml', '.fixtures.yml'].find { |filename| FileTest.exists? filename }
def find_version(name, puppet)
mod = PuppetForge::Module.find name.gsub('/', '-')
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
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

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ekohl
ekohl / libvirt2ganeti.py
Created February 22, 2011 11:17
Initial stab at libvirt to ganeti
import libvirt
from lxml import etree
sort_disks = lambda d: next(d.iter("target")).get("dev")
def main(host, opts):
#Connect to some hypervisor.
conn=libvirt.open("qemu:///system")
#Iterate through all available domains.
#!/usr/bin/python
from BeautifulSoup import BeautifulSoup
import portage
import urllib2
url = 'http://www.gentoo.org/proj/en/qa/treecleaners/maintainer-needed.xml'
# Build a to remove set
f = urllib2.urlopen(url)
soup = BeautifulSoup(f.read())