fork download
  1. from boto.ec2.connection import EC2Connection conn_ec2 = EC2Connection('AKIAJA5CZY2PIIEPGOKA','FN4yC8r8664hnQ8HFIoPpvlN99RyOdBgtUIG9SnZ')
  2.  
  3. r = conn_ec2.run_instances('ami-0ac019f4fcb7cb7e6')
  4. instance = r.instances[0]
  5.  
  6. ec2conn = boto.ec2.connect_to_region("us-east-1c", aws_access_key_id='AKIAJRDTZINITXGI2CXQ', aws_secret_access_key='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')
  7.  
  8. sg = conn_ec2.create_security_group("VolyaTkachIvanIllya", "A security lab for labs.")
  9.  
  10. r = conn_ec2.run_instances('ami-0ac019f4fcb7cb7e6',key_name="testkey",instance_type="t2.micro",security_groups=[sg.name])
  11.  
  12. //web server
  13. ec2-54-233-232-167.sa-east-1.compute.amazonaws.com
  14. ubuntu
  15.  
  16. //loading tester
  17. ec2-18-231-166-150.sa-east-1.compute.amazonaws.com
  18. ubuntu
  19.  
  20. ab -r -n10 -c2 http://e...content-available-to-author-only...s.com/
  21.  
  22. //balancer server
  23. ec2-54-166-157-151.compute-1.amazonaws.com
  24.  
  25. http://e...content-available-to-author-only...s.com/
  26.  
  27.  
  28. //balancer
  29.  
  30. conn_elb=boto.connect_elb(aws_access_key_id='AKIAJRDTZINITXGI2CXQ',aws_secret_access_key='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')
  31.  
  32. from boto.ec2.elb import HealthCheck
  33. hc = HealthCheck(interval=20,healthy_threshold=3,unhealthy_threshold=5,target='HTTP:80/')
  34.  
  35.  
  36. //
  37.  
  38. regions=['us-east-1c']
  39. ports=[(80,80,'http')]
  40. lb=conn_elb.create_load_balancer('BalancerServerVVIT',regions,ports)
  41. lb.configure_health_check(hc)
  42.  
  43. //
  44. instance_ids=['i-0aa86aab9f5a6fd72','i-0e36e366c58db4f7f']
  45. lb.register_instances(instance_ids)
  46.  
  47. //
  48.  
  49. ab -r -n10 -c2 http://b...content-available-to-author-only...s.com/
  50.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 125, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./prog.py", line 1
    from boto.ec2.connection import EC2Connection conn_ec2 = EC2Connection('AKIAJA5CZY2PIIEPGOKA','FN4yC8r8664hnQ8HFIoPpvlN99RyOdBgtUIG9SnZ')
                                                         ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/py_compile.py", line 129, in compile
    raise py_exc
py_compile.PyCompileError:   File "./prog.py", line 1
    from boto.ec2.connection import EC2Connection conn_ec2 = EC2Connection('AKIAJA5CZY2PIIEPGOKA','FN4yC8r8664hnQ8HFIoPpvlN99RyOdBgtUIG9SnZ')
                                                         ^
SyntaxError: invalid syntax

stdout
Standard output is empty