This file contains 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 | |
mode_identifier = `system_profiler SPHardwareDataType | awk '/Model Identifier:/ {print $3}'` | |
`open http://www.everymac.com/ultimate-mac-lookup/?search_keywords=#{mode_identifier}` |
This file contains 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 | |
def what_quarter_now | |
month = Time.now.strftime("%-m") | |
if month == 6 || 7 || 8 | |
puts "1Q" | |
elsif month == 9 || 10 || 11 | |
puts "2Q" | |
elsif month == 12 || 1 || 2 |
This file contains 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 | |
# | |
# Install vault by HashiCorp | |
cd /usr/local/bin | |
wget -O vault.zip https://dl.bintray.com/mitchellh/vault/vault_0.2.0_linux_amd64.zip | |
yum install -y unzip | |
unzip vault.zip | |
rm vault.zip |
This file contains 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
Ohai.plugin(:PublicIp) do | |
provides 'public_ip' | |
collect_data do | |
public_ip Mash.new | |
public_ip[:public_ip] = `curl -s http://whatismyip.akamai.com/` | |
end | |
end |
This file contains 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' | |
class CookMan < Thor | |
desc "prepare", "Prepare to one or more hosts" | |
option :hostname, :required => true, :aliases => :h, :type => :array | |
def prepare | |
options[:hostname].each do |h| | |
system "bundle exec knife solo prepare #{h}" |
This file contains 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
{ | |
"builders": [ | |
{ | |
"type": "virtualbox-ovf", | |
"source_path": "/path/to/sample.ova", | |
"ssh_username": "vagrant", | |
"ssh_password": "vagrant", | |
"shutdown_command": "echo 'vagrant' | sudo -S /sbin/shutdown -h now" | |
} | |
], |
This file contains 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
# Kickstart file automatically generated by anaconda. | |
#version=DEVEL | |
install | |
cdrom | |
lang en_US.UTF-8 | |
keyboard jp106 | |
network --onboot yes --device eth0 --bootproto dhcp --noipv6 | |
network --onboot no --device eth1 --bootproto dhcp --noipv6 | |
rootpw --iscrypted <暗号化されたパスワード> |
This file contains 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 centos:5.11 | |
RUN \ | |
yum install -y httpd && \ | |
chkconfig httpd on && \ | |
/etc/init.d/httpd start |
This file contains 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
{ | |
"builders": [ | |
{ | |
"type": "virtualbox-ovf", | |
"source_path": "my_box.ova", | |
"ssh_username": "vagrant", | |
"ssh_password": "vagrant", | |
"shutdown_command": "echo 'vagrant' | sudo -S /sbin/shutdown -h now" | |
} | |
], |
This file contains 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
{ | |
"variables": { | |
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}", | |
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}" | |
}, | |
"builders": [ | |
{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", |