Created
December 23, 2009 04:12
-
-
Save abhiyerra/262301 to your computer and use it in GitHub Desktop.
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 | |
# sudo gem install rick-linode | |
require 'rubygems' | |
require 'open-uri' | |
require 'linode' | |
LinodeAPIKey = '<LINODE_API_KEY_HERE>' | |
DomainID = '<DOMAIN_ID>' | |
ResourceID = '<RESOURCE_ID>' | |
myip_url = 'http://www.ocf.berkeley.edu/~abhi/myip/' | |
ip_address = open(myip_url).read | |
puts ip_address | |
linode = Linode.new(:api_key => LinodeAPIKey) | |
puts linode.domain.resource.update(:DomainID => DomainID, :ResourceID => ResourceID, :Target => ip_address) |
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
<?php | |
echo $_SERVER['REMOTE_ADDR']; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment