Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [pull_request]

jobs:
validate-pull-request:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
# See:
# https://github.com/marketplace/actions/deploy-pr-preview
deploy-preview:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main
jobs:
release-please:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: google-github-actions/release-please-action@v3
id: release
Expand Down
115 changes: 114 additions & 1 deletion docs/07-shell-snippets/00-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'Shell Snippets'
slug: '/shell-snippets/'
---

After finishing the [Effective Shell Book](https://amzn.to/4ho0F91) I still find myself regularly discovering techniques that are huge time-savers. I've called these **Effective Shell Snippets** and will update this page with them from time to time, so check back regularly!
After finishing the [Effective Shell Book](https://amzn.to/4ho0F91) I still find myself regularly discovering or remembering techniques that are huge time-savers. I've called these **Effective Shell Snippets** and will update this page with them from time to time, so check back regularly!

### Git + AI: Interactively Staging Changes, Summarising with AI

Expand Down Expand Up @@ -112,3 +112,116 @@ example: # Here's an example of how to add a description!
```

This is also documented in a little repo at [github.com/dwmkerr/makefile-help](https://github.com/dwmkerr/makefile-help).

### Dot files and `envsubst`

The `envsubst` command can be used to quickly create and populate template files. When combined with `.env` files, which are a common feature of projects that need to manage secrets, you can rapidly inject secrets or configuration into workflows. Here's a quick demo - which is detailed below:

![Envsubst Demo](./snippets/envsubst/envsubst.svg)

In this demo we:

- Show the contents of a `.env` file. This is shown in colour by using `bat` - a popular alternative to `cat`.
- Show the contents of a `secret.template.yaml` file - which has placeholders for sensitive confiratu

```bash
# First create a template.
cat <<EOF > secret.template.yaml
apiVersion: v1
kind: Secret
metadata:
name: my-secret
type: Opaque
data:
username: \${USERNAME}
password: \${PASSWORD}
EOF

# Demo is better in colors. This is the template above but from bat.
alias cat="bat --plain --theme base16 --force-colorization --language yaml" && clear

# Let's check how this looks.
cat secret.template.yaml

# Now demo substitute env vars. Pipe into cat for colors.
USERNAME=developer PASSWORD=123 envsubst < config.template.yaml | cat

# Demo:

# Setup
source ./init.sh

# Show secret.
bat secret.template.yaml

# Show env.
bat .env

# Show subsitution.
source .env
envsubst < secret.template.yaml

# Show more.
PASSWORD=123 envsubst < secret.template.yaml
```

### Free up a port

It's really easy to leave applications that are listening to a port, such as application servers or docker containers running by mistake. In this circumstance you can find the process that is using the port, grab its process ID and then kill it. But beyond the fact that `lsof` needs to be used, I always forget the command.

The `killport` function finds the process using the port, kills it, and shows a quick summary:

```
$ killport 3000
killed process with id 48022 using port 3000: next-server (v15.3.3)
```

![Demo](./snippets/killport/recording.cast)

In this case I use the `killport` function defined below:

```bash
killport() {
local name="killport"
if [[ "$1" == "-h" ]]; then
echo "usage: ${name} <port>"
echo " Kills the process using the specified port, e.g:"
echo " ${name} 8080"
return 0
fi

# Check if port number was provided
if [[ -z "$1" ]]; then
echo "error: no port specified"
echo "usage: ${name} <port>"
return 1
fi

local port="$1"

# Find the process using the port
local pid=$(lsof -ti :"${port}")

if [[ -z "$pid" ]]; then
echo "no process found using port ${port}"
return 1
fi

# Get process info before killing it
local process_info=$(ps -p "${pid}" -o comm | tail -n 1)

# Kill the process, update the user.
if kill "${pid}"; then
echo -e "killed process using port \e[1;37m${port}\e[0m: \e[1;32m${process_info}\e[0m"
else
echo "failed to kill process ${pid} using port ${port}"
return 1
fi
}
```

Lots of fun tweaks could be made to this function, such as:

- Asking for operator to confirm before killing the process
- Listing all processes using a port range, or all ports
- Allowing the user for force kill if a regular kill doesn't free up the port
2 changes: 2 additions & 0 deletions docs/07-shell-snippets/snippets/envsubst/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export USERNAME=admin
export PASSWORD=p@ssw0rd
138 changes: 138 additions & 0 deletions docs/07-shell-snippets/snippets/envsubst/envsubst.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{"version": 2, "width": 80, "height": 15, "timestamp": 1744108943, "env": {"SHELL": "/usr/local/bin/bash", "TERM": "xterm-256color"}, "title": "Terminal AI"}
[1.414229, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[1.974044, "o", "\u001b[7msource ./init.sh\u001b[27m\r\n\r"]
[2.43966, "o", "\u001b[A\u001b[C\u001b[Csource ./init.sh\r\n"]
[2.440432, "o", "\r\u001b[A\r\n\u001b[?2004l\r"]
[2.449554, "o", "\u001b[H\u001b[2J\u001b[3J"]
[2.608423, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[3.311795, "o", "b"]
[3.429073, "o", "a"]
[3.574034, "o", "t"]
[4.092826, "o", " "]
[4.257853, "o", "."]
[4.366046, "o", "e"]
[4.498265, "o", "n"]
[4.656332, "o", "v"]
[4.852409, "o", "\r\n"]
[4.852573, "o", "\u001b[?2004l\r"]
[4.881763, "o", "\r\u001b[35mexport\u001b[0m\u001b[37m \u001b[0m\u001b[37mUSERNAME\u001b[0m\u001b[37m=\u001b[0m\u001b[37madmin\u001b[0m\u001b[m\r\n\u001b[35mexport\u001b[0m\u001b[37m \u001b[0m\u001b[37mPASSWORD\u001b[0m\u001b[37m=\u001b[0m\u001b[37mp@ssw0rd\u001b[0m\u001b[m\r\n\r\u001b[K"]
[4.961946, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[6.189847, "o", "b"]
[6.326162, "o", "a"]
[6.433507, "o", "t"]
[6.532772, "o", " "]
[6.923665, "o", "s"]
[7.008378, "o", "e"]
[7.186081, "o", "cret.template.yaml "]
[7.684088, "o", "\r\n\u001b[?2004l\r"]
[7.743424, "o", "\r\u001b[31mapiVersion\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mv1\u001b[0m\u001b[m\r\n\u001b[31mkind\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mSecret\u001b[0m\u001b[m\r\n\u001b[31mmetadata\u001b[0m\u001b[37m:\u001b[0m\u001b[m\r\n\u001b[37m \u001b[0m\u001b[31mname\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mmy-secret\u001b[0m\u001b[m\r\n\u001b[31mtype\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mOpaque\u001b[0m\u001b[m\r\n\u001b[31mdata\u001b[0m\u001b[37m:\u001b[0m\u001b[m\r\n\u001b[37m \u001b[0m\u001b[31musername\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32m${USERNAME}\u001b[0m\u001b[m\r\n\u001b[37m \u001b[0m\u001b[31mpassword\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32m${PASSWORD}\u001b[0m\u001b[m\r\n\r\u001b[K"]
[7.825067, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[9.244929, "o", "s"]
[9.337423, "o", "o"]
[9.410046, "o", "u"]
[9.517257, "o", "r"]
[9.713587, "o", "c"]
[9.768928, "o", "e"]
[9.811702, "o", " "]
[9.974041, "o", "."]
[10.108996, "o", "e"]
[10.231267, "o", "n"]
[10.348152, "o", "v"]
[10.816038, "o", "\r\n"]
[10.816108, "o", "\u001b[?2004l\r"]
[10.922994, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[11.452655, "o", "e"]
[11.58162, "o", "n"]
[11.728454, "o", "v"]
[12.100739, "o", "s"]
[12.246567, "o", "u"]
[12.378394, "o", "b"]
[12.710763, "o", "st "]
[13.274213, "o", "<"]
[13.406007, "o", " "]
[14.509403, "o", "s"]
[14.617278, "o", "e"]
[14.831949, "o", "cret.template.yaml "]
[15.37469, "o", "\r\n"]
[15.374761, "o", "\u001b[?2004l\r"]
[15.388983, "o", "apiVersion: v1\r\nkind: Secret\r\nmetadata:\r\n name: my-secret\r\ntype: Opaque\r\ndata:\r\n username: admin\r\n password: p@ssw0rd\r\n"]
[15.49281, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[16.147926, "o", "envsubst < secret.template.yaml "]
[16.471567, "o", " "]
[17.130184, "o", "\b\u001b[K"]
[17.351013, "o", "|"]
[17.738301, "o", " "]
[18.340157, "o", "c"]
[18.483199, "o", "a"]
[18.551749, "o", "t"]
[18.672216, "o", "\r\n"]
[18.672437, "o", "\u001b[?2004l\r"]
[18.686152, "o", "\u001b[31mapiVersion\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mv1\u001b[0m\r\n\u001b[31mkind\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mSecret\u001b[0m\r\n"]
[18.686295, "o", "\u001b[31mmetadata\u001b[0m\u001b[37m:\u001b[0m\r\n\u001b[37m \u001b[0m\u001b[31mname\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mmy-secret\u001b[0m\r\n\u001b[31mtype\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mOpaque\u001b[0m\r\n\u001b[31mdata\u001b[0m\u001b[37m:\u001b[0m\r\n\u001b[37m \u001b[0m\u001b[31musername\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32madmin\u001b[0m\r\n"]
[18.686404, "o", "\u001b[37m \u001b[0m\u001b[31mpassword\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mp@ssw0rd\u001b[0m\r\n"]
[18.787559, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[19.917495, "o", "envsubst < secret.template.yaml | cat"]
[20.705711, "o", "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"]
[21.205883, "o", "\u001b[1@P"]
[21.46006, "o", "\u001b[1@S"]
[21.968549, "o", "\b\u001b[1P"]
[22.047141, "o", "\u001b[1@A"]
[22.084128, "o", "\u001b[1@S"]
[22.283118, "o", "\u001b[1@S"]
[22.584601, "o", "\u001b[1@W"]
[22.685737, "o", "\u001b[1@O"]
[22.80897, "o", "\u001b[1@R"]
[22.868806, "o", "\u001b[1@D"]
[23.143683, "o", "\u001b[1@="]
[23.397864, "o", "\u001b[1@1"]
[23.451889, "o", "\u001b[1@2"]
[23.522645, "o", "\u001b[1@3"]
[23.610962, "o", "\u001b[1@ "]
[23.905234, "o", "\r\n\u001b[?2004l\r"]
[23.924711, "o", "\u001b[31mapiVersion\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mv1\u001b[0m\r\n\u001b[31mkind\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mSecret\u001b[0m\r\n"]
[23.924926, "o", "\u001b[31mmetadata\u001b[0m\u001b[37m:\u001b[0m\r\n\u001b[37m \u001b[0m\u001b[31mname\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mmy-secret\u001b[0m\r\n\u001b[31mtype\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mOpaque\u001b[0m\r\n\u001b[31mdata\u001b[0m\u001b[37m:\u001b[0m\r\n\u001b[37m \u001b[0m\u001b[31musername\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32madmin\u001b[0m\r\n"]
[23.925043, "o", "\u001b[37m \u001b[0m\u001b[31mpassword\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[38;5;9m123\u001b[0m\r\n"]
[24.025895, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[24.680035, "o", "PASSWORD=123 envsubst < secret.template.yaml | cat"]
[24.972703, "o", "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"]
[25.75738, "o", "\u001b[1@U"]
[25.84755, "o", "\u001b[1@S"]
[25.954557, "o", "\u001b[1@E"]
[26.015216, "o", "\u001b[1@R"]
[26.095096, "o", "\u001b[1@N"]
[26.19492, "o", "\u001b[1@A"]
[26.283728, "o", "\u001b[1@M"]
[26.372268, "o", "\u001b[1@E"]
[26.594335, "o", "\u001b[1@-"]
[27.073742, "o", "\b\u001b[1P"]
[27.176135, "o", "\u001b[1@="]
[27.299944, "o", "\u001b[1@d"]
[27.373786, "o", "\u001b[1@w"]
[27.470683, "o", "\u001b[1@m"]
[27.539954, "o", "\u001b[1@k"]
[27.590762, "o", "\u001b[1@e"]
[27.674153, "o", "\u001b[1@r"]
[27.807951, "o", "\u001b[1@r"]
[27.895631, "o", "\u001b[1@ "]
[28.132529, "o", "\r\n"]
[28.132748, "o", "\u001b[?2004l\r"]
[28.15009, "o", "\u001b[31mapiVersion\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mv1\u001b[0m\r\n\u001b[31mkind\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mSecret\u001b[0m\r\n"]
[28.15028, "o", "\u001b[31mmetadata\u001b[0m\u001b[37m:\u001b[0m\r\n\u001b[37m \u001b[0m\u001b[31mname\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mmy-secret\u001b[0m\r\n\u001b[31mtype\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mOpaque\u001b[0m\r\n\u001b[31mdata\u001b[0m\u001b[37m:\u001b[0m\r\n\u001b[37m \u001b[0m\u001b[31musername\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[32mdwmkerr\u001b[0m\r\n\u001b[37m \u001b[0m\u001b[31mpassword\u001b[0m\u001b[37m:\u001b[0m\u001b[37m \u001b[0m\u001b[38;5;9m123\u001b[0m\r\n"]
[28.265069, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[29.836427, "o", "e"]
[29.905896, "o", "c"]
[29.981684, "o", "h"]
[30.038105, "o", "o"]
[30.19245, "o", " "]
[30.390608, "o", "\""]
[30.617878, "o", "c"]
[30.718311, "o", "o"]
[30.831755, "o", "o"]
[30.978371, "o", "l"]
[31.257071, "o", "\""]
[31.471589, "o", "\r\n"]
[31.4717, "o", "\u001b[?2004l\r"]
[31.472563, "o", "cool\r\n"]
[31.589395, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32m\u001b[4mmain\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[32.46266, "o", "\u001b[?2004l\r\r\n"]
[32.463063, "o", "exit\r\n"]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions docs/07-shell-snippets/snippets/envsubst/envsubst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# First create a template.
cat <<EOF > secret.template.yaml
apiVersion: v1
kind: Secret
metadata:
name: my-secret
type: Opaque
data:
username: \${USERNAME}
password: \${PASSWORD}
EOF

# Demo is better in colors. This is the template above but from bat.
alias cat="bat --plain --theme base16 --force-colorization --language yaml" && clear

# Let's check how this looks.
cat secret.template.yaml

# Now demo substitute env vars. Pipe into cat for colors.
USERNAME=developer PASSWORD=123 envsubst < config.template.yaml | cat

# Demo:

# Setup
source ./init.sh

# Show secret.
bat secret.template.yaml

# Show env.
bat .env

# Show subsitution.
source .env
envsubst < secret.template.yaml

# Show more.
PASSWORD=123 envsubst < secret.template.yaml
1 change: 1 addition & 0 deletions docs/07-shell-snippets/snippets/envsubst/envsubst.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/07-shell-snippets/snippets/envsubst/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Demo is better in colors. This is the template above but from bat.
alias cat="bat --plain --theme base16 --force-colorization --language yaml"
alias bat="bat --plain --theme base16 --force-colorization"
clear
44 changes: 44 additions & 0 deletions docs/07-shell-snippets/snippets/envsubst/recording.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{"version": 2, "width": 80, "height": 15, "timestamp": 1750059615, "env": {"SHELL": "/usr/local/bin/bash", "TERM": "xterm-256color"}, "title": "Terminal AI"}
[1.433577, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32mfeat/envsubst-killport\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[2.034277, "o", "k"]
[2.274531, "o", "i"]
[2.608128, "o", "l"]
[2.748635, "o", "l"]
[3.022153, "o", "p"]
[3.081931, "o", "o"]
[3.234455, "o", "r"]
[3.29366, "o", "t"]
[3.483957, "o", "\r\n"]
[3.483991, "o", "\u001b[?2004l\r"]
[3.48426, "o", "error: no port specified\r\nusage: killport <port>\r\n"]
[3.558187, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32mfeat/envsubst-killport\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[4.55078, "o", "k"]
[4.733415, "o", "i"]
[4.965858, "o", "l"]
[5.100758, "o", "l"]
[5.270919, "o", "p"]
[5.33211, "o", "o"]
[5.439241, "o", "r"]
[5.535072, "o", "t"]
[5.611154, "o", " "]
[6.030778, "o", "3"]
[6.197284, "o", "0"]
[6.38131, "o", "0"]
[6.538704, "o", "0"]
[6.870086, "o", "\r\n"]
[6.87021, "o", "\u001b[?2004l\r"]
[6.913926, "o", "killed process using port 3000: /Applications/Docker.app/Contents/MacOS/com.docker.backend\r\n"]
[7.006818, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32mfeat/envsubst-killport\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[13.635868, "o", "\u0007"]
[15.100458, "o", "^C"]
[15.10082, "o", "\u001b[?2004l\r"]
[15.101065, "o", "\u001b[?2004h\u001b[?2004l\r"]
[15.101394, "o", "\r\n"]
[15.172262, "o", "\u001b[?2004h\r\n\u001b[1m\u001b[34m07-shell-snippets/snippets/envsubst\u001b(B\u001b[m \u001b[32mfeat/envsubst-killport\u001b(B\u001b[m \u001b[31m!\u001b(B\u001b[m \u001b[35mconda/\u001b[1mbase\u001b[0m\u001b(B\u001b[m \r\n\u001b[1m\u001b[37m$\u001b(B\u001b[m "]
[15.303846, "o", "e"]
[15.467329, "o", "x"]
[15.542469, "o", "i"]
[15.626898, "o", "t"]
[15.692584, "o", "\r\n"]
[15.692791, "o", "\u001b[?2004l\r"]
[15.692819, "o", "exit\r\n"]
8 changes: 8 additions & 0 deletions docs/07-shell-snippets/snippets/envsubst/secret.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: my-secret
type: Opaque
data:
username: ${USERNAME}
password: ${PASSWORD}
Loading