Skip to content

Instantly share code, notes, and snippets.

View adamkdean's full-sized avatar

Adam K Dean adamkdean

View GitHub Profile
$(function(exports) {
function handleFlickrResponse(data) {
//
}
// $.ajax({});
exports.flickrResponse = handleFlickrResponse;
}(window));
# DOCKER-VERSION 0.3.4
FROM centos:6.4
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install Node.js and npm
RUN yum install -y npm
# Bundle app source
adam@sandbox:~/Code/node-test$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
57a24e50900b imdsm/centos-node-hello:latest node /src/index.js 17 minutes ago Up 17 minutes 0.0.0.0:8080->8080/tcp focused_torvalds
# DOCKER-VERSION 0.9.1
FROM ubuntu
MAINTAINER Adam K Dean
# Update container with dependencies
RUN apt-get update
RUN apt-get install -y python-software-properties python g++ make software-properties-common
# Install Node.js
RUN add-apt-repository ppa:chris-lea/node.js
var http = require('http'),
httpProxy = require('http-proxy');
var proxy = httpProxy.createProxyServer({});
// reverse proxy server
http.createServer(function (req, res) {
var target = '';
if (req.headers.host.match(/first.test/)) {
core@deis-1 ~ $ journalctl -u user-configdrive.path
-- Logs begin at Thu 2014-12-04 12:47:56 UTC, end at Thu 2014-12-04 13:11:46 UTC. --
Dec 04 12:48:02 localhost systemd[1]: Starting Watch for a cloud-config at /media/configdrive.
Dec 04 12:48:02 localhost systemd[1]: Started Watch for a cloud-config at /media/configdrive.
core@deis-1 ~ $ ls -al /media/configdrive/openstack/latest/
total 12
dr-xr-xr-x 2 root root 2048 Dec 4 12:47 .
dr-xr-xr-x 6 root root 2048 Dec 4 12:47 ..
-r--r--r-- 1 root root 1289 Dec 4 12:47 meta_data.json
-r--r--r-- 1 root root 4733 Dec 4 12:47 user_data
-r--r--r-- 1 root root 994 Dec 4 12:47 vendor_data.json
core@deis-1 ~ $ systemctl status user-configdrive.service
● user-configdrive.service - Load cloud-config from /media/configdrive
Loaded: loaded (/usr/lib64/systemd/system/user-configdrive.service; static)
Active: inactive (dead)
core@deis-1 ~ $ journalctl -b -u oem-cloudinit.service --no-pager
-- Logs begin at Thu 2014-12-04 12:47:56 UTC, end at Thu 2014-12-04 13:15:35 UTC. --
- name: 50-eth0.network
runtime: true
content: |
[Match]
Name=eth0
[Network]
Address=$private_ipv4/24
Gateway=10.21.12.1
DNS=8.8.8.8
#!/usr/bin/python
import spidev
import time
import os
# Open SPI bus
spi = spidev.SpiDev()
spi.open(0,0)