Skip to content

Instantly share code, notes, and snippets.

@abhiyerra
Created December 23, 2009 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhiyerra/262301 to your computer and use it in GitHub Desktop.
Save abhiyerra/262301 to your computer and use it in GitHub Desktop.
#!/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)
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment