We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.
- Vagrantfile
from flask import Flask, abort, request, jsonify, g, url_for, Response, json | |
from flask_sqlalchemy import SQLAlchemy | |
from model.billingmodel import db | |
from model.billingmodel import User, ManagedAccount, VPNTunnel | |
from flask_login import LoginManager, login_required, logout_user, login_user, current_user | |
import logging | |
from logging.handlers import RotatingFileHandler | |
import base64 | |
logger = logging.getLogger(__name__) |
[program:uwsgi] | |
user=robdev | |
command=uwsgi --ini /path/to/config.uwsgi | |
autostart=false |
from Crypto.Cipher import AES | |
from Crypto import Random | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[0:-ord(s[-1])] | |
class AESCipher: | |
def __init__( self, key ): | |
""" |
Python parser class for CloudTrail event archives, previously dumped to an S3 bucket. Class provides an iterator which will:
Parser contained in cloudtrailparser.py
, with timezone.py
used as a simple datetime.tzinfo
concrete class implement to provide UTC timezone.
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec |
#!/usr/bin/env python | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
#!/usr/bin/env python | |
import os | |
import time | |
import json | |
import base64 | |
import requests | |
import argparse | |
from base64 import urlsafe_b64decode, b64decode | |
from Crypto.Hash import SHA256, SHA512 |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying