moved to: http://tily.github.io/ja-odt-trans/
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
addresses = node['network']['interfaces']['eth1']['addresses'] | |
ip, info = addresses.find {|k, v| k.match(/^10\./) } | |
netmask = info['netmask'] | |
file '/etc/sysconfig/network-scripts/ifcfg-eth1' do | |
content <<-EOF | |
DEVICE=eth1 | |
ONBOOT=yes | |
BOOTPROTO=static |
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
hostname = ENV['HOSTNAME'] | |
pkgs = %w( | |
java-1.7.0-openjdk | |
java-1.7.0-openjdk-demo | |
java-1.7.0-openjdk-devel | |
java-1.7.0-openjdk-javadoc | |
java-1.7.0-openjdk-src | |
) | |
pkgs.each do |pkg| |
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 ruby | |
WORKDIR /usr/local/app | |
RUN gem install nifty-cloud-sdk --pre |
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
%w(open-uri nokogiri).each {|x| require x } | |
URL = 'http://rubygems.org/gems/rubygems-update/versions' | |
def get_versions | |
versions = [] | |
doc = Nokogiri::HTML open(URL) | |
doc.xpath('//ol/li/a').each do |a| | |
versions << a.text | |
end | |
versions |
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
require 'spec_helper' | |
describe package('mysql-server') do | |
it { should be_installed } | |
end | |
describe service('mysqld') do | |
it { should be_enabled } | |
it { should be_running } | |
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
#!/bin/bash | |
OPSWORKS_USERDATA_LOG_FILE='/var/log/aws/opsworks/user-data.log' | |
export OPSWORKS_USERDATA_LOG_FILE | |
mkdir -p $(dirname ${OPSWORKS_USERDATA_LOG_FILE}) | |
touch ${OPSWORKS_USERDATA_LOG_FILE} && chmod 0600 ${OPSWORKS_USERDATA_LOG_FILE} | |
exec &> >(tee -a ${OPSWORKS_USERDATA_LOG_FILE}) 2>&1 | |
conslog () { | |
echo "[$(date --rfc-2822)] opsworks-init: $1" | tee -a ${OPSWORKS_USERDATA_LOG_FILE} > /dev/console |
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
require 'rubygems' | |
require 'amqp' | |
BANNER = 'ruby amqp-test.rb [hostname]' | |
def main(args) | |
host = args.first | |
abort BANNER if host.nil? | |
EventMachine.run do |