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
def daysBefore = 30 | |
def currentMillis = System.currentTimeMillis() | |
def cutOfDate = System.currentTimeMillis() - 1000L * 60 * 60 * 24 * daysBefore | |
long sumDurationMillis = 0 | |
for (job in Jenkins.instance.getAllItems(Job.class)) { | |
def job_name = job.getFullName() | |
long durationMillis = 0 |
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
def pod = | |
""" | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
name: worker | |
spec: | |
serviceAccountName: jenkins | |
containers: |
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
@NonCPS | |
def cancelPreviousBuilds() { | |
def jobName = env.JOB_NAME | |
def buildNumber = env.BUILD_NUMBER.toInteger() | |
def ghPrId = env.ghprbPullId.toInteger() | |
/* Get job name */ | |
def currentJob = Jenkins.instance.getItemByFullName(jobName) | |
/* Iterating over the builds for specific job */ |
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 bash | |
# https://argoproj.github.io/argo-cd/faq/#i-forgot-the-admin-password-how-do-i-reset-it | |
username=$1 | |
password=$2 | |
if [[ -z $username || -z $password ]]; then | |
echo "Usage: $0 \$username \$password" | |
echo "Missing username or password argument" |
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
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: echoserver | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: echoserver | |
namespace: echoserver |
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 bash | |
function removeComments() { | |
# remove line that starts with # | |
sed '/^#/ d' < redis_default.conf > redis_default_without_comments.conf | |
# remove line that starts with space | |
sed '/^[[:space:]]*$/d' < redis_default_without_comments.conf > redis_default_clean.conf | |
} | |
wget http://download.redis.io/redis-stable/redis.conf -O redis_default.conf | |
removeComments |
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 bash | |
if [[ $# -lt 2 ]]; then | |
echo "Please specify parameters" | |
echo "For example, ./convert_edem.tv_playlist.sh ABCDE123456 123456abc" | |
exit 1 | |
fi | |
ACCESS_KEY=$1 | |
DOMAIN=$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
#!/bin/bash | |
#Author Jobin Joseph | |
#Blog : JobNix.in | |
#Bio : JobinJoseph.com | |
#Bitbucket credentials | |
bbuser='Username_here' | |
bbpass='password_here' | |
fname=`date +%F_%H_%M` |
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 bash | |
# https://httpd.apache.org/docs/2.4/misc/password_encryptions.html | |
# $ htpasswd -nbm sturman Passw0rd > .htpasswd | |
# $ ./check_pass.sh .htpasswd sturman Passw0rd | |
HTPASSWD=$1 | |
USERNAME=$2 | |
PASSWORD=$3 | |
ENTRY=$(grep "^$USERNAME:" < "$HTPASSWD") |
NewerOlder