JQ Cheatsheet

Loop over JSON array This example will print all of the values associated with the name key: sample='[{"name":"foo"},{"name":"bar"}]' for row in $(echo "${sample}" | jq -r '.[] | @base64'); do echo ${row} | base64 --decode | jq -r…

ELK Cheatsheet

Elasticsearch Get version of ES curl http://localhost:9200/ Get all indices in a cluster curl http://localhost:9200/_aliases Get all indices in a cluster (pretty) curl http://localhost:9200/_aliases?pretty=true Show index creation time curl http://localhost:9200/_cat/indices?h=health,status,index,id,pri,…

Azure Cheatsheet

Getting Started Install latest version of Azure CLI on Mac brew update && brew install azure-cli Resource: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-macos Install latest version of Azure CLI on Linux # YOLO curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash Resources: https://docs.microsoft.com/en-us/cli/…

GCP Cheatsheet

Thanks, I hate it. Getting Started Install gcloud on MacOS First install the SDK: brew install --cask google-cloud-sdk Once that's done, you'll be prompted to make some slight modifications to your ~/.zshrc file: echo '\n# Google Cloud' | tee -a ~/.zshrc echo 'source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.…

Javascript Cheatsheet

Note to self: if you are looking at this, you're in for a bad time Front-End Ajax Submit a POST request via a form without reloading the page As an added bonus, this will also print the response output to the DOM. <!DOCTYPE html> <html lang="…