Setup the server:
iperf -s
| class Brew { | |
| var temp: Float = 0.0 | |
| } | |
| class BrewViewModel : NSObject { | |
| var brew = Brew() | |
| dynamic var temp: Float = 0.0 { | |
| didSet { | |
| self.brew.temp = temp | |
| } |
| var a = ["sdfdf", "http://oooooolol"], | |
| handleNetErr = function(e) { return e }; | |
| Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr)) | |
| .then(function(sdf, invalid) { | |
| console.log(sdf, invalid) // [Response, TypeError] | |
| }) | |
| .catch(function(err) { | |
| console.log(err); | |
| }) |
| # Install linux update, followed by GCC and Make | |
| sudo yum -y update | |
| sudo yum install -y gcc make | |
| # Install Nginx and php56-FPM | |
| sudo yum install -y nginx php56-fpm | |
| # Install php56 extensions | |
| sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap |
| # Install linux update, followed by GCC and Make | |
| sudo yum -y update | |
| sudo yum install -y gcc make | |
| # Install Nginx and PHP-FPM | |
| sudo yum install -y nginx php56-fpm | |
| # Install PHP extensions | |
| sudo yum install -y php56-devel php56-mysql php56-pdo \ | |
| php56-pear php56-mbstring php56-cli php56-odbc \ |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| On OSX Yosemite and above, in a terminal window: | |
| 1. Switch to the root user. | |
| $ sudo su - | |
| 2. Create a Dummynet pipe that represents a slow, unreliable network: | |
| # dnctl pipe 1 config bw 10Kbit/s delay 300 plr 0.1 noerror |
| var PARSE_APPLICATION_ID = ''; | |
| var PARSE_REST_API_KEY = ''; | |
| var JSON_FILE_PATH = ''; // Path to JSON file to import | |
| var IMPORTED_CLASS_NAME = ''; // Class to import | |
| var POINTING_CLASS_NAME = ''; // Class with pointers to imported class | |
| var POINTING_CLASS_PROPERTY = ''; // Name of pointer property | |
| var request = require('request'); | |
| var fs = require('fs'); |
| #!/bin/sh | |
| # Make sure to: | |
| # 1) Name this file `backup.sh` and place it in /home/ubuntu | |
| # 2) Run sudo apt-get install awscli to install the AWSCLI | |
| # 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
| # 4) Fill in DB host + name | |
| # 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
| # 6) Run chmod +x backup.sh | |
| # 7) Test it out via ./backup.sh |
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.