Skip to content

Instantly share code, notes, and snippets.

Avatar

Arnaud Heritier aheritier

View GitHub Profile
View Auth0Utils.java
/**
* <p>Create a {@link WebClient} using OAuth2 (Auth0) authentication (MTM)</p>
*
* @param clientRegistrationRepository The repository of client registrations
* @param authorizedClientRepository The repository of authorized clients
* @param clientRegistrationId The Client Registration Id to use to get the authentication info (clientId, clientSecret, scope...)
* @param url The base URL of REST Service this client is interacting with
* @param audience The audience to pass to the authentication request sent to Auth0
* @return a {@link WebClient} instance preconfigured to access to the remote service
* @since 1.1.0
View Auth0ClientCredentialsGrantRequestEntityConverter.java
import org.springframework.core.convert.converter.Converter;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity;
import org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest;
import org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequestEntityConverter;
import org.springframework.security.oauth2.client.registration.ClientRegistration;
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
@aheritier
aheritier / Jenkinsfile
Created May 19, 2020
JenkinsPipelineMavenWithJava6
View Jenkinsfile
pipeline {
agent {
docker { image 'java6-maven' }
}
stages {
stage('Build') {
steps {
withMaven{
sh "mvn verify"
}
View console.log
Started by user Arnaud Heritier
[Pipeline] node
Still waiting to schedule task
Waiting for next available executor
Running on e2f120eb in /scratch/jenkins/workspace/aheritier/test-java-10
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Preparation)
[Pipeline] git
Cloning the remote Git repository
@aheritier
aheritier / findRunningPipelineJobs.groovy
Created Nov 21, 2016
Find Pipeline Scripts running for more than 1 day
View findRunningPipelineJobs.groovy
import groovy.time.*
println "List of running jobs : "
use(TimeCategory) {
Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob).each{
job -> job.builds.findAll{it.isBuilding() && new Date(it.startTimeInMillis) < (new Date() - 1.day) }.each{
build ->
TimeDuration duration = TimeCategory.minus(new Date(), new Date(build.startTimeInMillis))
println "* $job.fullName#$build.number started since $duration"
}
View wiki.log
DB=jdbc:mysql://mysql1-vip.osuosl.org:3306/hudson_confluence?autoReconnect=true&characterEncoding=utf8&useUnicode=true&sessionVariables=storage_engine%3DInnoDB
If you encounter issues starting up Confluence Standalone, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide
Oct 30, 2015 8:02:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server} Setting property 'debug' to '0' did not find a matching property.
Oct 30, 2015 8:02:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine} Setting property 'debug' to '0' did not find a matching property.
Oct 30, 2015 8:02:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'debug' to '0' did not find a matching property.
Oct 30, 2015 8:02:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{S
@aheritier
aheritier / gist:5db174d4e37109ca97e9
Created Jun 3, 2015
all-nodes-workspace-cleaner.groovy
View gist:5db174d4e37109ca97e9
/*** BEGIN META {
"name" : "Master Node Workspace Cleaner",
"comment" : "This script will go through all workspaces for any/all jobs on master node and remove them.",
"parameters" : [],
"core": "1.300",
"authors" : [
{ name : "Arnaud Héritier" }
]
} END META**/
View keybase.md

Keybase proof

I hereby claim:

  • I am aheritier on github.
  • I am aheritier (https://keybase.io/aheritier) on keybase.
  • I have a public key whose fingerprint is 03E1 A984 4236 1AFA D93F 4BDF 3B5B 9D09 699A 35EB

To claim this, I am signing this object:

@aheritier
aheritier / gist:3945f85b397d5194efc1
Created Mar 23, 2015
TestJobWithException.java
View gist:3945f85b397d5194efc1
package jobs;
import play.Logger;
import play.jobs.Every;
import play.jobs.Job;
@Every("1min")
public class TestJobWithException extends Job {
static int count = 0;
@aheritier
aheritier / All Nodes Workspace Cleaner
Created Sep 8, 2014
Jenkins script to remove all jobs workspaces on master and all remote nodes
View All Nodes Workspace Cleaner
/*** BEGIN META {
"name" : "Master Node Workspace Cleaner",
"comment" : "This script will go through all workspaces for any/all jobs on master node and remove them.",
"parameters" : [],
"core": "1.300",
"authors" : [
{ name : "Arnaud Héritier" }
]
} END META**/