Skip to content

Instantly share code, notes, and snippets.

View hakuno's full-sized avatar

Seiji 誠 次 hakuno

  • Brazil
  • 05:01 (UTC -03:00)
View GitHub Profile
@hakuno
hakuno / search.sh
Created January 19, 2022 03:39
Download logs from DataDog API
#!/bin/bash
DATADOG_API_KEY=ZZZ
DATADOG_APP_KEY=ZZZ
FILENAME=output
INDEX=0
response=$(curl -L -X POST "https://api.datadoghq.com/api/v2/logs/events/search" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: $DATADOG_API_KEY" \
-H "DD-APPLICATION-KEY: $DATADOG_APP_KEY" --data-raw '{
@hakuno
hakuno / gist:bdcca79a0d4f23dcfd6f0708dfe6c671
Created October 30, 2023 17:40
Detect which Terraform modules have changes at commit
git diff --name-only {{ circle_branch.stdout }} | \
xargs -n1 dirname | \
sort | \
uniq | \
xargs -I{} find ../../{} -maxdepth 1 -type f -name 'main.tf' ! -path '*.terraform*' | \
xargs -n1 dirname