Skip to content

Instantly share code, notes, and snippets.

View tnolet's full-sized avatar

Tim Nolet tnolet

View GitHub Profile
@tnolet
tnolet / gist:dde204cc8abb6996e8fe
Last active August 29, 2015 14:17
testing gin deep struct checking
save this as main.go
###
package main
import (
"github.com/gin-gonic/gin"
"net/http"
)
@tnolet
tnolet / monarchs
Created July 2, 2015 19:44
Vamp test deployment with monarch test app. Hit the :9050 endpoint on Vamp Router with the actions mentioned here https://github.com/magneticio/monarch#api
name: monarchs:1.0
endpoints:
frontend.port: 9050
clusters:
frontend:
services:
-
breed:
name: monarch_front:0.1
deployable: magneticio/monarch:0.1
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI)
# This should be performed as root since it's going to be installing a bunch of stuff
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached
@tnolet
tnolet / gist:7334360
Last active December 27, 2015 13:39
Using RubyMine with Vagrant running Ruby

Creating a RVM based Ruby environment on Vagrant

Update all packages

yum update

Install RVN. note: Don't do this as a root user!

curl -L get.rvm.io | bash -s stable

@tnolet
tnolet / gist:8398447
Last active January 3, 2016 02:49
Mcollective tricks
# Some mcollective tricks are very poorly documented. Like running an arbitrary shell command.
# This command removes the SSL dir on all puppet agents.
mco rpc puppetral create type=exec title="/bin/rm -rf /etc/puppetlabs/puppet/ssl" user="root" -F fact_is_puppetmaster=false
# You could then run the puppet agent again to request an new certificate from the master. This command does this with a concurrency of 2 agents.
mco puppetd -v runall 2 -F hostname=/^somehost/
def vampDeploymentName = 'simpleservice'
def vampHost = 'http://10.0.1.134:3232'
stage('Deploy') {
sh "curl -X POST --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/blueprints -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/deployments/${vampDeploymentName} -H 'Content-Type: application/x-yaml'"
}
@tnolet
tnolet / jenkins_pipeline1.groovy
Last active August 16, 2017 12:32
vamp+dcos+jenkins guide: deploy initial blueprint
#!groovy
node {
def nodeHome = tool name: '8.3.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${nodeHome}/bin:${env.PATH}"
// !! Replace these with your own settings !!
def gitRepo = 'https://github.com/magneticio/simpleservice/'
def dockerHub = 'https://registry.hub.docker.com'
def dockerHubCreds = 'docker-hub-login'
def dockerRepo = 'magneticio'
@tnolet
tnolet / jenkins_pipeline2.groovy
Last active August 16, 2017 12:35
vamp+dcos+jenkins guide
#!groovy
node {
def nodeHome = tool name: '8.3.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${nodeHome}/bin:${env.PATH}"
// !! Replace these with your own settings !!
def gitRepo = 'https://github.com/magneticio/simpleservice/'
def dockerHub = 'https://registry.hub.docker.com'
def dockerHubCreds = 'docker-hub-login'
def dockerRepo = 'magneticio'
#!groovy
node {
def nodeHome = tool name: '8.3.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${nodeHome}/bin:${env.PATH}"
// !! Replace these with your own settings !!
def gitRepo = 'https://github.com/magneticio/simpleservice/'
def dockerHub = 'https://registry.hub.docker.com'
def dockerHubCreds = 'docker-hub-login'
def dockerRepo = 'magneticio'
#!groovy
stage('Deploy to Vamp') {
sh "curl -X POST --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/blueprints -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @vamp_blueprint.yml ${vampHost}/api/v1/deployments/simpleservice -H 'Content-Type: application/x-yaml'"
sh "curl -X PUT --data-binary @gateway.yml ${vampHost}/api/v1/gateways/simpleservice/simpleservice/web -H 'Content-Type: application/x-yaml'"
}