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
"""Simple Python HTTP POST Redirector - Redirects POST requests with data. | |
Author: Andrew Stanish, May 2015 | |
Uncomment the two pprint lines to write the POST data to the console. | |
Change the address in this line to send wherever you like: | |
requests.post('http://10.8.0.10:8080', data=form.value, headers=headers ) | |
""" | |
import cgi, requests, BaseHTTPServer | |
#import pprint as pp |
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
#! /usr/bin/env python | |
from flask.ext.script import Manager | |
from flask.ext.script.commands import ShowUrls, Clean | |
from app import create_app, db | |
app = create_app("development") | |
manager = Manager(app) |
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 Blueprint, request, make_response, current_app | |
from flask.ext.security.decorators import _check_token | |
from flask.ext.security import current_user | |
class TokenAuthBlueprint(Blueprint): | |
def __init__(self, *args, **kwargs): | |
Blueprint.__init__(self, *args, **kwargs) | |
Blueprint.before_request(self, self.checkToken) |
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 request, current_app | |
from flask.json import jsonify | |
from flask.ext.security import Security, SQLAlchemyUserDatastore, current_user | |
from flask.ext.security.views import create_blueprint | |
from flask.ext.security.decorators import auth_token_required | |
from flask.ext.security.utils import url_for_security, md5 | |
from flask.ext.login import make_secure_token | |
from werkzeug.local import LocalProxy |
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
" General {{{ | |
" vim options {{{{ | |
set nocompatible " be iMproved, required | |
set encoding=utf-8 | |
set ffs=unix,dos,mac | |
set number | |
set relativenumber | |
set ruler | |
set tabstop=4 |
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
# example: > git-finish this is my commit message | |
git-finish () { git add -A && git commit -m "$*" && git push; } |
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
# Usage: | |
# @progress(db.users.find().count()) | |
# def users(cb): | |
# users = [] | |
# for u in db.users.find(): | |
# users.append( user(u) ) | |
# cb() | |
# return users | |
from progressbar import ProgressBar, Percentage, Bar |
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 pytest | |
from app import create_app | |
from app.database import db as _db | |
# from tests.client import ApiTestingResponse | |
@pytest.yield_fixture(scope='session') | |
def app(): | |
app = create_app('testing.py') |
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
################################################## | |
# Real autocommit mode for psycopg2 | |
# ie, does not auto-start a transacation. | |
# from http://oddbird.net/2014/06/14/sqlalchemy-postgres-autocommit/ | |
# UNTESTED | |
################################################## | |
class AUTOCOMMITAlchemy(SQLAlchemy): | |
def apply_driver_hacks(self, app, info, options): | |
if not "isolation_level" in options: | |
options["isolation_level"] = "AUTOCOMMIT" # For example |
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
http://cpanel.net/news/ | |
http://krebsonsecurity.com/category/latest-warnings/ | |
http://www.exploit-db.com/ | |
https://web.nvd.nist.gov/view/vuln/search | |
http://www.cvedetails.com/ | |
http://blog.sucuri.net/category/wordpress-security | |
http://www.pcworld.com/category/security/ | |
http://www.gk-root.com/GK-Blog/secure-your-cpanel-server/ | |
https://wpvulndb.com/ |
OlderNewer