Permalink
Browse files

Fix a handful of doc and help-text issues.

  • Loading branch information...
1 parent 38d7947 commit cca7eb0eaa144b93bb86c46ba92cc64858cf20a5 @onyxfish onyxfish committed Jul 25, 2011
Showing with 29 additions and 16 deletions.
  1. +9 −5 README.textile
  2. +13 −7 beeswithmachineguns/main.py
  3. +2 −2 requirements.txt
  4. +5 −2 setup.py
View
@@ -36,7 +36,7 @@ pip install -r requirements.txt
h2. Configuring EC2 credentials
-Bees uses boto to communicate with EC2 and thus supports all the same methods of storing credentials that it does. These include declaring environment variables, machine-global configuration files, and per-user configuration files. You can read more about these options on "boto's configuration page":http://code.google.com/p/boto/wiki/BotoConfig
+Bees uses boto to communicate with EC2 and thus supports all the same methods of storing credentials that it does. These include declaring environment variables, machine-global configuration files, and per-user configuration files. You can read more about these options on "boto's configuration page":http://code.google.com/p/boto/wiki/BotoConfig.
h2. Usage
@@ -50,6 +50,10 @@ bees down
This spins up 4 servers in security group 'public' using the EC2 keypair 'frakkingtoasters', whose private key is expected to reside at ~/.ssh/frakkingtoasters.pem.
+Note: the default EC2 security group is called 'default' and by default it locks out SSH access. I recommend creating a 'public' security group for use with the bees and explicitly opening port 22 on that group.
+
+Note 2: Always include a trailing slash when testing a root domain. The underlying load-testing tool (ab) doesn't support raw domains.
+
It then uses those 4 servers to send 10,000 requests, 250 at a time, to attack OurNewWebbyHotness.com.
Lastly, it spins down the 4 servers. *Please remember to do this*--we aren't responsible for your EC2 bills.
@@ -62,21 +66,21 @@ bees -h
h2. The caveat! (PLEASE READ)
-(The following was cribbed from our "original blog post about the bees":http://blog.apps.chicagotribune.com/2010/07/08/bees-with-machine-guns/)
+(The following was cribbed from our "original blog post about the bees":http://blog.apps.chicagotribune.com/2010/07/08/bees-with-machine-guns/.)
If you decide to use the Bees, please keep in mind the following important caveat: they are, more-or-less a distributed denial-of-service attack in a fancy package and, therefore, if you point them at any server you don’t own you will behaving *unethically*, have your Amazon Web Services account *locked-out*, and be *liable* in a court of law for any downtime you cause.
You have been warned.
h2. Bugs
-Please log your bugs on the "Github issues tracker":http://github.com/newsapps/beeswithmachineguns/issues
+Please log your bugs on the "Github issues tracker":http://github.com/newsapps/beeswithmachineguns/issues.
h2. Credits
-The bees are a creation of the News Applications team at the Chicago Tribune--visit "our blog":http://apps.chicagotribune.com/ and read "our original post about the project":http://blog.apps.chicagotribune.com/2010/07/%2008/bees-with-machine-guns/
+The bees are a creation of the News Applications team at the Chicago Tribune--visit "our blog":http://apps.chicagotribune.com/ and read "our original post about the project":http://blog.apps.chicagotribune.com/2010/07/%2008/bees-with-machine-guns/.
-Initial refactoring code and inspiration from "Jeff Larson":http://github.com/thejefflarson
+Initial refactoring code and inspiration from "Jeff Larson":http://github.com/thejefflarson.
Thanks to everyone who reported bugs against the alpha release.
@@ -25,9 +25,12 @@
"""
import bees
+import re
import sys
from optparse import OptionParser, OptionGroup
+NO_TRAILING_SLASH_REGEX = re.compile(r'^.*?\.\w+$')
+
def parse_options():
"""
Handle the command line arguments for spinning up bees
@@ -94,26 +97,29 @@ def parse_options():
(options, args) = parser.parse_args()
if len(args) <= 0:
- parser.error("Please enter a command.")
+ parser.error('Please enter a command.')
command = args[0]
- if command == "up":
+ if command == 'up':
if not options.key:
parser.error('To spin up new instances you need to specify a key-pair name with -k')
if options.group == 'default':
print 'New bees will use the "default" EC2 security group. Please note that port 22 (SSH) is not normally open on this group. You will need to use to the EC2 tools to open it before you will be able to attack.'
bees.up(options.servers, options.group, options.zone, options.instance, options.login, options.key)
- elif command == "attack":
+ elif command == 'attack':
if not options.url:
- parser.error("To run an attack you need to specify a url with -u")
-
+ parser.error('To run an attack you need to specify a url with -u')
+
+ if NO_TRAILING_SLASH_REGEX.match(options.url):
+ parser.error('It appears your URL lacks a trailing slash, this will disorient the bees. Please try again with a trailing slash.')
+
bees.attack(options.url, options.number, options.concurrent)
- elif command == "down":
+ elif command == 'down':
bees.down()
- elif command == "report":
+ elif command == 'report':
bees.report()
View
@@ -1,2 +1,2 @@
-boto
-paramiko
+boto==2.0
+paramiko==1.7.7.1
View
@@ -3,15 +3,18 @@
from distutils.core import setup
setup(name='beeswithmachineguns',
- version='0.1.0',
+ version='0.1.1',
description='A utility for arming (creating) many bees (micro EC2 instances) to attack (load test) targets (web applications).',
author='Christopher Groskopf',
author_email='cgroskopf@tribune.com',
url='http://github.com/newsapps/beeswithmachineguns',
license='MIT',
packages=['beeswithmachineguns'],
scripts=['bees'],
- install_requires=['boto', 'paramiko'],
+ install_requires=[
+ 'boto==2.0',
+ 'paramiko==1.7.7.1'
+ ],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',

0 comments on commit cca7eb0

Please sign in to comment.