Example of inter-conversion between datetime string and Unixtime in Terraform.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fetch resource counts of HPC Terraform | |
* | |
* Usage: | |
* - Run the `setUserPreference` function to register your API_TOKEN and ORGANIZATION in the script's properties. | |
* - You can verify the stored properties using the log output of the `getUserPreference` function. | |
* - Set a periodic trigger to execute the "getTerraformData" function. | |
*/ | |
const BASE_URL = "https://app.terraform.io/api/v2"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# aws-cloudshell-cred.sh | |
# Get the credentials from AWS CloudShell and output to credential file format. | |
CONTAINER_CREDENTIALS=$(curl -sSf -H "Authorization: ${AWS_CONTAINER_AUTHORIZATION_TOKEN}" "${AWS_CONTAINER_CREDENTIALS_FULL_URI}") | |
if [ $? -ne 0 ]; then | |
echo "failed get container credentials." | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Manage Data Additional Information", | |
"description": null, | |
"permissions": "PUBLIC_READ_WRITE", | |
"pages": [ | |
{ | |
"name": "Ingest Resource Request Per Minute", | |
"description": null, | |
"widgets": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Output aws cli command in bash script | |
# Usage: echo-awscli.sh scriptPath [arg1 arg2 ...] | |
shopt -s expand_aliases | |
# mocks | |
function aws_cli_mock() { | |
case $@ in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_PROJECT="Your CodeBuild Project Name" | |
aws --no-cli-pager codebuild batch-get-builds \ | |
--ids $(aws --no-cli-pager codebuild list-builds-for-project \ | |
--project-name "${_PROJECT}" \ | |
--sort-order DESCENDING --query 'ids[]' --max-items 100 --output text \ | |
| grep -v 'None') \ | |
| jq -r '[ | |
"id", "buildNumber", "startTime", "endTime", "buildStatus", | |
"buildDuration", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
exports.handler = (event, context, callback) => { | |
console.log('event:' + JSON.stringify(event)); | |
// Get contents of request | |
const request = event.Records[0].cf.request; | |
// Rewrite | |
request.headers.host[0].value = '${rewrite_value}'; | |
console.log('request headers:' + JSON.stringify(request.headers)); |
- This is for the AWS switch role
- Generate bookmarks HTML based on ~/.aws/config
- Specify the color in ~/.aws/config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyzabbix import ZabbixAPI | |
import os | |
import json | |
zapi = ZabbixAPI("Your Zabbix URL") | |
zapi.session.verify = False | |
zapi.login("Your Zabbix User", "Your Zabbix Password") | |
print("Connected to Zabbix API Version %s" % zapi.api_version()) | |
output_dir = './var' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# [REST API v2 Overview](https://v2.developer.pagerduty.com/docs/rest-api) | |
# [API Reference](https://developer.pagerduty.com/api-reference) | |
_TOKEN="" # REST API Key | |
_API_VERSION=2 | |
_SERVICE_ID="" # service ID | |
_TIME_ZONE="Asia/Tokyo" | |
_LIMIT=100 # Def:25/Max:100 |
NewerOlder