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
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod |
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
[alias] | |
ci = commit | |
st = status | |
co = checkout | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |
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
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: dummy-pod | |
namespace: dummy | |
spec: | |
containers: | |
- name: dummy | |
image: ubuntu | |
command: ["/bin/bash", "-ec", "while :; do echo '.'; sleep 5 ; done"] |
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/sh | |
# | |
# show time machine logs | |
# -f = follow | |
PRED='subsystem == "com.apple.TimeMachine" AND processImagePath CONTAINS "backupd"' | |
if [ $# -gt 0 ]; then | |
log stream --style syslog --predicate "$PRED" --info | |
else |
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 java.util.concurrent.TimeUnit | |
def uptimeExtension = Jenkins.instance.getExtensionList(jenkins.model.Uptime).get(jenkins.model.Uptime) | |
def uptime = uptimeExtension.uptime | |
def startTime = uptimeExtension.startTime | |
def days, hours, minutes | |
TimeUnit.MILLISECONDS.with { | |
days = toDays(uptime) | |
hours = toHours(uptime) % 24 |
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
#remove all exited containers | |
docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs docker rm |
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
FROM jenkinsci/jenkins:2.30 | |
MAINTAINER Pierre Beitz <[email protected]> | |
USER root | |
RUN apt-get update && \ | |
apt-get install -y docker.io && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
usermod -a -G staff jenkins && \ | |
echo 2.31 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state && \ |
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
private static <T extends Enum<T>, U extends Enum<U>> T fromTypeEnumToTypeEnum(U originValue, Class<T> destinationEnumClass) { | |
for(final T t : destinationEnumClass.getEnumConstants()) { | |
if(t.name().equals(originValue.name())) { | |
return t; | |
} | |
} | |
throw new UnsupportedOperationException("Translation was not implemented for " + originValue); | |
} |
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
public static <T> void trim(List<T> list, int newSize) { | |
Preconditions.checkArgument(newSize >= 0, "Cannot trim the provided list to a negative size"); | |
int size = list.size(); | |
list.subList(Math.min(newSize, size), size).clear(); | |
} |