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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 1024 |
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
#!/usr/bin/python | |
import random | |
import time | |
import statsd | |
ctr_name = 'stats.test.1' | |
while True: | |
client = statsd.StatsClient('localhost', 8125) | |
rand = random.randrange(1, 250) | |
print('count: (%d)' % rand) |
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 | |
RUN apt-get install -y python-software-properties python | |
RUN add-apt-repository ppa:chris-lea/node.js | |
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install -y nodejs | |
RUN mkdir /var/www | |
ADD app.js /var/www/app.js |
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
var http = require('http'); | |
// Http server | |
var server = http.createServer(function (request, response) { | |
response.writeHead(200, {"Content-Type": "text/plain"}); | |
text = "Running Node.js:" + process.versions.node | |
response.end(text); | |
}); |
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
web: | |
image: "youraccount/yourrepo:1.0.0" | |
ports: | |
- "8080:8080" |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "private_network", ip: "192.168.33.10" | |
end |
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 flask import Flask | |
from flask import g | |
from flask import Response | |
from flask import request | |
import json | |
import MySQLdb | |
app = Flask(__name__) | |
@app.before_request |
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 MySQLdb | |
import argparse | |
db = MySQLdb.connect(host="192.168.33.10", user="test", passwd="password", db="test") | |
cursor = db.cursor() | |
parser = argparse.ArgumentParser(description="Process some strings.") | |
parser.add_argument("firstname", type=str, help="firstname") | |
parser.add_argument("lastname", type=str, help="lastname") | |
args = parser.parse_args() |
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 MySQLdb | |
db = MySQLdb.connect(host="192.168.33.10", user="test", passwd="password", db="test") | |
cursor = db.cursor() | |
cursor.execute("SELECT firstname,lastname FROM test.name") | |
for row in cursor.fetchall(): | |
firstname = str(row[0]) | |
lastname = str(row[1]) |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provision "shell", inline: "apt-get update" |
OlderNewer