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/sh | |
| kubectl --context $CTX -n $NS debug -q -i $POD --image=docker.io/alpine --target $CONTAINER -- /bin/ash -c "apk add tcpdump &>/dev/null; tcpdump -nn -w - -U -s 0 -w -" | wireshark -k -i - | |
| # you can also use `tcpdump -U -s 0 -w -` if you want the dns names |
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
| FROM docker.io/node:22-alpine | |
| RUN apk --no-cache add chromium | |
| # skips puppeteer installing chrome and points to correct binary | |
| ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true | |
| ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser | |
| RUN addgroup pptruser && adduser -D -g pptruser -G pptruser pptruser | |
| USER pptruser |
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 | |
| URL="$1" | |
| REGISTRY="${URL%/*}" | |
| pre="${REGISTRY%.amazonaws.com}" | |
| AWS_REGION="${pre##*.}" | |
| HOME="." | |
| export HOME | |
| aws ecr get-login-password --region "$AWS_REGION" | oras login --username AWS --password-stdin "$REGISTRY" | |
| printf '%s\0' "$@" | xargs -n1 --null oras pull | |
| unset HOME |
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/ash | |
| trap : INT TERM | |
| # your code here... | |
| touch /tmp/tmpfile | |
| trap '{ rm /tmp/tmpfile; }' EXIT | |
| touch /tmp/otherthing |
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
| printf '12345678910' | ( #example data (subshell might or might not be nessaray) | |
| count=0; #init count to zero | |
| while true; #loop forever | |
| do { | |
| ((count++)); #increment count | |
| head -c 2 < /dev/stdin | #take from sdin until... | |
| ifne -n false > "test$count.txt" || exit; #...there is nothing left then exit | |
| } done; | |
| ) |
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/sh | |
| # | |
| # Provides commands for the incremental building or streaming of tar archives | |
| # NOTICE: Do not use compression flags on the input to tarfrg! | |
| # I am not checking you! | |
| # Use in the pipeline instead. e.g. `tarfrg ./tmp/* | tarfrgasm | gzip > archive.tar.gz` | |
| ####################################### |
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
| @echo off | |
| echo. | |
| podman run --rm -v "%cd%":/app -w /app -i registry.io/application:latest %* |
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
| #!/usr/bin/env bash | |
| function ecr-add-tag() { | |
| if (( $# < 3 )); then | |
| echo "Wrong number of arguments. Usage: ecr-add-tag ECR_REPO_NAME TAG_TO_FIND TAG_TO_ADD [AWS_PROFILE] [AWS_REGION]" | |
| return | |
| fi | |
| local repo_name=$1 | |
| local existing_tag=$2 | |
| local new_tag=$3 |