Skip to content

Instantly share code, notes, and snippets.

View mattray's full-sized avatar
🇦🇺
in Sydney

Matt Ray mattray

🇦🇺
in Sydney
View GitHub Profile
root@ubuntu1204:~# keystone catalog
Service: volume
+-------------+-----------------------------------------------------------+
| Property | Value |
+-------------+-----------------------------------------------------------+
| adminURL | http://127.0.0.1:8776/v1/c93ffa6ab822465394df81d34e8007da |
| id | 6b3663feed20480880ce4e553a605fed |
| internalURL | http://127.0.0.1:8776/v1/c93ffa6ab822465394df81d34e8007da |
| publicURL | http://127.0.0.1:8776/v1/c93ffa6ab822465394df81d34e8007da |
| region | RegionOne |
ubuntu1204.vm.network "forwarded_port", guest: 443, host: 8443 # dashboard-ssl
ubuntu1204.vm.network "forwarded_port", guest: 5000, host: 5000 # keystone
ubuntu1204.vm.network "forwarded_port", guest: 35357, host: 35357 # keystone
ubuntu1204.vm.network "forwarded_port", guest: 8773, host: 8773 # compute-ec2-api
ubuntu1204.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api
ubuntu1204.vm.network "forwarded_port", guest: 4002, host: 4002 # chef-zero
require 'chef/client'
require 'singleton'
class Chef
# Keep track of the filenames that we use in both eager cookbook
# downloading (during sync_cookbooks) and lazy (during the run
# itself, through FileVendor). After the run is over, clean up the
# cache.
class CookbookCacheCleaner
require 'singleton'
require 'octokit'
class ReleaseNotesGenerator
include Singleton
def release_header?
release_match != nil
end
@mattray
mattray / gist:9262177
Created February 27, 2014 23:45
fog openstack on vagrant localhost
root@ubuntu1204:~# /opt/chef/bin/pry
[1] pry(main)> require 'fog'
=> true
[2] pry(main)> conn = Fog::Compute.new(:provider => 'OpenStack', :openstack_auth_url => "http://127.0.0.1:5000/v2.0/tokens", :openstack_username => 'admin', :openstack_api_key => 'admin', :openstack_tenant => 'admin')
=> #<Fog::Compute::OpenStack::Real:18644500 @openstack_auth_token=nil @auth_token="be89ca6a387442e9bf494adc1fb246b1" @openstack_identity_public_endpoint="http://127.0.0.1:5000/v2.0" @openstack_api_key="admin" @openstack_username="admin" @openstack_tenant="admin" @openstack_auth_uri=#<URI::HTTP:0x0000000238f6b0 URL:http://127.0.0.1:5000/v2.0/tokens> @openstack_management_url="http://127.0.0.1:8774/v2/ec6c3eb97a714b568a4a50d36c84a18c" @openstack_must_reauthenticate=false @openstack_service_type=["nova", "compute"] @openstack_service_name=nil @openstack_identity_service_type="identity" @openstack_endpoint_type="publicURL" @openstack_region=nil @connection_options={:debug_response=>true, :headers=>{"User-Agent"=>"fog/1.20.0"}
conn = Fog::Compute.new(:provider => 'OpenStack', :openstack_auth_url => "http://10.0.100.8:8774/v2.0/tokens", :openstack_username => 'admin', :openstack_api_key => 'admin', :openstack_tenant => 'admin')
Excon::Errors::BadRequest: Expected([200, 204]) <=> Actual(400 Bad Request)
response => #<Excon::Response:0x007f9c1d393990 @data={:body=>"{\"badRequest\": {\"message\": \"The server could not comply with the request since it is either malformed or otherwise incorrect.\", \"code\": 400}}", :headers=>{"Content-Length"=>"141", "Content-Type"=>"application/json; charset=UTF-8", "Date"=>"Thu, 27 Feb 2014 19:26:10 GMT"}, :status=>400, :remote_ip=>"10.0.100.8"}, @body="{\"badRequest\": {\"message\": \"The server could not comply with the request since it is either malformed or otherwise incorrect.\", \"code\": 400}}", @headers={"Content-Length"=>"141", "Content-Type"=>"application/json; charset=UTF-8", "Date"=>"Thu, 27 Feb 2014 19:26:10 GMT"}, @status=400, @remote_ip="10.0.100.8">
from /Users/mray/.chgems/chef/.g
AllCops:
Includes:
- metadata.rb
- Gemfile
- attributes/**
Excludes:
- recipes/**
- spec/**
# UTF-8 headers not generally in these files
#!/usr/bin/ruby
require 'ruby_kml'
# http://www.boutell.com/zipcodes/
# read zipcodes.csv into hash, get lat/long for each zip
zipcodes = {}
File.open('zipcode.csv', 'r') do |file|
file.each_line do |line|
entry = line.gsub('"','').split(",")
# rebase a proposed review
git review -d <gerrit rev num> (from the URL)
git rebase gerrit/master
# resolve any conflicts
git diff
git commit -a --amend
git review -R
# Encoding: utf-8
default['yum']['fedora-updates-testing-source']['enabled'] = false
if node['yum'['fedora-updates-testing-source']['enabled']
default['yum']['fedora-updates-testing-source']['repositoryid'] = 'updates-testing-source'
default['yum']['fedora-updates-testing-source']['description'] = 'Fedora $releasever - Test Updates Source'
default['yum']['fedora-updates-testing-source']['mirrorlist'] = 'https://mirrors.fedoraproject.org/metalink?repo=updates-testing-source-f$releasever&arch=$basearch'
default['yum']['fedora-updates-testing-source']['gpgcheck'] = true
default['yum']['fedora-updates-testing-source']['gpgkey'] = 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch'