Environment
$ ls -1 .
node_modules
package.json
src
yarn.lock
$ du -sm .
# http://aws.amazon.com/amazon-linux-ami/ | |
# http://aws.amazon.com/amazon-linux-ami/faqs/ | |
# Boot up a machine with at least 1.5 to 2 GB Ram | |
# login | |
chmod 600 key.pem | |
ssh -i key.pem ec2-user@ec2...compute.amazonaws.com | |
# update |
import sys | |
import SimpleHTTPServer | |
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def send_head(self): | |
path = self.translate_path(self.path) | |
f = None | |
if os.path.isdir(path): | |
if not self.path.endswith('/'): | |
# redirect browser - doing basically what apache does | |
self.send_response(301) |
docker-machine create -d virtualbox --engine-storage-driver overlay --virtualbox-disk-size "50000" --virtualbox-memory "4096" overlay |
$ ls -1 .
node_modules
package.json
src
yarn.lock
$ du -sm .
const population = [ [], [], [], [], [], [] ]; | |
population[3][4] = false; | |
//------------------------------------------- | |
const population = new Population(); | |
const cell = new AliveCell(); | |
const position = new Position(3, 4); | |
population.set(position, cell); | |
class Cell {} |
#!/bin/bash | |
SLEEP=0.005 | |
COLS=$(tput cols) | |
ROWS=$(tput lines) | |
RED="\033[0;31m" | |
YELLOW="\033[0;33m" | |
GREEN="\033[0;32m" | |
BLUE="\033[0;34m" |
FROM ubuntu:14.04 | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN echo "System updated on 2015-06-25" && apt-get update && apt-get -y dist-upgrade | |
# Install dependencies | |
RUN \ | |
apt-get install -y \ | |
automake build-essential curl\ |
/** | |
* This little program prints out the url to the AWS console | |
* generated from the local AWS credentials stored in environment variables: | |
* AWS_ACCESS_KEY_ID | |
* AWS_SECRET_ACCESS_KEY | |
* AWS_SESSION_TOKEN | |
* | |
* Steps: | |
* 1. Create a JSON object | |
* session = JSON.stringify({ |
#!/bin/sh | |
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}" | |
INTERVAL="${COLLECTD_INTERVAL:-3600}" | |
while true; do | |
result="$(speedtest --csv)" | |
upload="$(echo "$result" | cut -d, -f8)" | |
download="$(echo "$result" | cut -d, -f7)" | |
echo "PUTVAL \"$HOSTNAME/speedtest/upload\" interval=$INTERVAL N:$upload" | |
echo "PUTVAL \"$HOSTNAME/speedtest/download\" interval=$INTERVAL N:$download" |