I provide you with 3 jq lib functions that will help you in converting between snake_case and CamelCase.
I want to change keys in my json from camelcase to snake_case.
| FROM ubuntu:focal | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN apt-get update \ | |
| && apt-get install -y eatmydata \ | |
| && eatmydata apt-get install -y \ | |
| openjdk-11-jdk awscli azure-cli # just some big packages to notice the speedup \ | |
| && rm -rf /var/lib/apt/lists/* |
A lot of us have encountered this before: I need to create multiple instances of a resource,
and we don't want to shoot ourselves in the foot with count, so we want to use for_each.
We define our input as a map of object, each key representing a resource instance.
The key of the map will be the key of the resource in for_each.
If you're using terraform extensively you probably ran into an issue like this.
This is a synthetic example but I still hope the problem is recognizable as something that also happens out in the wild.
First, you have a list variable (in terraform.tfvars)
Download kuttle:
wget https://raw.githubusercontent.com/kayrus/kuttle/master/kuttle
chmod +x kuttle
mv kuttle ~/bincreate tunnel:
Update: I created jq-zsh-plugin that does this.
One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).
Another one of my favourite tools is fzf.
I hereby claim:
To claim this, I am signing this object:
| #! /bin/bash | |
| # An overly obvious reference for most commonly requested bash timestamps | |
| # Now all you Mac fags can stop pestering me. | |
| cat << EOD | |
| Format/result | Command | Output | |
| ------------------------------+----------------------------+------------------------------ | |
| YY-MM-DD_hh:mm:ss | date +%F_%T | $(date +%F_%T) | |
| YYMMDD_hhmmss | date +%Y%m%d_%H%M%S | $(date +%Y%m%d_%H%M%S) |