Skip to content

Instantly share code, notes, and snippets.

[Unit]
Description=App Redis Sidekick
Requires=docker.service
Requires=etcd.service
After=docker.service
After=etcd.service
After=app-redis.service
BindsTo=app-redis.service
FROM ubuntu:14.04
MAINTAINER Ross Kukulinski "ross@speakit.io"
RUN apt-get -qq update
RUN apt-get -qq install -y python-software-properties software-properties-common curl git build-essential supervisor emacs23-nox nano
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get -qq update
RUN apt-get -qq install -y nodejs
RUN npm -g install npm
RUN npm -g install bower gulp grunt-cli bunyan
var async = require('async');
var data;
MakeUsesrHttpCall(function(err,res){
data.users = res;
});
MakeTestHttpCall(function(err,res){
data.tests = res;
/**
* client.createStack
*
* @description Creates a stack with the specified options.
* @param {object} details the details to create this stack
* @param {String} details.name the name of the new stack
* @param {String} details.environment the environment for the stack
* @param {Number} details.timeout timeout in minutes for stack creation
@kenperkins
kenperkins / sample.json
Created September 18, 2014 18:12
Autoscale Sample Create Scaling Group
{
"launchConfiguration": {
"args": {
"loadBalancers": [{
"port": 80,
"loadBalancerId": 237935
}],
"server": {
"name": "autoscale_server",
"imageRef": "7cf5ffc3-7b20-46fd-98e4-fefa9908d7e8",
@kenperkins
kenperkins / gist:1b13a4fa2ffe24f8214a
Created June 17, 2014 17:32
Get Public Images from AWS
var client = pkgcloud.compute.createClient({
provider: 'amazon',
// your stuff here
});
client.getImages({ owners: ['amazon'] }, function (err, images) {
images.forEach(function (f) {
console.log(f.name);
});
});
server {
listen *:80;
server_name www.my-domain.com;
rewrite ^ https://www.my-domain.com$uri permanent;
}
@kenperkins
kenperkins / test.js
Created February 28, 2014 21:07
Output cdnUri for files in a CDN CloudFiles Container
var pkgcloud = require('pkgcloud');
var client = pkgcloud.providers.rackspace.storage.createClient({
// as appropriate
});
client.getContainer(process.argv[2], function (err, container) {
client.getFiles(container.name, function(err, files) {
files.forEach(function (f) {
console.log(container.cdnUri + '/' + f.name);
@kenperkins
kenperkins / tip.md
Created February 3, 2014 18:48
Automatic Git PR alias

For anyone out there on Github projects where devs work on forks and submit PR's to a central repo: This is useful if you want to try out someone's PR from Github without fetching their fork (and all their branches):

1.) In ~/.gitconfig add these lines (if you don't have any aliases already setup):

[alias]
        pr = !git fetch -fu ${2:-REMOTE_REPO_NAME} refs/pull/$1/head:pr/$1 && :

2.) Replace REMOTE_REPO_NAME with the remote name for your project's central repo of course; PR's don't exist on your fork, but on the canonical repository.

@kenperkins
kenperkins / deleteZone.js
Created January 9, 2014 19:37
How I delete a zone...
var pkgcloud = require('pkgcloud'),
log = require('../../common/logging'),
_ = require('underscore'),
config = require('../config');
var logger = log.getLogger('debug');
var client = pkgcloud.providers.rackspace.dns.createClient(config.getConfig(1));
client.on('log::*', log.logFunction);