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 'thor' | |
require 'octokit' | |
class GHT < Thor | |
include Thor::Actions | |
class_option :access_token | |
class_option :org, aliases: '-o', desc: 'organization' |
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/ruby | |
require 'jwt' # oops... | |
gem 'google-api-client', '0.8.6' | |
require 'google/api_client' | |
scope = [ | |
'https://www.googleapis.com/auth/drive', | |
'https://spreadsheets.google.com/feeds/', | |
] | |
client_id = ARGV[0] || fail("set client_id") |
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
source 'https://rubygems.org' | |
gem 'dotenv' | |
gem 'google_drive', github: 'holysugar/google-drive-ruby', branch: 'upload-in-collection' | |
gem 'sinatra' | |
gem 'haml' | |
gem 'pry' |
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
require 'fluent/filter' | |
require 'json' | |
class Fluent::BqSchemaFilter < Fluent::Filter | |
Fluent::Plugin.register_filter('bq_schema', self) | |
config_param :key_name, :string, default: 'op' | |
config_param :schema_dir, :string, default: '/tmp/td-agent/' | |
config_param :field_string, :array, default: nil |
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 | |
sudo xcodebuild -license | |
xcode-select --install | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew doctor | |
brew update |
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
gcloud compute instances list | | |
grep '^projectname-web' | | |
awk '{print $5}' | | |
tr "\n" " " | | |
xargs gcloud sql instances patch dbinstancename --authorized-network | |
# 本来はタグとかメタデータとかから取る方針にしたいのでこれは手抜き。 | |
# CloudSQL 側でもっと (GAEではなく) GCEなどから受け取れる前提で設定を簡単にできるようにならないのかな… |
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
require 'json' | |
class GCE | |
def initialize(project_id, env) | |
@project_id = project_id | |
@env = env | |
end | |
def instance_list |
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 | |
# ここでは environment と role というメタデータがあると仮定 | |
environment=$1 | |
role=$2 | |
if [ -z "$role" ]; then | |
echo "[usage] $0 environment role" | |
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
#!/bin/bash | |
while read tag; do | |
upper_tag=${tag^^} | |
upper_underscore_tag=${upper_tag//-/_} | |
export GCE_TAG_${upper_underscore_tag}=1 | |
done < <( curl \ | |
-H "X-Google-Metadata-Request: True" \ |
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 | |
# vim: ft=ruby | |
# | |
# Simple Dockerfile build tasks | |
# https://gist.github.com/holysugar/0a78f58d02e52f1af9f2 | |
# | |
# set environment variables before execute: | |
# | |
# - DOCKER_REGISTRY=192.168.xxx.xxx | |
# - DOCKER_PREFIX=yourprefix |