Skip to content

Instantly share code, notes, and snippets.

Avatar

Brett cave brettcave

View GitHub Profile
@brettcave
brettcave / role-just-java.json
Last active Aug 29, 2015
role to install java 7
View role-just-java.json
{
"name": "just-java",
"description": "Installs Java 7",
"chef_type": "role",
"json_class": "Chef::Role",
"override_attributes": {
"java": {
"jdk_version" : "7",
"java_home" : "/usr/java/latest",
"install_flavor": "oracle",
@brettcave
brettcave / gist:70d13cfaa58d6ef160e1
Created Jun 25, 2014
apt-get workaround for build-essential
View gist:70d13cfaa58d6ef160e1
a = bash "apt-get update" do
user "root"
code <<-EOF
add-apt-repository ppa:cwchien/gradle
apt-get update
EOF
action :nothing
end
a.run_action :run
View output.log
$ cat runner.sh
cd /opt/chef-zero
chef-client -z -c solo.rb -o 'role[someRole]' -E BUILD > chef-zero.log 2>&1
$ cat chef-zero.log
[2014-06-11T10:31:28+00:00] INFO: Auto-discovered chef repository at /opt/chef-zero
[2014-06-11T10:31:29+00:00] INFO: Starting chef-zero on port 8889 with repository at repository at /opt/chef-zero
One version per cookbook
[2014-06-11T10:31:29+00:00] INFO: Forking chef instance to converge...
@brettcave
brettcave / java-rc-junit4-custom.js
Created Mar 12, 2014
Custom Java / JUnit formatter for selenium
View java-rc-junit4-custom.js
/*
* Format for Selenium Remote Control Java client using the Firefox WebDriver
* Author: Brett Cave <brett@jemstep.com>
* Date: Fri May 06, 2011
*/
var subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
subScriptLoader.loadSubScript('chrome://selenium-ide/content/formats/remoteControl.js', this);
this.name = "java-rc-junit4-custom";
@brettcave
brettcave / KMEx2InConverter.js
Created Feb 3, 2014
nodejs kissmetrics export to import converter
View KMEx2InConverter.js
var fs = require("fs"),
API_KEY = "MY_API_KEY";
function parseResults(filename) {
fs.readFile(filename, 'utf-8', function (err, fileContents) {
if (err) throw err;
var parsedJson = JSON.parse(fileContents);
for (element in parsedJson) {
var params = "?_k=" + API_KEY + "&_d=1"
You can’t perform that action at this time.