Skip to content

Instantly share code, notes, and snippets.

@johnrengelman
johnrengelman / frigga.txt
Last active Aug 20, 2020
Netflix Frigga Naming Schema
View frigga.txt
ASG name = frigga.group = app-stack-detail(-options)-push
frigga.cluster = app-stack-detail
frigga.push = v<sequence)
options:
- c0<value> = countries
- d0<value = devPhase
- h0<value> = hardware
@johnrengelman
johnrengelman / InfluxDBMetricsModules.java
Created Sep 22, 2016
InfluxDB Reporter module for Ratpack
View InfluxDBMetricsModules.java
package com.peoplenet.common.ratpack.metrics
import com.codahale.metrics.MetricRegistry
import com.google.inject.Inject
import com.google.inject.Provides
import com.izettle.metrics.influxdb.InfluxDbHttpSender
import com.izettle.metrics.influxdb.InfluxDbSender
import com.izettle.metrics.influxdb.InfluxDbTcpSender
import com.izettle.metrics.influxdb.InfluxDbUdpSender
import com.peoplenet.common.ratpack.config.Application
@johnrengelman
johnrengelman / document.json
Created Jul 7, 2016
Upgrade Rancher Cluster with Amazon EC2 Run Command
View document.json
{
"schemaVersion":"1.2",
"description":"Upgrade Rancher cluster to specified version",
"parameters":{
"version":{
"type":"String",
"description":"(Required) The version to upgrade to.",
"maxChars":4096
}
},
View Jenkinsfile
node {
// Mark the code checkout 'Checkout'....
stage 'Checkout'
// // Get some code from a GitHub repository
git url: 'git@github.com:myorg/infrastructure.git'
// Get the Terraform tool.
def tfHome = tool name: 'Terraform', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool'
@johnrengelman
johnrengelman / ShadowJar.java
Created May 20, 2016
Gradle 2.14-rc-1 Shadow issue
View ShadowJar.java
public class ShadowJar extends CopySpec {
public <T extends Transformer> ShadowSpec transform(Class<T> clazz) throws InstantiationException, IllegalAccessException {
//..
}
public <T extends Transformer> ShadowSpec transform(Class<T> clazz, Action<T> configure) throws InstantiationException, IllegalAccessException {
//..
}
}
View docker-compose.yml
consul-registrator:
log_driver: ''
labels:
io.rancher.sidekicks: consul,consul-data
io.rancher.scheduler.global: 'true'
io.rancher.container.pull_image: always
io.rancher.container.hostname_override: container_name
tty: true
restart: always
command:
@johnrengelman
johnrengelman / build.gradle
Created Apr 8, 2015
Self applying Gradle plugin project
View build.gradle
//place this content in your buildSrc/build.gradle file
//Then apply your plugin to its own build in build.gradle
import org.codehaus.groovy.control.CompilerConfiguration
apply plugin: 'groovy'
repositories {
jcenter()
}
View README.md
@johnrengelman
johnrengelman / build.gradle
Created Dec 29, 2014
Injected Gradle Task
View build.gradle
class MyTask extends DefaultTask {
@Inject
FileResolver fileResolver
@TaskAction
public void action() {
//...
}
}
View Bar.groovy
package foo
class Bar {
String name
}