Dockerfile:
FROM node:20.10.0-alpine3.17 AS base
RUN apk update && \
apk add --no-cache postgresql-client && \
rm -rf /var/cache/apk/*
WORKDIR /usr/src/app| import sys | |
| import time | |
| from subprocess import CalledProcessError, check_output | |
| def convert_bytes_to_gb(bytes_value): | |
| return round(bytes_value / 1000000000, 2) | |
| def convert_kb_to_gb(kb_value): |
Dockerfile:
FROM node:20.10.0-alpine3.17 AS base
RUN apk update && \
apk add --no-cache postgresql-client && \
rm -rf /var/cache/apk/*
WORKDIR /usr/src/appsudo apt-get clean;
sudo apt-get autoclean;
sudo journalctl --vacuum-size=50M;
sudo apt-get autoremove --purge;
sudo docker system prune -a;
sudo apt-get purge $(dpkg -l 'linux-image-*' | awk '/^ii/ && !/'$(uname -r)'/ {print $2}');sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc
echo
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
| #!/usr/bin/env -S awk -f | |
| # Usage: /path/to/tf_vars_sort.awk < variables.tf | tee sorted_variables.tf | |
| # Note: "chmod +x /path/to/tf_vars_sort.awk" before use | |
| { | |
| # skip blank lines at the beginning of file | |
| if (!resource_type && length($0) == 0) next | |
| # pick only known Terraform resource definition block names of the 1st level | |
| # https://github.com/hashicorp/terraform/blob/main/internal/configs/parser_config.go#L55-L163 | |
| switch ($0) { |
web: npm start # or whatever the start command isExtract all name fields:
$[*].name
Find object with a specific id (e.g., id 15):
$[?(@.id==15)]
Extract defaultRegion from all jsonData:
$[*].jsonData.defaultRegion
Filter objects by authType inside jsonData where authType is keys: