Skip to content

Instantly share code, notes, and snippets.

View tearoom6's full-sized avatar
🐟
Go more. Go fast.

tearoom6 tearoom6

🐟
Go more. Go fast.
View GitHub Profile
@tearoom6
tearoom6 / post_estimated_charges.sh
Created December 10, 2017 16:21
Post AWS charges to Slack.
#!/bin/bash
# post_estimated_charges.sh
# Post AWS/Billing EstimatedCharges to Slack.
channel=$1
aws cloudwatch get-metric-statistics \
--namespace AWS/Billing \
--metric-name EstimatedCharges \
--start-time `date "+%Y-%m-%dT00:00:00Z" -d "2 days ago"` \
--end-time `date "+%Y-%m-%dT00:00:00Z"` \
//
// re-authenticate_line_developer.gs
//
// Extend the expiration date of the LINE developer by accessing URL of a notification mail.
//
// @author tearoom6 2016/12/15-
//
var SLACK_POST_URL = 'https://hooks.slack.com/services/xxxxxx/xxxxxxxxxxxxxxxxxxxx';
var SLACK_NOTIFY_CHANNEL = '#general';
/*
* reserve_its_kenpo.js
* ITS健保施設予約
* @tearoom6
*
* usage)
* phantomjs reserve_its_kenpo.js command [args]
*/
// global variables
function try() {
if type $1 2>/dev/null 1>/dev/null; then
eval $@
fi
}
//
// post_to_slack.gs
//
// Monitor specified labeled mails and post to Slack.
//
// @author tearoom6 2015/12/24-
//
var SLACK_POST_URL = 'https://hooks.slack.com/services/xxxx/xxxx';
var TARGETS = [
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head