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/sh | |
set -eux | |
PROFILE="default" | |
RESP="$(aws --profile ${PROFILE} --region "us-east-1" health describe-events --query 'events[?eventTypeCategory==`scheduledChange` && statusCode == `upcoming`]')" | |
LENGTH="$(echo ${RESP} | jq 'length')" | |
for i in $(seq 0 $(($LENGTH-1))) |
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
https://github.com/tatsuru/targs |
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
... | |
write(2, "test\n", 5test | |
) = 5 | |
exit_group(0) = ? | |
+++ exited with 0 +++ |
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
tatsuru@moryo$ strace ./nothing /tmp | |
execve("./nothing", ["./nothing"], [/* 53 vars */]) = 0 | |
arch_prctl(ARCH_SET_FS, 0x4b4868) = 0 | |
sched_getaffinity(0, 8192, [f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...]) = 64 | |
mmap(0xc000000000, 65536, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc000000000 | |
munmap(0xc000000000, 65536) = 0 | |
mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1a20c3f000 | |
mmap(0xc820000000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc820000000 | |
mmap(0xc81fff8000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc81fff8000 | |
mmap(0xc000000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc000000000 |
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
tatsuru@moryo$ for char in {a..z}; do; which -a $char; done ~ | |
a not found | |
b not found | |
c not found | |
d not found | |
e not found | |
f not found | |
g not found | |
h not found | |
i not found |
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
- GCE 個人アカウント作る。$300 無料すごい | |
- なんか既にプロジェクトがあった。前に作ったGAEっぽい | |
- gcutil deprecated って言われてた https://cloud.google.com/compute/docs/gcutil/ | |
-- のでこっちでやる https://cloud.google.com/compute/docs/gcloud-compute/#install | |
-- gcutil を PATH から消せとか zshrc への追加とかいろいろやってくれて便利 | |
- startup-script 便利 | |
-- gcloud compute instances create test01 --metadata startup-script="apt update; apt install -y nginx-full" --image debian-8 | |
- metadata https://cloud.google.com/compute/docs/metadata | |
-- 変なヘッダつけないと 403 | |
--- curl -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/disks/0/mode |
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
\timing on | |
\set HISTSIZE 1000000 | |
\pset pager off |
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 | |
# | |
# [plugin.metrics.battery] | |
# command = "/path/to/x240battery.sh" | |
# | |
LANG=C | |
if [ x$MACKEREL_AGENT_PLUGIN_META = x1 ]; then | |
cat <<EOF |
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 | |
usage() { | |
echo "Usage: $0 [-m METRIC_NAME] [-u USER] [-p PASSWORD] [-d DATABASE] [-h]" | |
} | |
METRIC_NAME=theschwartz.count | |
DBUSER=root | |
DBPASS= | |
DATABASE=theschwartz |
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 ruby | |
require 'json' | |
def parse(uri) | |
JSON.parse `curl -s #{uri}`.gsub("/*\n * This file is intended for use only on aws.amazon.com. We do not guarantee its availability or accuracy.\n *\n * Copyright 2014 Amazon.com, Inc. or its affiliates. All rights reserved.\n */\ncallback({",'{').gsub("\);", '').gsub(/([a-zA-Z]+):/, '"\1":') | |
end | |
puts %w( | |
region |
NewerOlder