Skip to content

Instantly share code, notes, and snippets.

View TheKrush's full-sized avatar

Keith Yates TheKrush

View GitHub Profile
@TheKrush
TheKrush / DayOfWeek.bat
Last active August 2, 2023 17:57
Simple script that prints the day of the week. Useful for if you only want to execute something on certain days with Task Scheduler (at logon).
@echo off
for /f %%a in ('date /t') do set DAY=%%a
if %DAY%==Sun goto :sunday
if %DAY%==Mon goto :monday
if %DAY%==Tue goto :tuesday
if %DAY%==Wed goto :wednesday
if %DAY%==Thu goto :thursday
if %DAY%==Fri goto :friday
@TheKrush
TheKrush / git_submodule_update.ps1
Created May 23, 2021 23:21
Updates all submodules of current repo to their latest revision, followed by commit and push.
git submodule foreach git reset --hard
git submodule foreach --recursive git checkout
git submodule foreach git pull origin master
git commit -am "Update submodules to latest"
git push
import hudson.model.User;
import hudson.tasks.Mailer;
User.getAll().each { user ->
println user.toString() + "," + user?.getProperty(Mailer.UserProperty.class).getAddress()
}
println ""
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
println "digraph test {"
plugins.each {
def plugin = it.getShortName()
println "\"${plugin}\";"
def deps = it.getDependencies()
deps.each {
def s = it.shortName
println "\"${plugin}\" -> \"${s}\";"
}
@TheKrush
TheKrush / JenkinsPluginDependencies.groovy
Created May 11, 2020 22:49
Jenkins Plugin Dependencies
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
plugins.each {
println "${it.getShortName()} (${it.getVersion()}) => ${it.getDependencies()}"
}
@TheKrush
TheKrush / killunrealbuild.bat
Last active May 11, 2020 22:41
Kill Unreal Builds
taskkill /im UnrealBuildTool.exe /f /t
taskkill /im msbuild.exe /f /t
taskkill /im cl.exe /f /t
taskkill /im cl-filter.exe /f /t
@TheKrush
TheKrush / JenkinsCleanupJobBuildHistory.pipeline
Last active May 11, 2020 23:03
Jenkins Cleanup Job Build History
stage("Information") {
currentBuild.displayName = "#${BUILD_NUMBER} - ${params.JobToClean}"
currentBuild.description = "CleanFailures: ${params.CleanFailures}\nCleanAborts: ${params.CleanAborts}"
}
def buildsToClean = []
stage("Search") {
def job = Jenkins.instance.getItem(params.JobToClean)
job.getBuilds().each {
@Echo off
for /F %%I in ('curl https://myexternalip.com/raw') do set ExtIP=%%I
Echo External IP is : %ExtIP%
taskkill /f /IM explorer.exe
start explorer.exe
exit
@TheKrush
TheKrush / Remove 260 Character Path Limit.reg
Created March 8, 2020 06:39
Windows 10 Long File Paths
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001