This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from fabric.api import sudo, env, put | |
| import configuration as config | |
| import socket, time | |
| env.hosts = open('hosts_file', 'r').readline().rstrip() | |
| env.user = config.USERNAME | |
| env.port = '22' | |
| env.key_filename = config.KEY_FILE | |
| env.warn_only = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import requests | |
| from bs4 import BeautifulSoup | |
| requests.packages.urllib3.disable_warnings() | |
| urls = [ | |
| 'http://marshyski.com/', | |
| 'http://marshyski.com/man-behind-the-keyboard/', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% block body %} | |
| <body> | |
| <center> | |
| {% for line in result %} | |
| {{ line }} | |
| {% endfor %} | |
| </center> | |
| </body> | |
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import flask | |
| import requests | |
| from jinja2 import Environment | |
| from jinja2.loaders import FileSystemLoader | |
| requests.packages.urllib3.disable_warnings() | |
| app = flask.Flask(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| reservations = ec2.get_all_instances(filters={"tag:Purpose": "Web"}) | |
| for res in reservations: | |
| for inst in res.instances: | |
| if inst.private_ip_address: | |
| if inst.state == 'running': | |
| print inst.private_ip_address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import requests | |
| from bs4 import BeautifulSoup | |
| requests.packages.urllib3.disable_warnings() | |
| urls = [ | |
| 'https://192.168.1.100/nodes/failed?per_page=all', | |
| 'https://192.168.1.200/nodes/failed?per_page=all', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import requests | |
| urls = [ | |
| 'http://192.168.1.5/', | |
| 'http://192.168.1.15/', | |
| 'http://192.168.1.5:8080', | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import os | |
| import magic | |
| from flask import Flask, request, jsonify, make_response | |
| from werkzeug.utils import secure_filename | |
| from werkzeug.contrib.fixers import ProxyFix | |
| from subprocess import call | |
| from flask.ext.httpauth import HTTPBasicAuth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # yum install python-suds | |
| import suds | |
| import base64 | |
| # Uncomment the logging if you want to see the XML input and output for debugging | |
| import logging | |
| import logging.handlers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import requests | |
| from bs4 import BeautifulSoup | |
| import json | |
| q = requests.get('http://marshyski.com/man-behind-the-keyboard') | |
| def cleanhtml(): | |
| return ''.join(BeautifulSoup(q.text).findAll(text=True)).replace(' ', ' ') |