- http://www.quora.com/What-kind-of-technology-does-Filecatalyst-and-Aspera-uses-to-fast-file-transfers
- http://serverfault.com/questions/300086/file-transfer-alternatives
- http://serverfault.com/questions/111813/what-is-the-best-way-to-transfer-a-single-large-file-over-a-high-speed-high-lat
- http://forums.smallnetbuilder.com/showthread.php?t=10950
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
require 'date' | |
module Nordea | |
module NDA | |
class Record | |
def self.parse(str) | |
self.new(str).normalized | |
end | |
def initialize(str) |
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
====================================== | |
Setting up Nginx, uWSGI and Python3 | |
====================================== | |
First off, I'm traditionally a PHP developer, but am looking at moving across to Python. I really struggled to find decent documentation on how to get a server up and running for deploying Python web applications from the point of view of someone coming from PHP. The main problems I came across with documentation were: | |
1) Only showed you how to run the server for a single web application. | |
2) Only showed you how to configure the app, not the server it was running on. | |
My preferred workflow for development is by setting up a new VM in VMware Fusion and then forwarding through all requests to that VM via /etc/hosts. This might not be the optimal way to get things up and running, but it works for me. |
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 | |
"""A noddy fake smtp server.""" | |
import smtpd | |
import asyncore | |
class FakeSMTPServer(smtpd.SMTPServer): | |
"""A Fake smtp server""" | |
def __init__(*args, **kwargs): |
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 fabric.api import local, run, env, put | |
import os, time | |
# remote ssh credentials | |
env.hosts = ['10.1.1.25'] | |
env.user = 'deploy' | |
env.password = 'XXXXXXXX' #ssh password for user | |
# or, specify path to server public key here: | |
# env.key_filename = '' |
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 | |
# | |
# Shell script to automatically configure a new Flask, nginx and uWSGI based blog | |
# on an Amazon EC2 instance. | |
# | |
# See http://bit.ly/MeGwjD for more information! | |
# | |
# If you are forking this for your own custom configuration script, see the following other gists: | |
# https://gist.github.com/3071737 | |
# https://gist.github.com/3071739 |
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
server { | |
listen 80; | |
server_name blog; | |
server_name blog.example.com; | |
root /var/www/blog; | |
location /static/ { | |
alias /var/www/blog/static/; | |
expires 30d; | |
access_log off; |
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
[uwsgi] | |
# Variables | |
base = /var/www/blog | |
app = simple | |
# Generic Config | |
plugins = http,python | |
home = %(base)/venv | |
pythonpath = %(base) | |
socket = /var/www/run/%n.sock | |
module = %(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
description "uWSGI" | |
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn | |
env UWSGI=/usr/bin/uwsgi | |
env LOGTO=/var/log/uwsgi/emperor.log | |
exec $UWSGI --master --emperor /etc/uwsgi/apps-enabled --die-on-term --uid nginx --gid nginx --logto $LOGTO |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!