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
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import jenkins.branch.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; |
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
guakeRootId=`xwininfo -name "Guake!" -int -tree | awk 'FNR == 4 {print $4}'` | |
xdotool search --name "Guake!" windowreparent $guakeRootId | |
echo "Re-attached guake with rootid $guakeRootId" |
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
aws ecr get-authorization-token --output json | \ | |
jq -n 'input.authorizationData | {auths: (reduce .[] as $d ({}; . + {($d.proxyEndpoint|sub("https?://";"")): {auth:$d.authorizationToken}}))}' |
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 -e | |
GREEN='\033[0;32m' | |
# watch current directory for change | |
fswatch -o ./* | while read -d 1; do | |
# commit and push | |
git add . && git commit --no-status -m "jenkins-test" && git push -q | |
printf "\n${GREEN}-> commit & push done\n" | |
# Jenkins trigger |
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 getChangeLog(currentBuild) { | |
def changeLogSets = currentBuild.changeSets | |
def changeLogToReturn = '' | |
currentBuild | |
.changeSets | |
.each { changeLogSet -> | |
changeLogSet.items.each { changeSet -> | |
def commmitDate = new Date().format("EEE MMM dd yy HH:mm:ss", TimeZone.getTimeZone('GMT+5:30')) | |
changeLogToReturn += "<${changeLogSet.browser.repoUrl}commit/${changeSet.commitId}|${changeSet.msg}> by ${changeSet.author} on ${commmitDate}, commit details below\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
# CentOS-Base.repo | |
# | |
# The mirror system uses the connecting IP address of the client and the | |
# update status of each mirror to pick mirrors that are updated to and | |
# geographically close to the client. You should use this for CentOS updates | |
# unless you are manually picking other mirrors. | |
# | |
# If the mirrorlist= does not work for you, as a fall back you can try the | |
# remarked out baseurl= line instead. |
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
# requires oathtool configuration | |
function mfa() { | |
echo valid $(expr 30 - $(date +%s) % 30)s | |
oathtool --totp --base32 <mfa-secret-key> | tee /dev/tty | pbcopy | |
} | |
# set env for terraform | |
function dazn_aws_set_env() | |
{ | |
mfa |
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 subprocess | |
ALL_SIGNALS = {} | |
for sig in range(64): | |
sig += 1 | |
sig_cmd = "kill -l " + str(sig) + " 2>/dev/null" | |
ALL_SIGNALS[sig] = subprocess.Popen(sig_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True).communicate()[0].strip() | |
def getSignals(pid, sigCat): | |
signal_cmd = "grep \"^" + sigCat + ":\" \"/proc/" + str(pid) + "/status\" | cut -c 9-" |
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
class Abc { | |
func1() { | |
return 'This is function 1' | |
} | |
func2() { | |
return 2; | |
} | |
func3() { | |
return Promise.resolve('three'); | |
} |
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
package handlers | |
import ( | |
"context" | |
) | |
func RequestHandler(ctx context.Context) (string, error) { | |
return "some-string", nil | |
} |
OlderNewer