Skip to content

Instantly share code, notes, and snippets.

View thomastaylor312's full-sized avatar

Taylor Thomas thomastaylor312

View GitHub Profile
@thomastaylor312
thomastaylor312 / disableSSL.groovy
Created November 3, 2016 22:14
Disable SSL validation in Groovy
def nullTrustManager = [
checkClientTrusted: { chain, authType -> },
checkServerTrusted: { chain, authType -> },
getAcceptedIssuers: { null }
]
def nullHostnameVerifier = [
verify: { hostname, session -> true }
]
@thomastaylor312
thomastaylor312 / example-secret.yml
Created November 3, 2016 22:04
Example secret file for Kubernetes
---
apiVersion: v1
kind: Secret
metadata:
name: password
namespace: my-cool-ns
data:
password: foobarbaz
@thomastaylor312
thomastaylor312 / jenkins-credentials.groovy
Last active November 3, 2016 22:29
How to set credentials for Jenkins in Kubernetes
import jenkins.model.*
import hudson.model.*
import hudson.security.SecurityRealm
import org.jenkinsci.plugins.GithubSecurityRealm
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey
import com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey
Wed Nov 2 20:36:18 UTC 2016
@thomastaylor312
thomastaylor312 / jjb.yml
Last active October 5, 2016 21:01
An example of a project with job parameters
- project:
name: cassandra
parameters:
- foo
jobs:
- "deployment-tests-{name}"
- job-template:
name: "deployment-tests-{name}"
description: "Tests the deployment of {name}"

Keybase proof

I hereby claim:

  • I am thomastaylor312 on github.
  • I am oftaylor (https://keybase.io/oftaylor) on keybase.
  • I have a public key ASAlykQfVWlOTiak4OU3b4FVHpXrIU_jYvLOBEnqqdDjoAo

To claim this, I am signing this object:

@thomastaylor312
thomastaylor312 / calculateParity.c
Last active December 28, 2015 16:59
A small, slightly hacky C program to calculate the parity of data and then compare it using modified data. This will probably be used for some sort of homework assignment.
#include <stdio.h>
//Code for calculate parity from http://graphics.stanford.edu/~seander/bithacks.html#ParityNaive
unsigned int calculateParity(int data) {
unsigned int parity = 1; //Even parity to start
while (data) {
parity = !parity;
data = data & (data - 1);
}
return parity;