This file contains 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 datetime | |
import threading | |
import time | |
def d(): | |
t=threading.Timer(10.0,d) | |
t.start() | |
time.sleep(2) | |
print datetime.datetime.now() |
This file contains 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 math | |
from pymemcache.client.base import Client | |
client = Client(('172.17.0.2', 11211)) | |
chunk_size = 1000000.0 | |
def get_loops(size): | |
return math.ceil(size/chunk_size) | |
def set_file(name, file_obj): |
This file contains 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
api_key = <api_key> | |
application_key = <app_key> | |
monitors = requests.get("https://app.datadoghq.com/api/v1/monitor?api_key=%s&application_key=%s" % (api_key, application_key)).json() | |
bad_monitor = {'name':[]} | |
for monitor in monitors: | |
if monitor['overall_state'] == u'OK': | |
bad_monitor['name'].append(monitor['name']) |
This file contains 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 flask import Flask | |
import re | |
import math | |
import redis | |
import zlib | |
import ast | |
app = Flask(__name__) | |
LOG_FILE = '/var/log/access.log' |
This file contains 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 os | |
import json | |
import datetime | |
from flask import Flask, url_for, redirect, \ | |
render_template, session, request | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask.ext.login import LoginManager, login_required, login_user, \ | |
logout_user, current_user, UserMixin | |
from requests_oauthlib import OAuth2Session |
This file contains 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 flask import Flask, request | |
import smtplib | |
from email.mime.text import MIMEText | |
import json | |
import ConfigParser | |
import os.path | |
app = Flask(__name__) | |
app.debug=True | |
config = ConfigParser.ConfigParser() |
This file contains 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 flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello World!' | |
if __name__ == '__main__': | |
app.run() |
This file contains 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
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: nginx-flask-controller | |
spec: | |
replicas: 2 | |
selector: | |
app: nginx-flask-pod | |
template: | |
metadata: |
This file contains 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
#!/bin/bash | |
# You can change the url below if you are going to test a fork. | |
git clone https://github.com/fedora-cloud/Fedora-Dockerfiles.git | |
cd Fedora-Dockerfiles | |
# if you are running against a particular branch then uncomment the line below and write the branch name. | |
# git checkout <branch_name> | |
mkdir logs | |
dfiles_dir=$(pwd) |
This file contains 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 subprocess | |
import time | |
import json | |
import re | |
import pynsca | |
import sys | |
from pynsca import NSCANotifier | |
''' | |
We need to alert on 30 Mbps. ifconfig returns bytes. |
NewerOlder