$ gem install chef
$ gem install knife-solo
$ knife configure
いろいろきかれるのでてきとうにEnter
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
1.upto(100) { |i| puts (s = "#{['Fizz'][i % 3]}#{['Buzz'][i % 5]}").empty? ? i : s } |
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
puts (1..100).map { |i| (s = (i % 3 == 0 ? 'Fizz' : '') << (i % 5 == 0 ? 'Buzz' : '')).empty? ? i : s } |
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
1.upto(100) { |i| puts (s = (i % 3 == 0 ? 'Fizz' : '') + (i % 5 == 0 ? 'Buzz' : '')).empty? ? i : s } |
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
def dir_require(path) | |
Dir.glob("#{path}/*.rb", &method(:require)) | |
end |
# yum -y install libyaml libyaml-devel zlib zlib-devel readline readline-devel openssl openssl-devel libxml2 libxml2-devel libxslt libxslt-devel
# cd /usr/local
# git clone git@github.com:sstephenson/rbenv.git rbenv
# mkdir rbenv/shims rbenv/versions rbenv/plugins
# cd rbenv/plugins
# git clone git@github.com:sstephenson/ruby-build.git ruby-build
# cd /usr/local
# groupadd rbenv
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
1.upto(100) { |i| puts (i % 15).zero? ? 'FizzBuzz' : (i % 3).zero? ? 'Fizz' : (i % 5).zero? ? 'Buzz' : i } |