Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Jacomb timja

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am timja on github.
  • I am timja (https://keybase.io/timja) on keybase.
  • I have a public key ASC_dBlmJc4cPHyWO7moXk1YKaO52MPXBlBOvfdOhWf-dwo

To claim this, I am signing this object:

@timja
timja / junit-pluggable-pipeline.groovy
Created Aug 16, 2020
junit-pluggable-pipeline.groovy
View junit-pluggable-pipeline.groovy
node('master') {
writeFile file: 'x.xml', text: '''<testsuite name='sweet'><testcase classname='Klazz' name='test1'><error message='failure'/></testcase><testcase classname='Klazz' name='test2'/><testcase classname='other.Klazz' name='test3'><skipped message='Not actually run.'/></testcase></testsuite>'''
def s = junit 'x.xml'
echo(/summary: fail=$s.failCount skip=$s.skipCount pass=$s.passCount total=$s.totalCount/)
writeFile file: 'x.xml', text: '''<testsuite name='supersweet'><testcase classname='another.Klazz' name='test1'><error message='another failure'/></testcase></testsuite>'''
s = junit 'x.xml'
echo(/next summary: fail=$s.failCount skip=$s.skipCount pass=$s.passCount total=$s.totalCount/)
}
View postgres class not found.txt
com.thoughtworks.xstream.mapper.CannotResolveClassException: org.jenkinsci.plugins.database.postgresql.PostgreSQLDatabase
at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
View jenkins-core-variables.txt
var(--add-item-btn-decorator-bg-color)
var(--add-item-btn-decorator-border-color)
var(--alert-danger-bg-color)
var(--alert-danger-border-color)
var(--alert-danger-text-color)
var(--alert-default-bg-color)
var(--alert-default-border-color)
var(--alert-default-color)
var(--alert-default-icon-color)
var(--alert-info-bg-color)
@timja
timja / Main.java
Created Jun 19, 2020
org github issues report
View Main.java
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.kohsuke.github.GHIssueState;
import org.kohsuke.github.GHOrganization;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;
@timja
timja / ci.jenkin.io-jobdsl.groovy
Last active May 19, 2021
ci.jenkins.io-jcasc
View ci.jenkin.io-jobdsl.groovy
def configuration = [
[
name : "Core",
repositories: "jenkins"
],
[
name : "Infra",
repositories: "*",
owner : "jenkins-infra"
@timja
timja / spring-boot-dashboard.json
Last active Nov 15, 2019
spring-boot-dashboard
View spring-boot-dashboard.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "prometheus-00",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"limit": 100,
View key-vault-copy-cert-to-different-vault
#!/bin/bash
SRC_SECRET_NAME=${1}
SRC_VAULT=${2}
DEST_VAULT=${3}
DEST_SECRET_NAME=${4}
CERTIFICATE_NAME=${1}
function usage() {
echo "usage: ./key-vault-copy-cert-to-different-vault <src-secret-name> <src-vault> <dest-vault> <dest-secret-name>"
View white-list-registry-policy.rego
package admission
import data.k8s.matches
###############################################################################
#
# Policy : Container image name check if it matches the whitelisted patterns
# e.g. should be from an organization registry.
#
###############################################################################
View dump-vault
#!/bin/bash
vault_name=$1
mkdir -p ${vault_name}
az keyvault secret list --vault-name ${vault_name} -o tsv --query [].id | cut -d '/' -f 5 | xargs -n1 -I % sh -c "az keyvault secret show --vault-name ${vault_name} --name % -o tsv --query value > ${vault_name}/%"