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 flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello World!' | |
if __name__ == '__main__': | |
app.run() |
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
#!/bin/sh | |
rsync="rsync -avrt" | |
mirror=mirrors.kernel.org::mirrors/fedora | |
verlist="13 14" | |
archlist="i386" | |
baselist="os" | |
local=/var/www/fedrepo |
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 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 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 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 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
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 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 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 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 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 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/env python | |
import boto.ec2.elb | |
import ConfigParser | |
import os.path | |
import sys | |
from optparse import OptionParser | |
check = os.path.isfile(os.path.expanduser('~/.aws.conf')) | |
if cmp(check,False) == 0: |
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
#!/bin/bash | |
echo This script requires super user permissions. Press \'y\' if you are running as super user. | |
read ch | |
count=$1 | |
if [ $ch = "y" ] || [ $ch = "Y" ] | |
then | |
echo in if now | |
while [ $count -ne 0 ] |
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
require 'rubygems' | |
require 'sinatra' | |
get '/' do | |
"uploader up" | |
end | |
post '/image' do | |
puts params.inspect | |
File.open("upload-dir/#{params[:id]}", "w") do |f| |
NewerOlder