This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import argparse | |
import requests | |
jenkins_url = "https://localhost:8080" | |
# Add new jobs here: | |
jobs = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ssl | |
from flask import json | |
from ldap3 import Server, \ | |
Connection, \ | |
SUBTREE, \ | |
ALL_ATTRIBUTES, \ | |
Tls, MODIFY_REPLACE | |
OBJECT_CLASS = ['top', 'person', 'organizationalPerson', 'user'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker pull docker.bintray.io/jfrog/artifactory-oss:latest | |
docker run --name artifactory -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-oss | |
# In browser open http://localhost:8081 and follow basic steps | |
# Add new remote repository: http://localhost:8081/artifactory/webapp/#/admin/repositories/remote | |
# URL: https://registry.npmjs.org | |
# RepositoryLayout: NPM default | |
# Add new virtual repository of type "Generic" using remote repository above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
stage('GetUserCredential') { | |
// Requires Credential setup (MyCredentialID) | |
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'MyCredentialID', | |
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { | |
sh ''' | |
set +x | |
echo "$USERNAME" > output.txt | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.servlet.HandlerMapping; | |
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import java.util.Map; | |
import static java.lang.String.format; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
oc login | |
oc project $1 | |
oc get services | awk '{print $1}' | grep -v NAME | xargs -I % oc delete all -l app=% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
check = [1, 2, 3, 4, 5] | |
if __name__ == '__main__': | |
print(list(map(lambda x: x * 3, check))) # OUTPUT: [3, 6, 9, 12, 15] | |
print(list(filter(lambda x: x < 3, check))) # OUTPUT: [1, 2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableWebMvc | |
public class WebApplicationConfig implements WebMvcConfigurer { | |
@Override | |
public void configureViewResolvers(ViewResolverRegistry registry) { | |
registry.jsp().prefix("/WEB-INF/views/").suffix(".jsp"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class ThymeLeafConfig { | |
@Autowired | |
private SpringResourceTemplateResolver templateResolver; | |
@Bean | |
public SpringTemplateEngine templateEngine(){ | |
SpringTemplateEngine templateEngine = new SpringTemplateEngine(); | |
templateEngine.setEnableSpringELCompiler(true); |
NewerOlder