Skip to content

Instantly share code, notes, and snippets.

View smarterclayton's full-sized avatar

Clayton Coleman smarterclayton

View GitHub Profile
@smarterclayton
smarterclayton / authorizes.rb
Created August 15, 2012 17:53
Mixin for Her that adds user contextual specialization of a Her ORM object
module ConsoleModel
module Middleware
class Authorizes < Faraday::Request::BasicAuthentication
def initialize(app, auth)
super app, auth.login, auth.password
end
def call(env)
puts "call authorizes"
super
@smarterclayton
smarterclayton / solum_api.md
Last active December 28, 2015 06:39
Markdown version of https://wiki.openstack.org/wiki/Solum/API generated with "pandoc -f mediawiki solum-api.mediawiki -o solum-api.md"

API

Synopsis

Verb URI Description
GET / Get the root Platform resource
GET /assemblies Get a list of the Assembly resources for this tenant
---
Name: mock
Version: '0.1'
Cartridge-Short-Name: EXTERNALMOCK
Cartridge-Vendor: externalmock
Categories:
- external
Display-Name: External Mock
Scaling:
Min: 0
oo-admin-ctl-cartridge -c migrate
52e5c970829190e3c700000e ! -> 52ebdc958291905410000001 INCOMPLETE 0 / 1 left php-5.3
Migrated 0/1 cartridges
Updated 0 applications
Skipped 1 applications with pending jobs
@smarterclayton
smarterclayton / gist:8792897
Created February 3, 2014 21:35
Docker gear
[vagrant@localhost ~]$ curl -X PUT "http://localhost:8080/token/__test__/container?i=2&u=deadbeef&t=pmorie%2fsti-html-app&d=1&r=12" -d '{"ports":[{"external":10102,"internal":8080}]}'
Creating gear 12 ...
Unit in place 12 ...
-- Logs begin at Tue 2013-11-26 08:05:45 UTC. --
Feb 03 21:34:42 localhost.localdomain systemd[1]: [/var/lib/gears/units/gear-12.service:13] Unknown section 'Gear'. Ignoring.
Feb 03 21:34:42 localhost.localdomain systemd[1]: [/var/lib/gears/units/gear-12.service:14] Assignment outside of section. Ignoring.
Feb 03 21:34:42 localhost.localdomain systemd[1]: [/var/lib/gears/units/gear-12.service:15] Assignment outside of section. Ignoring.
Feb 03 21:34:42 localhost.localdomain systemd[1]: [/var/lib/gears/units/gear-12.service:16] Assignment outside of section. Ignoring.
Feb 03 21:34:42 localhost.localdomain systemd[1]: [/var/lib/gears/units/gear-12.service:17] Assignment outside of section. Ignoring.
Feb 03 21:34:42 localhost.localdomain systemd[1]: Starting Gear container 12...
@smarterclayton
smarterclayton / gist:8995568
Created February 14, 2014 04:02
Gear slices representing a gear profile
[vagrant@localhost ~]$ systemctl status gear.slice
gear.slice
Loaded: loaded
Active: active since Thu 2014-02-13 23:36:12 UTC; 4h 8min ago
CGroup: /gear.slice
└─gear-small.slice
├─gear-0008.service
│ └─11739 /usr/bin/docker run -name gear-0008 -volumes-from gear-0008 -a stdout -a st...
├─gear-0007.service
│ └─11681 /usr/bin/docker run -name gear-0007 -volumes-from gear-0007 -a stdout -a st...
@smarterclayton
smarterclayton / openshift_system_design_v3.md
Last active August 29, 2015 14:03
OpenShift 3.x System Design
@smarterclayton
smarterclayton / replicationcontroller.json
Created November 14, 2014 19:59
A replication controller created by a deployment config
// ReplicationController[I'm Deployment 1 of mydeployment created when mydeployment was at index 50]
{
"metadata": {
"labels": {
"deployment": "1"
},
"annotations": {
"description": "This is deployment 1 of mydeployment: we are going to roll this sucker out",
"deployment.version": "1",
"deployment.config": "mydeployment",
$ osc new-app openshift/ruby-20-centos~git://github.com/mfojtik/sinatra-app-example --build=source
{
"kind": "List",
"creationTimestamp": null,
"apiVersion": "v1beta1",
"items": [
{
"kind": "ImageRepository",
"apiVersion": "v1beta1",
"metadata": {