#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
import logging | |
import math | |
import mimetypes | |
from multiprocessing import Pool | |
import os | |
from boto.s3.connection import S3Connection | |
from filechunkio import FileChunkIO | |
countries = [ | |
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'}, | |
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'}, | |
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"}, | |
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'}, | |
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'}, | |
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'}, | |
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai |
user root; | |
worker_processes 2; | |
worker_rlimit_nofile 90000; | |
error_log /usr/local/nginx/logs/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
use epoll; | |
multi_accept off; | |
accept_mutex off; |
#!/usr/bin/env python | |
"""Split large file into multiple pieces for upload to S3. | |
S3 only supports 5Gb files for uploading directly, so for larger CloudBioLinux | |
box images we need to use boto's multipart file support. | |
This parallelizes the task over available cores using multiprocessing. | |
Usage: | |
s3_multipart_upload.py <file_to_transfer> <bucket_name> [<s3_key_name>] |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
import os | |
import pytest | |
from alembic.command import upgrade | |
from alembic.config import Config | |
from project.factory import create_app | |
from project.database import db as _db | |
<?php | |
/** | |
* Sync Groups from WordPress to Discourse | |
* | |
* First creates 'groups' meta_key (which should be customized to your needs) | |
* Then it monitors for changes in the 'groups' meta_value and connects to Discourse API to sync groups | |
* | |
* WordPress References | |
* https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/meta.php?order=name#L235 | |
* http://wordpress.stackexchange.com/questions/16835/how-to-hook-update-post-meta-and-delete-post-meta |
#!/usr/bin/env bash | |
# Works fine on Ubuntu 14.0.4 LTS | |
NGINX_VERSION="1.9.9" | |
NCHAN_VERSION="0.97" | |
HEADERS_MORE_VERSION="0.29" | |
DEV_KIT_VERSION="0.2.19" | |
ECHO_VERSION="0.58" | |
FANCY_INDEX_VERSION="0.3.5" |