Skip to content

Instantly share code, notes, and snippets.

View n1zyy's full-sized avatar
:octocat:

Matt W. n1zyy

:octocat:
  • Boston, MA
  • 03:41 (UTC -04:00)
View GitHub Profile
@n1zyy
n1zyy / gist:1832069
Created February 15, 2012 00:36
Tinkering with deltacloud-client
# Nothing revolutionary, but here are some random examples of interacting
# with deltacloud-client using Conductor's Rails console.
# Find the mock provider (because it's what I wanted to use)
provider = Provider.find_by_name 'mock'
# Get its account (modify this if you don't actually want the first one)
account = provider.provider_accounts.first
# Get a connection
@n1zyy
n1zyy / gist:1832019
Created February 15, 2012 00:27
Testing patch for #790516
# Stop the 'real' dbomatic:
sudo service conductor-dbomatic stop
# Start the one in src/ in the foreground and log to stdout:
dbomatic/dbomatic -n -l -
# Also, note that you can manipulate "instances" on Deltacloud's mock driver.
# They live in /var/tmp/deltacloud-mock-nobody/instances/ as YAML files.
# It seems you do not need to start Deltacloud for them to take effect.
#
@n1zyy
n1zyy / gist:1827545
Created February 14, 2012 15:25
Aeolus dev: tasks
namespace :dev do
desc "Setup and run cucumber and rspec"
task :tests => ["db:migrate", :cucumber, :spec] do |t|
end
desc "Generate PDF of models"
# This requires the railroad gem and graphviz (dot)
task :model_pdf do |t|
system "railroad -a --hide-magic -ij -o project.dot -M"
@n1zyy
n1zyy / gist:1562299
Created January 4, 2012 21:39
aeolus-image-rubygem with OAuth
# Install the RPM at http://people.redhat.com/mawagner/rpms/rubygem-aeolus-image-0.3.0-0.20120104161149gitc13b654.fc15.noarch.rpm
# It includes some debugging output you'll see in irb
#
# Then start irb (from anywhere)
require 'rubygems'
#=> false
require 'aeolus_image'
#=> true
@n1zyy
n1zyy / gist:1518665
Created December 25, 2011 02:56
WordPress on Apache -- APC disabled
$ ab -c100 -t 30 http://blogs.n1zyy.com/n1zyy
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking blogs.n1zyy.com (be patient)
Finished 143 requests
Server Software: Apache/2.2.15
@n1zyy
n1zyy / gist:1518659
Created December 25, 2011 02:49
Sample varnish.vcl
acl purge {
"localhost";
"127.0.0.1";
}
#backend default {
# .host = "127.0.0.1";
# .port = "8080";
#}
@n1zyy
n1zyy / gist:1518654
Created December 25, 2011 02:42
WordPress with varnish -- cache enabled
$ ab -c100 -t 30 http://blogs.n1zyy.com/n1zyy
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking blogs.n1zyy.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
@n1zyy
n1zyy / gist:1518652
Created December 25, 2011 02:41
WordPress on Apache -- WP Super Cache enabled
$ ab -c100 -t 30 http://blogs.n1zyy.com/n1zyy
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking blogs.n1zyy.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
@n1zyy
n1zyy / gist:1518649
Created December 25, 2011 02:40
WordPress on Apache -- APC enabled, no page caching
$ ab -c100 -t 30 http://blogs.n1zyy.com/n1zyy
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking blogs.n1zyy.com (be patient)
Finished 969 requests
Server Software: Apache/2.2.15
@n1zyy
n1zyy / gist:1385851
Created November 22, 2011 14:58
Testing image import
# Import an imaginary image from mock
>> img = Aeolus::Image::Factory::Image.new(:target_identifier => 'ami-ahmee', :target_name => 'mock', :provider_name => 'mock', :image_descriptor => '<image><name>ami-amigo</name></image>')
=> #<Aeolus::Image::Factory::Image:0x7f1b83fca058 @prefix_options={}, @attributes={"target_identifier"=>"ami-ahmee", "target_name"=>"mock", "provider_name"=>"mock", "image_descriptor"=>"<image><name>ami-amigo</name></image>"}
# Save! the image to send Factory the build request
>> img.save!
=> true
# pp img
>> img