Install Wagtail and Zappa, and create an empty site:
pip install wagtail zappa zappa-django-utils
pip install pip==9.0.3 # see https://github.com/Miserlou/Zappa/issues/1471
wagtail start foo
#!/usr/bin/env python3 | |
"""List S3 bucket objects in parallel. | |
This module contains a parallel implementation of S3 list_objects_v2() | |
API call. The implementation lists objects under every distinct prefix | |
in parallel. Hence, a speedup is achieved if objects are spread under | |
multiple distinct prefixes. | |
""" | |
import argparse |
#!/usr/bin/env bash | |
# Port of https://github.com/tj/node-prune to bash | |
# Also, | |
# - fixed "*.ts" being overzealous and killing .d.ts files | |
# - added some more file types from https://github.com/npm/npm/issues/5264#issuecomment-259800486 | |
# | |
# See also: | |
# - https://github.com/timoxley/cruft | |
# - https://yarnpkg.com/en/docs/cli/autoclean | |
# - https://github.com/ModClean/modclean |
# This file is your Lambda function | |
import json | |
import boto3 | |
def save_to_bucket(event, context): | |
AWS_BUCKET_NAME = 'my-bucket-name' | |
s3 = boto3.resource('s3') | |
bucket = s3.Bucket(AWS_BUCKET_NAME) | |
path = 'my-path-name.txt' |
# Welcome to Serverless! | |
# | |
# Happy Coding! | |
service: cross-region-sns-subscriber | |
# Keep environment specific configurations in separate files | |
custom: ${file(config/${env:STAGE}.json)} | |
provider: |
I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
Heroku's default logging format omits user agent and referrer strings - but these are useful to have! Especially if you want to be able to run your own analysis on what kind of browsers are using your service.
A default Heroku log line looks like this:
heroku/router: at=info method=GET path="/page-on-your-site/"
host=your-site.herokuapp.com
This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.
Install Raspbian Jessie (2016-05-27-raspbian-jessie.img
) to your Pi's sdcard.
Use the Raspberry Pi Configuration tool or sudo raspi-config
to:
_.jsonp('https://api.ipify.org/?format=jsonp', function(err, value){ | |
console.log(err || value); | |
}); |