Skip to content

Instantly share code, notes, and snippets.

View daspilker's full-sized avatar

Daniel Spilker daspilker

View GitHub Profile

Keybase proof

I hereby claim:

  • I am daspilker on github.
  • I am daspilker (https://keybase.io/daspilker) on keybase.
  • I have a public key whose fingerprint is 4D44 5C34 6E32 6C22 3F7D C690 03BC AC81 E0A0 BA30

To claim this, I am signing this object:

@daspilker
daspilker / jenkins.py
Last active August 29, 2015 14:06
CoreMedia Release Train Automation
import urllib
import time
import serial
def send(state):
print 'sending %s' % state
serial_port.write(bytearray([len(state)]))
serial_port.write(state)
@daspilker
daspilker / gist:9364761
Created March 5, 2014 10:26
jenkins_jnlp_slave
* jenkins_jnlp_slave[windows-node] action create[2014-03-05T10:16:25+00:00] INFO: Processing jenkins_jnlp_slave[windows-node] action create (acme-ci::node line 28)
[2014-03-05T10:16:25+00:00] DEBUG: Load jenkins_jnlp_slave[windows-node] slave information
Recipe: <Dynamically Defined Resource>
* remote_file[C:\chef\cache/jenkins-cli.jar] action create[2014-03-05T10:16:26+00:00] INFO: Processing remote_file[C:\chef\cache/jenkins-cli.jar] action create (dynamically defined)
[2014-03-05T10:16:26+00:00] DEBUG: touching C:\chef\cache/jenkins-cli.jar to create it
[2014-03-05T10:16:26+00:00] INFO: remote_file[C:\chef\cache/jenkins-cli.jar] created file C:\chef\cache/jenkins-cli.jar
- create new file C:\chef\cache/jenkins-cli.jar[2014-03-05T10:16:26+00:00] DEBUG: remote_file[C:\chef\cache/jenkins-cli.jar] checking for changes
[2014-03-05T10:16:26+00:00] DEBUG: Cache control headers: {}
[2014-03-05T10:16:26+00:00] DEBUG: Initiating GET to http://jenkins.acme.com/jnlpJars/jenkins-cli.jar
@daspilker
daspilker / gist:8555440
Created January 22, 2014 08:44
Update AMI of Jenkins EC2 Cloud Template
import hudson.plugins.ec2.EC2Cloud
import hudson.plugins.ec2.SlaveTemplate
import jenkins.model.Jenkins
EC2Cloud cloud = Jenkins.instance.clouds.find { it instanceof EC2Cloud }
SlaveTemplate template = cloud.getTemplate("description")
template.ami = "ami-lalalala"
Jenkins.instance.save()
def mavenSettingsConfigProvider = jenkins.getExtensionList("org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig\$MavenSettingsConfigProvider")[0]
def configClass = mavenSettingsConfigProvider.class.classLoader.loadClass("org.jenkinsci.lib.configprovider.model.Config")
def configClassConstructor = configClass.getConstructor(String.class, String.class, String.class, String.class)
mavenSettingsConfigProvider.save(configClassConstructor.newInstance(...))
@daspilker
daspilker / get_access_token.js
Created October 4, 2011 21:38
Node.js script to retrieve an OAuth 2.0 access token
var express = require('express');
var oauth = require('oauth');
var oa;
var app = express.createServer();
app.get('/', function (req, res) {
res.end('<!DOCTYPE html><meta charset=utf-8><form action=/authorize><label>Client ID: <input type=text name=client_id required autofocus></label><br><label>Client Secret: <input type=text name=client_secret required></label><br><label>Scope: <input type=text name=scope required></label><br><input type=submit>');
});
app.get('/authorize', function (req, res) {