Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Blazing a trail the likes of which has never been seen.

Rory Bramwell rbramwell

🚀
Blazing a trail the likes of which has never been seen.
View GitHub Profile
@rbramwell
rbramwell / gist:a6bf3fc69cda64d58588
Last active Aug 28, 2015 — forked from stephenc/gist:3053561
Continuous Deployment with Jenkins and Puppet
View gist:a6bf3fc69cda64d58588

Puppet with Jenkins

Setup Jenkins

With Puppet:

puppet module install rtyler-jenkins
puppet apply -v -e "include jenkins"
View log4j2.rolling.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<properties>
<property name="name">app</property>
<property name="pattern">%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5.5p | %-10.10t | %-20.20C:%-5.5L | %msg%n</property>
<!--
It will look like that:
2013-04-03 07:37:51.993 | WARN | main | lnetgateway.Server:56 | My app is logging stuff
-->
</properties>
View log4j2.rolling.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<properties>
<property name="name">app</property>
<property name="pattern">%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5.5p | %-10.10t | %-20.20C:%-5.5L | %msg%n</property>
<!--
It will look like that:
2013-04-03 07:37:51.993 | WARN | main | lnetgateway.Server:56 | My app is logging stuff
-->
</properties>
View docker_workshop_microservices_cheat_sheet.md
View GettingStarted.java
import com.datastax.driver.core.*;
public class GettingStarted {
public static void main(String[] args) {
Cluster cluster;
Session session;
View GettingStartedTwo.java
import com.datastax.driver.core.*;
public class GettingStartedTwo {
public static void main(String[] args) {
Cluster cluster;
Session session;
ResultSet results;
Row rows;
View GettingStarted.js
var cassandra = require('cassandra-driver');
var async = require('async');
var client = new cassandra.Client({contactPoints: ['127.0.0.1'], keyspace: 'demo'});
// Use async series to run functions in serial (one after another)
async.series([
// Insert Bob
function (callback) {
client.execute("INSERT INTO users (lastname, age, city, email, firstname) VALUES ('Jones', 35, 'Austin', 'bob@example.com', 'Bob')", function (err, result) {
View MyRetryPolicy.scala
class MyRetryPolicy(maxRetries: Int) extends RetryPolicy {
override def onReadTimeout(statement: Statement,
cl: ConsistencyLevel,
requiredResponses: Int,
receivedResponses: Int,
dataRetrieved: Boolean,
nbRetry: Int): RetryDecision = {
if (nbRetry < maxRetries) RetryDecision.retry(cl) else RetryDecision.rethrow()
}
@rbramwell
rbramwell / README.md
Last active Aug 29, 2015 — forked from joyrexus/README.md
REST basics
View README.md

Basics of RESTful API design

  • Your API should be designed around the idea of resources.

  • Resources represent things (nouns) and not behaviors (verbs).

  • Each resource should have a canonical/unique url (api/users/bill, api/users/mary).

  • Return all resource properties in the return payload.

@rbramwell
rbramwell / USING-VAULT.md
Last active Sep 2, 2015 — forked from voxxit/USING-VAULT.md
Consul + Vault + MySQL = <3
View USING-VAULT.md
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init