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 | |
# Define the HTML header and footer | |
header="<html><head><title>HTML Reports</title> | |
<style> | |
.topnav { | |
position: fixed; | |
top: 0; | |
left: 0; | |
width: 100%; |
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
String saida = new ProcessBuilder( 'sh', '-c',''' | |
find ./jobs/ -name log | xargs grep -sl "xxxxxxxxxxx" | rev | cut -d '/' -f 4- | rev | uniq | |
''').redirectErrorStream(true).start().text | |
println( saida ) |
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 | |
# Get all group owners from gitlab | |
MY_ACCESS_TOKEN=$1 | |
curl -s --location --request GET 'http://gitlab.intranet/api/v4/groups' --header "PRIVATE-TOKEN: ${MY_ACCESS_TOKEN}" -o file.txt | |
grep -Po '"id":\d+' file.txt | cut -d: -f2 > ids.txt | |
grep -Po 'web_url":[^,]+' file.txt > names.txt | |
for X in $(cat ids.txt); do |
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
# Algoritmo de Dijkstra | |
import heapq | |
n = 1 | |
m = 1 | |
while(n != 0 and m != 0): | |
n, m = input().split() # ler numero de vertices e arestas | |
n = int(n) |
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 | |
# -*- coding: utf-8 -*- | |
# python2.7 | |
# ORIGINAL: https://gist.github.com/anjia0532/4a7fee95fd28d17f67412f48695bb6de | |
from requests import Request, Session | |
from requests.exceptions import RequestException | |
from datetime import datetime,timedelta | |
import urllib3 |
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
// Execute in jenkins script console | |
String saida = new ProcessBuilder( 'sh', '-c',''' | |
grep -A4 CredentialName credentials.xml | tail -1 | cut -d'>' -f2 | cut -d'<' -f1 | |
''').redirectErrorStream(true).start().text | |
saida = saida.replaceAll('\\s','') | |
println( saida ) | |
println( hudson.util.Secret.decrypt(saida) ) |