Skip to content

Instantly share code, notes, and snippets.

View n1zyy's full-sized avatar
:octocat:

Matt Wagner n1zyy

:octocat:
View GitHub Profile
@n1zyy
n1zyy / gist:1203568
Created September 8, 2011 14:44
IMAP Subscriptions with Ruby's net/imap
require 'net/imap'
# There's a disconnect between the docs: http://ruby-doc.org/stdlib/libdoc/net/imap/rdoc/index.html
# and reality. This is what works for me:
# Log in using SSL... Note that this syntax doesn't match the docs at all...
# 3rd option is use_ssl
imap = Net::IMAP.new('mail.example.com', 993, true)
imap.login('username', 'password')
# All folders/mailboxes
@n1zyy
n1zyy / gist:1301347
Created October 20, 2011 14:55
Sample Conductor settings.yml
:default_deltacloud_url: http://localhost:3002/api
:auth:
# supported strategies: database, ldap
:strategy: database
:ldap:
:host: localhost
# '%s' expression in username_dn string will be replaced
# by user's login
# username_dn: "deltacloud\%s"
@n1zyy
n1zyy / gist:1301361
Created October 20, 2011 15:00
Quick smoketest of aeolus-image-rubygem with iwhd
# Run this in IRB, of course
# Bring in aeolus-image-rubygem
require 'lib/aeolus_image'
# Load a config file; sample at https://gist.github.com/1301347
# In Conductor, we will do this setup automatically
# You want to pay attention to the :iwhd: section, of course. Note that :weird: YAML syntax.
# My iwhd is running like so:
# iwhd -c /etc/iwhd/conf.js -d localhost:27017 -l /var/log/iwhd.log -o -U user:password
@n1zyy
n1zyy / gist:1302055
Created October 20, 2011 19:26
Sample Fedora 14 template for oz/Factory
<template>
<name>f14jeos</name>
<os>
<name>Fedora</name>
<version>14</version>
<arch>x86_64</arch>
<install type='url'>
<url>http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/os/</url>
</install>
<rootpw>test</rootpw>
@n1zyy
n1zyy / gist:1302062
Created October 20, 2011 19:27
Quick smoketest of aeolus-image-rubygem with Factory
require 'lib/aeolus_image.rb'
# You might want to start imagefactory like so:
# sudo imagefactory --rest --debug
# It must be run as root in order to build images.
# There's a --no_ssl flag if it aids in debugging, but don't use it for testing this patch, as it should work with SSL.
# The credentials are in /etc/imagefactory/imagefactory.conf but I use the default below:
# The purpose of my patch is to add OAuth support on top of the existing API, so any existing call should work.
# Note that Factory does *not* protect GETs with OAuth, only write operations.
@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
@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: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: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: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";
#}