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
ruby_block do | |
resource = resource("mysql_user:foo") | |
resource.server_ip = wait_for_server_ip | |
end | |
mysql_user "foo" do | |
server_ip nil | |
.... | |
end |
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
ruby_block do | |
myserver_ip = wait_for_database_ip | |
end | |
mysql_user "foo" do | |
server_ip myserver_ip | |
.... | |
end |
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 'rubygems' | |
require 'eventmachine' | |
module Console | |
PROMPT = "\n>> ".freeze | |
def post_init | |
send_data PROMPT | |
send_data "\0" | |
end |
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
# work in progress | |
domain=www.somedomain.com | |
root_domain=`echo $domain | sed 's:www\.::'` | |
while true; do | |
clear | |
if [ `dig $domain +short | wc -l` -gt 1 ]; then | |
echo 'still bad...'; | |
else | |
echo 'Caching servers are ok now!!!!!!!!!!!!!!!!!!' | |
for nameserver in `dig $root_domain NS +short`; do |
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
module HasAttributesFor | |
module ActiveRecord | |
def self.included(ar) | |
ar.extend ClassMethods | |
end | |
module ClassMethods | |
def has_attributes_for(association) | |
primary_key_name = reflect_on_association(association).primary_key_name | |
NewerOlder