Skip to content

Instantly share code, notes, and snippets.

@hechien
Created August 22, 2012 14:19
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 hechien/3426056 to your computer and use it in GitHub Desktop.
Save hechien/3426056 to your computer and use it in GitHub Desktop.
API = 'api_key_here'
require 'linode'
l = Linode.new(api_key: API)
linode_ids = l.linode.list.map{ |server| server.linodeid }
local_ips = linode_ids.map { |id| l.linode.ip.list(LinodeID: id).map{ |record| record.ipaddress } }.flatten
# 再拿local_ips產生iptables command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment