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
| #!/bin/bash | |
| cat <<'EOF' >.dockerfile.content-tag | |
| FROM busybox:1 | |
| WORKDIR /src/ | |
| ENTRYPOINT ["/bin/sh", "-c", "find . -type f \\! -path ./.dockerfile.content-tag -exec sha256sum -b {} +"] | |
| COPY . /src/ | |
| EOF | |
| iid=$( docker image build -q -f .dockerfile.content-tag . ) |
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
| #!/bin/bash | |
| print_usage () { | |
| printf 'Usage: kubectl evict -n <namespace> <pod>\n' >&2 | |
| } | |
| main () { | |
| if [ "-n" != "$1" ] && [ "--namespace" != "$1" ] | |
| then | |
| print_usage |
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
| apt-get install -y \ | |
| apt-transport-https \ | |
| binutils \ | |
| build-essential \ | |
| python-pip \ | |
| socat \ | |
| sysstat \ | |
| traceroute \ | |
| unzip \ | |
| zip |
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
| #!/bin/bash | |
| while read -r commit_hash | |
| do | |
| message=$( | |
| git cat-file commit "${commit_hash}" | | |
| sed '1,/^$/d' | |
| ) | |
| if [ "${message:0:5}" = 'Merge' ] || [ "${message:0:6}" = 'Revert' ] |
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
| #!/bin/bash | |
| printf '%s,%s,%s,%s,%s,%s,%s,%s\n' \ | |
| 'dir' 'usage_in_bytes' \ | |
| 'cache' 'total_cache' \ | |
| 'rss' 'total_rss' \ | |
| 'rss_huge' 'total_rss_huge' | |
| cd /sys/fs/cgroup/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
| #!/bin/bash | |
| printf '%s,%s,%s,%s,%s,%s,%s,%s\n' \ | |
| 'dir' 'usage_in_bytes' \ | |
| 'cache' 'total_cache' \ | |
| 'rss' 'total_rss' \ | |
| 'rss_huge' 'total_rss_huge' | |
| cd /sys/fs/cgroup/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
| #!/bin/bash | |
| win_profile_dir=$(wslpath "$(cmd.exe /c "echo %USERPROFILE%" | tr -d '\r')") | |
| win_dot_kube_dir="${win_profile_dir}/.kube" | |
| win_kube_config="${win_dot_kube_dir}/config" | |
| wsl_dot_kube_dir="${HOME}/.kube" |
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
| #!/bin/bash | |
| if [ "$_" = "${BASH_SOURCE}" ] | |
| then | |
| printf 'source this script, do not execute.\n' >&2 | |
| exit 1 | |
| fi | |
| eval $(minikube docker-env --shell bash) | |
| if [ -n "${DOCKER_CERT_PATH}" ] && [ "${DOCKER_CERT_PATH:0:1}" != '/' ] |
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
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: example | |
| spec: | |
| initContainers: | |
| - name: file-copy | |
| image: busybox:latest | |
| command: | |
| - cp |
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
| # docker 17.12.1-ce | |
| => docker run | |
| ==> /sys/fs/cgroup/memory/memory.kmem.limit_in_bytes <== | |
| 18446744073709551615 | |
| ==> /sys/fs/cgroup/memory/memory.kmem.tcp.limit_in_bytes <== | |
| 18446744073709551615 | |
| ==> /sys/fs/cgroup/memory/memory.limit_in_bytes <== | |
| 18446744073709551615 |