Skip to content

Instantly share code, notes, and snippets.

@slide
slide / Windows10-Setup.ps1
Created May 5, 2016 14:31 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@slide
slide / createPDF.gs
Created August 24, 2017 03:14 — forked from andrewroberts/createPDF.gs
This is a Google Apps Script that creates a PDF file using a Google Doc template and the values in a Google Spreadsheet. More details can be found at www.andrewroberts.net/2014/10/google-apps-script-create-pdf/
// dev: andrewroberts.net
// Replace this with ID of your template document.
var TEMPLATE_ID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'
// var TEMPLATE_ID = '1wtGEp27HNEVwImeh2as7bRNw-tO4HkwPGcAsTrSNTPc' // Demo template
// Demo script - http://bit.ly/createPDF
// You can specify a name for the new PDF file here, or leave empty to use the
// name of the template.
@NonCPS
def getTimestamp(build) {
def buildTimeStampFormat = new java.text.SimpleDateFormat('yyyy-MM-dd_HH-mm-ss')
buildTimeStampFormat.timeZone = java.util.TimeZone.default
return buildTimeStampFormat.format(build.timestamp.time)
}
checkout perforce(credential: 'XCAESFASFSDGKLJSDGLKJSDGSDGSG',
populate: syncOnly(force: false, have: true, modtime: false,
parallel: [enable: true, minbytes: '1024', minfiles: '1', threads: '4'],
pin: '', quiet: true, revert: true),
workspace: manualSpec(charset: 'none', name: "jenkins-${env.NODE_NAME}-${env.JOB_NAME}",
pinHost: false,
spec: clientSpec(allwrite: true, backup: false, clobber: false, compress: false, line: 'UNIX', locked: false, modtime: false, rmdir: false, serverID: '',
streamName: "//streamsdepot/${params.STREAM_NAME}", type: 'WRITABLE', view: '')))
@slide
slide / error
Created February 14, 2018 23:18
[WARNING] Rule 5: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for org.slf4j:slf4j-api:1.7.7 paths to dependency are:
+-org.jenkins-ci.plugins:publish-over-ftp:1.14-SNAPSHOT
+-org.slf4j:slf4j-api:1.7.7
and
+-org.jenkins-ci.plugins:publish-over-ftp:1.14-SNAPSHOT
+-org.slf4j:log4j-over-slf4j:1.7.7
+-org.slf4j:slf4j-api:1.7.7
and
@NonCPS
def getLastJobInfo(build) {
def res = null
try {
if(build.previousBuild != null) {
def resp = httpRequest(quiet: true, url: "http://SERVER/jenkins/job/SOMEJOB/job/Pipeline/${build.previousBuild.id}/wfapi/describe")
res = readJSON(text: resp.content)
}
} catch(e) {
res = null
@NonCPS
def createBody(build, env, changeSets, builds, failedBuilds) {
def text = '''
<html>
<style>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
font-size:11px;
color:black;
}
@slide
slide / job.groovy
Created September 28, 2018 19:26
This
import hudson.plugins.git.*
import hudson.model.*
import jenkins.model.*
import jenkins.util.SystemProperties
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.*
import org.csanchez.jenkins.plugins.kubernetes.*
import org.csanchez.jenkins.plugins.*
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:section title="Support Bundle Anonymization">
<f:entry field="enabled" title="Anonymize support bundle contents">
<f:checkbox />
</f:entry>
</f:section>
</j:jelly>
stage('TEST STATE') {
steps {
script {
withJenkinsCreds {
sh "python3.7 ./var/testStuff.py"
}
}
}
}