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 | |
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 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
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 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
{% 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 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
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
*nat | |
:PREROUTING ACCEPT [235:14024] | |
:INPUT ACCEPT [235:14024] | |
:OUTPUT ACCEPT [418:29744] | |
:POSTROUTING ACCEPT [418:29744] | |
COMMIT | |
*filter | |
:INPUT ACCEPT [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [229:47805] |
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
import grails.plugins.rest.client.RestBuilder | |
import grails.transaction.Transactional | |
import sun.misc.BASE64Encoder | |
@Transactional | |
class JenkinsService { | |
def grailsApplication | |
def createJob(String folderName) { | |
String url = grailsApplication.config.jenkins.url |