Skip to content

Instantly share code, notes, and snippets.

View Tardis07's full-sized avatar
😿
A Whisker Away

奶茶说 Tardis07

😿
A Whisker Away
View GitHub Profile
@Tardis07
Tardis07 / list_cn_ip.rb
Created August 6, 2022 08:01 — forked from quark-zju/list_cn_ip.rb
List allocated china ip addresses
#!/usr/bin/env ruby
# List latest china IPv4 list
require 'open-uri'
(ARGF.path == '-' ? open('http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest') : ARGF).lines.each do |l|
next if !l.include?('ipv4') || l.include?('*')
cc, type, start, value = l.split('|')[1, 4]