This file contains hidden or 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
# source https://devblogs.microsoft.com/commandline/memory-reclaim-in-the-windows-subsystem-for-linux-2/ | |
# as root | |
echo 1 > /proc/sys/vm/drop_caches | |
echo 1 > /proc/sys/vm/compact_memory | |
This file contains hidden or 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
# get pod uid | |
k get po pod-name -o jsonpath='{.metadata.uid}' | |
# then assuming your pod is burstable then the cgroup will be that: | |
/sys/fs/cgroup/memory/kubepods.slice/kubepods-burstable.slice{your pod uid with underscores rather than hyphens} |
This file contains hidden or 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
openssl req -x509 -newkey rsa:2048 -keyout my.domain.key -out my.domain.pem -days 3650 -subj '/CN=*.my.domain' -nodes -addext 'extendedKeyUsage=1.3.6.1.5.5.7.3.2,1.3.6.1.5.5.7.3.1' | |
openssl x509 -inform pem -in my.pem -outform der -out my.cer |
This file contains hidden or 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
Jenkins.instance.getAllItems(AbstractItem.class) | |
.findAll {job -> job.fullName.matches("your-job-regex")} | |
.each { job -> job.getLastBuild().doKill() } |
This file contains hidden or 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
#{Octopus.Version.Channel.LastMajor}.#{Octopus.Version.Channel.LastMinor}.#{Octopus.Version.Channel.LastPatch}#{if Octopus.Version.Channel.LastSuffix != "-" }#{Octopus.Version.Channel.LastSuffix}#{/if}.#{Octopus.Version.Channel.NextBuild} |
This file contains hidden or 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
# first must run kubectl proxy in a separate terminal | |
kubectl proxy | |
# then run this (replace delete-me) | |
kubectl get ns delete-me -o json | \ | |
jq '.spec.finalizers=[]' | \ | |
curl -X PUT http://localhost:8001/api/v1/namespaces/delete-me/finalize -H "Content-Type: application/json" --data @- |
This file contains hidden or 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
// This can be executed in the master node script console | |
Jenkins.instance.getAllItems(AbstractItem.class) | |
.findAll {job -> job.fullName.matches("^(a|b).*/master")} | |
.each { job -> | |
def actions = [new CauseAction(new Cause.UserIdCause()), new ParametersAction(new BooleanParameterValue("X", true))] as Action[] | |
job.scheduleBuild2(0, actions) | |
}; |
This file contains hidden or 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
$Cache = @{Names=@{}} | |
function makectx { | |
@{ | |
Namespace = "default" | |
Ctx = $(kubectl config current-context) | |
Current = @{Name = $null; TypeAlias=$null} | |
} | |
} |
This file contains hidden or 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
(dotnet list package --outdated | Select-String ".*(> )([a-zA-Z\.]+).*").Matches | % {dotnet add package $_.Groups[2].Value} |