Skip to content

Instantly share code, notes, and snippets.

View bigwheel's full-sized avatar

k.bigwheel (kazufumi nishida) bigwheel

View GitHub Profile
{
"builders": [
{
"type": "amazon-ebs",
"ssh_pty": "true",
"region": "ap-northeast-1",
"source_ami_filter": {
"filters": {
"architecture": "x86_64",
"name": "amzn-ami-hvm-*.0.20*-ebs,amzn-ami-hvm-*.1.20*-ebs,amzn-ami-hvm-*.2.20*-ebs,amzn-ami-hvm-*.3.20*-ebs,amzn-ami-hvm-*.4.20*-ebs,amzn-ami-hvm-*.5.20*-ebs,amzn-ami-hvm-*.6.20*-ebs,amzn-ami-hvm-*.7.20*-ebs,amzn-ami-hvm-*.8.20*-ebs,amzn-ami-hvm-*.9.20*-ebs",
% AWS_DEFAULT_PROFILE=dev-shared-provisioning-script-deployer ./create_ami.sh
amazon-ebs output will be in this color.
==> amazon-ebs: Force Deregister flag found, skipping prevalidating AMI Name
==> amazon-ebs: No AMI was found matching filters: {
==> amazon-ebs: Filters: [
==> amazon-ebs: {
==> amazon-ebs: Name: "root-device-type",
==> amazon-ebs: Values: ["ebs"]
==> amazon-ebs: },
@bigwheel
bigwheel / configure_password_on_all_servers.sh
Created April 27, 2016 07:20
暫定的にパスワードを振られたアカウントを多数受領したときに、一括で自分のパスワードへ変える方法(ttyが有効になっていてsudo権限がありsshpassがインストールされている前提)
#!/usr/bin/env bash
set -ex
ip_list=()
ip_list+=("192.168.1.1")
ip_list+=("192.168.1.2")
ip_list+=("192.168.1.3")
ip_list+=("192.168.1.4")
@bigwheel
bigwheel / print_casual_stacktrace.php
Last active December 22, 2015 10:29
phpで任意の箇所でスタックトレース表示するコード
foreach (debug_backtrace() as $func)
{
\Log::warning($func['file'] . ' - ' . $func['class'] . $func['type']
. $func['function'] . '(' . $func['args'] . ')[L' . $func['line'] . ']');
}
@bigwheel
bigwheel / main.rb
Last active December 16, 2015 12:18
Magic: the Gatheringカードメージギャラリーから@wikiフォーマットでドラフト点数表のテンプレートを作る
#!/bin/env ruby
# -*- coding: utf-8 -*-
require 'open-uri'
require 'nokogiri'
require 'pry'
doc = Nokogiri::HTML(open('http://www.wizards.com/magic/tcg/article.aspx?' +
'x=mtg/tcg/dragonsmaze/cig',
'Accept-Language' => 'ja,en-US;q=0.8,en;q=0.6'))
@bigwheel
bigwheel / gist:3909586
Created October 18, 2012 02:45
ランダムに2チームへ分けるスクリプト scala編
import scala.util.Random
object lunch_script {
def main(args: Array[String]) : Unit = {
val splitMember = shuffleAndSplit(args.toList, 20121018)
println(splitMember._1)
println(splitMember._2)
}
def shuffleAndSplit(member: List[String], date: Long) : (List[String], List[String]) = {
@bigwheel
bigwheel / gist:3650445
Created September 6, 2012 03:06
ランダムに2チームへ分けるスクリプト グッパでホイ編
#!/usr/bin/env ruby
class Member
attr_reader :name
def initialize(name)
@name = name
end
def hand
@bigwheel
bigwheel / gist:3431969
Created August 23, 2012 03:39
ランダムに2チームへ分けるスクリプト ハイアンドロー編
#!/usr/bin/env ruby
class Member
attr_reader :name
def initialize(name)
@name = name
end
def win?(opponent)
raise 'should be overrided'
end
@bigwheel
bigwheel / gist:3366148
Created August 16, 2012 03:12
ランダムに2チームへ分けるスクリプト ジャンケン編 - モジュールに機能を分離
#!/usr/bin/env ruby
class Member
attr_reader :name
def initialize(name)
@name = name
end
end
class Symbol
@bigwheel
bigwheel / gist:3300587
Created August 9, 2012 03:13
ランダムに2チームへ分けるスクリプト ジャンケン編
#!/usr/bin/env ruby
class Member
attr_reader :name
def initialize(name)
@name = name
end
def win?(opponent)
result_table = { gu: { gu: :even, choki: :win, pa: :lose },