$ ls -1 .
node_modules
package.json
src
yarn.lock
$ du -sm .
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/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" |
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
/** | |
* 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({ |
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 | |
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" |
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
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 {} |
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
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) |
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
docker-machine create -d virtualbox --engine-storage-driver overlay --virtualbox-disk-size "50000" --virtualbox-memory "4096" overlay |
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 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 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
# 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 [email protected] | |
# update |