Skip to content

Instantly share code, notes, and snippets.

View aheritier's full-sized avatar

Arnaud Héritier aheritier

View GitHub Profile
/**
* <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
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 09:04
JenkinsPipelineMavenWithJava6
pipeline {
agent {
docker { image 'java6-maven' }
}
stages {
stage('Build') {
steps {
withMaven{
sh "mvn verify"
}
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 November 21, 2016 17:30
Find Pipeline Scripts running for more than 1 day
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"
}
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 June 3, 2015 19:19
all-nodes-workspace-cleaner.groovy
/*** 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**/

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 March 23, 2015 09:16
TestJobWithException.java
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 September 8, 2014 09:06
Jenkins script to remove all jobs workspaces on master and all remote nodes
/*** 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**/