I will store some utilities that I used on day to day and I chose rust to be able to use the same utilities in unix and windows systems.
To install you will need cargo installed. To install all binaries run:
cargo install \
--git https://github.com/jaysonsantos/cli-utils-rs
To install a specific binary:
cargo install \
--git https://github.com/jaysonsantos/cli-utils-rs \
--bin aws-ssm-env-importer
delete-line simply delete a line in a file.
delete-line 0.1.0
USAGE:
delete-line <file> <line_number>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
ARGS:
<file>
<line_number> Line number (1) or range (1-10)
delete-local-branches delete all local branches except current active branch in order to declutter
aws-flow-logs parse aws flow logs in a bucket.
error: The following required arguments were not provided:
<region>
<bucket>
<prefix>
<filter_query>
USAGE:
aws-flow-logs <region> <bucket> <prefix> <filter_query>
aws-flow-logs eu-central-1 bucket prefix/2019/04/24 'src.port in {80 443} && dstport == 55540 && dstip in {10.0.0.0/8} && action == "REJECT"'
Matched with FlowLogLine {
version: "2",
account_id: "x",
interface_id: "eni-x",
srcaddr: V4(
127.0.0.1,
),
dstaddr: V4(
10.0.145.125,
),
srcport: 443,
dstport: 55540,
protocol: "6",
packets: "1",
bytes: 40,
start: 1556114469,
end: 1556114525,
action: "REJECT",
log_status: "OK",
}
Import .env files into ssm using a template for the key.
USAGE:
aws-ssm-env-importer [FLAGS] --app-name <app_name> --env-file <env_file> --environment <environment> --region <region> --template <template>
FLAGS:
-d, --dry-run
-h, --help Prints help information
-o, --overwrite
-u, --uppercase
-V, --version Prints version information
OPTIONS:
-a, --app-name <app_name>
-f, --env-file <env_file>
-e, --environment <environment>
-r, --region <region>
-t, --template <template> Template to generate the key on SSM side, example
"/{environment}/{app_name}/{key}"
aws-ssm-env-importer \
--env-file .env \
--environment environment \
--app-name test-app \
--template "/{environment}/{app_name}/{key}" \
--region eu-central-1 \
--dry-run
Export ssm keys to .env files.
USAGE:
aws-ssm-env-exporter [FLAGS] [OPTIONS] --env-file <env-file> --path <path> --replace <replace> --search <search>
FLAGS:
-h, --help Prints help information
-l, --lowercase
-u, --uppercase
-V, --version Prints version information
OPTIONS:
-f, --env-file <env-file>
-p, --path <path>
-r, --region <region>
-t, --replace <replace>
-e, --search <search>
aws-ssm-env-exporter \
--env-file output.env \
--path /my/app \
--search '.+/(.[^/]*)$' \
--uppercase \
--replace $1
When running ksql, if you delete the topics for a stream instead of
stopping the queries and then deleting the stream this can lead to really long load times on ksql.
To fix the problem you first need to see the variable KSQL_KSQL_STREAMS_PRODUCER_MAX_BLOCK_MS
with a lower value like 1000 and restart ksql.
fix-ksql-deleted-topics http://ksql-host:port/ksql